Skip to content

Commit

Permalink
combine assertions into one stopifnot(), plot_type is already che…
Browse files Browse the repository at this point in the history
…cked later in the plotting function at line192.
  • Loading branch information
lee-t committed Sep 19, 2024
1 parent 73f173d commit 57cbc97
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions R/plot_granges.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,11 @@ plot_granges <-
{
## Validate input
stopifnot(
"Input must be a GRanges or GPos object" =
inherits(gr_input, c("GRanges", "GPos"))
)
stopifnot(
"Title must be a scalar string" =
is.character(title) && length (title) == 1 && !is.na(title) &&
nzchar(title)
is(granges, "GRanges"),
isScalarCharacter(title),
isScalarCharacter(subtitle),
isScalarCharacter(plot_type)
)
stopifnot(
"Subtitle must be a scalar string" =
is.character(subtitle) && length (subtitle) == 1 && !is.na(subtitle)
&& nzchar(subtitle)
)
stopifnot(
"Type must be a scalar string" =
is.character(plot_type) && length (plot_type) == 1 && !is.na(plot_type)
&& nzchar(plot_type)
)

## Define categories and color mapping
categories <- c("likely_benign", "ambiguous", "likely_pathogenic")
Expand Down

0 comments on commit 57cbc97

Please sign in to comment.