From 5f96d7423801925530c8aa8ba7277f734aef2c61 Mon Sep 17 00:00:00 2001 From: Ruth Kristianingsih Date: Tue, 5 Sep 2023 05:13:30 +0100 Subject: [PATCH] Added minimum variance threshold when using Z-score scaling --- R/process_data.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/process_data.R b/R/process_data.R index 9e1184b..a1a3f2b 100644 --- a/R/process_data.R +++ b/R/process_data.R @@ -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