diff --git a/DESCRIPTION b/DESCRIPTION index b570f5f..0fb907b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -25,7 +25,7 @@ Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.1 Depends: - R (>= 4.4.0) + R (>= 4.3.0) Imports: SpatialExperiment, SummarizedExperiment, diff --git a/R/findArtifacts.R b/R/findArtifacts.R index 6de480a..c1bb80e 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", tmp.name)]][spe.temp$Kmeans==1]) - clus2_mean <- mean(colData(spe.temp)[[paste0("k", tmp.name]][spe.temp$Kmeans==2]) + clus1_mean <- mean(colData(spe.temp)[[tmp.name]][spe.temp$Kmeans==1]) + clus2_mean <- mean(colData(spe.temp)[[tmp.name]][spe.temp$Kmeans==2]) artifact_clus <- which.min(c(clus1_mean, clus2_mean))