Skip to content

Commit

Permalink
Added minimum variance threshold when using Z-score scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthkr committed Sep 5, 2023
1 parent 655d0fb commit 5f96d74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/process_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ scale_data <- function(all_data, scaling_method = c("none", "z-score", "min-max"

# Scale replicates data
all_data$expression_value <- (all_data$expression_value - all_data$mean_val) / all_data$sd_val
all_data$var <- all_data$var / (all_data$sd_val)^2
all_data$var <- pmax(all_data$var / (all_data$sd_val)^2, 0.75^2)
all_data[, c("mean_val", "sd_val") := NULL]
} else if (scaling_method == "min-max") {
# Calculate minimum and maximum of expression in all_data by accession
Expand Down

0 comments on commit 5f96d74

Please sign in to comment.