From 8a1fbf57385bf265031a0006a4353b30ebce52d8 Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 10 Jan 2023 21:46:07 -0500 Subject: [PATCH] Patch errors on no fully zero genes --- R/integrated.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/integrated.R b/R/integrated.R index d595dfb..1ff0cb5 100644 --- a/R/integrated.R +++ b/R/integrated.R @@ -9,7 +9,9 @@ nonselftalk <- function(mat_type, lrp) { index <- which(Matrix::rowSums(mat_type != 0) == 0) - mat_type[index, ] <- add_noise(mat_type[index, ]) + if (length(index) > 0) { + mat_type[index, ] <- add_noise(mat_type[index, ]) + } mat_disc <- discretize_sparse( Matrix::t(mat_type), "equalwidth", max(2, ncol(mat_type)^(1/2)))