From 389beac656439ac4a7de1d8aa640b3c83f5d1332 Mon Sep 17 00:00:00 2001 From: vertesy Date: Mon, 10 Jun 2024 15:32:57 +0200 Subject: [PATCH] nf filterNcGenes --- R/Seurat.Utils.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/Seurat.Utils.R b/R/Seurat.Utils.R index e8857a7..7f5705a 100644 --- a/R/Seurat.Utils.R +++ b/R/Seurat.Utils.R @@ -1008,7 +1008,7 @@ filterNcGenes <- function(genes, pattern_NC = c("^AC[0-9].+", "^AL[0-9].+", "^AP "^AF[0-9].+", "^Z[0-9]+.+", "^LINC0.+", "^C[1-9]orf.+", "^MIR[1-9].+", ".+\\.AS[1-9]$", ".+\\.DT[1-9]$"), - ...) { + unique = TRUE, ...) { # Input assertions stopifnot(is.character(genes), length(genes) > 0, @@ -1034,6 +1034,8 @@ filterNcGenes <- function(genes, pattern_NC = c("^AC[0-9].+", "^AL[0-9].+", "^AP # Output assertions stopifnot(is.character(genes_kept), length(genes_kept) <= original_length) + if(unique) genes_kept <- unique(genes_kept) + return(genes_kept) }