diff --git a/R/plot_gene_express.R b/R/plot_gene_express.R index 193dc5f..ec6a62f 100644 --- a/R/plot_gene_express.R +++ b/R/plot_gene_express.R @@ -41,8 +41,13 @@ plot_gene_express <- function(sce, plot_points = FALSE, ncol = 2) { stopifnot(any(genes %in% rownames(sce))) - stopifnot(cat %in% colnames(colData(sce))) - stopifnot(assay_name %in% SummarizedExperiment::assayNames(sce)) + + if(!cat %in% colnames(colData(sce))){ + message("ERROR '", cat, "' is not a column name in colData(sce), check that `cat` matches this sce") + stop() + } + + stopifnot(assay_name %in% SummarizedExperiment::assayNames(sce)) value <- NULL