From 4772ff5a3b42128b352a9faeae40848737524da5 Mon Sep 17 00:00:00 2001 From: Michael Totty Date: Wed, 20 Mar 2024 10:28:22 -0500 Subject: [PATCH] changed from specific k18 for mean comparison of clusters in findArtifacts, to tmp.name (the last K-size loop) --- R/findArtifacts.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/findArtifacts.R b/R/findArtifacts.R index c8be303..6de480a 100644 --- a/R/findArtifacts.R +++ b/R/findArtifacts.R @@ -128,8 +128,8 @@ findArtifacts <- function(spe, mito_percent="expr_chrM_ratio", # =========== Artifact annotation =========== # calculate average local variance of the two clusters - clus1_mean <- mean(colData(spe.temp)[[paste0("k", 18)]][spe.temp$Kmeans==1]) - clus2_mean <- mean(colData(spe.temp)[[paste0("k", 18)]][spe.temp$Kmeans==2]) + clus1_mean <- mean(colData(spe.temp)[[paste0("k", tmp.name)]][spe.temp$Kmeans==1]) + clus2_mean <- mean(colData(spe.temp)[[paste0("k", tmp.name]][spe.temp$Kmeans==2]) artifact_clus <- which.min(c(clus1_mean, clus2_mean))