Skip to content

Commit

Permalink
Add a more detailed error message for bad colData category (cat)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahuuki committed Apr 11, 2023
1 parent 933af2c commit 9ce4a42
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions R/plot_gene_express.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9ce4a42

Please sign in to comment.