From 2cdf42fcd999034810e4f454428e59a0b16b8e52 Mon Sep 17 00:00:00 2001 From: Saori Sakaue Date: Wed, 14 Aug 2024 15:01:31 -0400 Subject: [PATCH] handling no-count-peaks --- R/SCENTfunctions.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/SCENTfunctions.R b/R/SCENTfunctions.R index 1dc102c..0a89055 100644 --- a/R/SCENTfunctions.R +++ b/R/SCENTfunctions.R @@ -166,7 +166,9 @@ SCENT_algorithm <- function(object, celltype, ncores, regr = "poisson", bin = TR #binarize peaks: if(bin){ - atac_target[atac_target$atac>0,]$atac<-1 + if(nrow(atac_target[atac_target$atac>0,])>0){ + atac_target[atac_target$atac>0,]$atac<-1 + } } mrna_target <- object@rna[gene,]