From 1e64649e28f84de39c23830818d5d0da95308848 Mon Sep 17 00:00:00 2001 From: Diego Diez Date: Thu, 18 Jul 2024 15:58:32 +0900 Subject: [PATCH] Fix pseudobulk when no samples data.frame is passed. --- R/pseudobulk.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/pseudobulk.R b/R/pseudobulk.R index 5b67dcb..997fe2d 100644 --- a/R/pseudobulk.R +++ b/R/pseudobulk.R @@ -40,7 +40,9 @@ pseudobulk.Seurat <- function(x, split.by, group.by, samples=NULL, genes=NULL, a if (is.null(samples)) { samples <- x[[]][[group.by]] if (!is.factor(samples)) - samples <- levels(factor(samples)) + samples <- factor(samples) + + samples <- levels(samples) samples <- data.frame(row.names=samples) }