From 3c42304a0d9d33b42e9bd72a12297575e3db8591 Mon Sep 17 00:00:00 2001 From: vertesy Date: Wed, 19 Jun 2024 18:20:27 +0200 Subject: [PATCH] ... --- R/Seurat.Utils.Visualization.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Seurat.Utils.Visualization.R b/R/Seurat.Utils.Visualization.R index e5b3880..2d67423 100644 --- a/R/Seurat.Utils.Visualization.R +++ b/R/Seurat.Utils.Visualization.R @@ -3251,7 +3251,7 @@ scBarplotEnrichr <- function(df.enrichment, nr_input_genes <- length(df.enrichment@'gene') pobj <- - if(nrow(df.enrichment) < 1) { + if(nrow(df.enrichment) < 1 | is.null (df.enrichment)) { warning("No enriched terms input!", immediate. = TRUE) ggplot() + theme_void() + annotate("text", x = 1, y = 1, label = "NO ENRICHMENT", size = 8, color = "red", hjust = 0.5, vjust = 0.5)