Skip to content

Commit

Permalink
add validation for input types
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-t committed Aug 6, 2024
1 parent 6dfd4b2 commit bbc4def
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion R/plot_shinygosling.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,24 @@ plot_granges <-
title = "GRanges Plot",
subtitle = "Stacked nucleotide example")
{
# Define categories and color mapping
## Validate input
stopifnot(
"Input must be a GRanges or GPos object" =
inherits(gr, c("GRanges", "GPos"))
)
stopifnot(
"Option must be a " =
class(title)=="character"
)
stopifnot(
"Option must be a " =
class(subtitle)=="character"
)




## Define categories and color mapping
categories <- c("likely_benign", "ambiguous", "likely_pathogenic")
colormapping <- c("#89d5f5", "gray", "#f56c6c")

Expand Down

0 comments on commit bbc4def

Please sign in to comment.