From 96dcf6877b033ff03814c942f7855f152f59bfaf Mon Sep 17 00:00:00 2001 From: Benjamin James Date: Fri, 9 Feb 2024 11:54:29 -0500 Subject: [PATCH] null reduction --- R/deg.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/R/deg.R b/R/deg.R index 05652a2..75422b6 100644 --- a/R/deg.R +++ b/R/deg.R @@ -92,7 +92,12 @@ deg.dysregulation <- function(sce, pathology, sample.col, covariates=NULL, verb cd = SummarizedExperiment::colData(pb) if (attr(pb, "class") == "SingleCellExperiment") { rd = SingleCellExperiment::reducedDims(sce)[[reduction]] - X = t(rd) + if (!is.null(rd)) { + X = t(rd) + } else { + pb = se_tmm(pb, log=TRUE) + X = SummarizedExperiment::assays(pb)$TMM + } } else { pb = se_tmm(pb, log=TRUE) X = SummarizedExperiment::assays(pb)$TMM