Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion inst/rmd/umccrise/cancer_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ qc_summary_all <- dplyr::tribble(
~n, ~variable, ~value, ~details,
4, "Hypermutated", ifelse(hypermutated, "TRUE", "FALSE"),
ifelse(hypermutated, glue::glue(
"More than 500K SNVs detected (including non-PASS), priority regions and/or variants ",
"More than 450K SNVs detected (including non-PASS), priority regions and/or variants ",
"selected for processing.",
), ""),
5, "MutSigs (Old)", glue::glue("{summarise_sigs(sigs_snv_2015)}"),
Expand Down
51 changes: 51 additions & 0 deletions tests/testthat/test-canrep-cli.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Tests for canrep CLI argument parsing
# Guards against regression where --dragen_hrd was accidentally marked required=TRUE
# (introduced in 563f946, fixed in PR #94 and again in 2.3.1)

canrep_parser <- function() {
cli_path <- system.file("cli/canrep.R", package = "gpgr")
source(cli_path, local = TRUE)
p <- argparse::ArgumentParser()
sp <- p$add_subparsers(dest = "command")
canrep_add_args(sp)
p
}

required_args <- function() {
c(
"canrep",
"--af_global", "x",
"--af_keygenes", "x",
"--batch_name", "x",
"--img_dir", "x",
"--key_genes", "x",
"--oncokb_genes", "x",
"--somatic_snv_vcf", "x",
"--somatic_snv_summary", "x",
"--somatic_sv_tsv", "x",
"--somatic_sv_vcf", "x",
"--purple_som_gene_cnv", "x",
"--purple_som_cnv_ann", "x",
"--purple_som_cnv", "x",
"--purple_purity", "x",
"--purple_qc", "x",
"--purple_som_snv_vcf", "x",
"--virusbreakend_tsv", "x",
"--virusbreakend_vcf", "x",
"--bcftools_stats", "x",
"--result_outdir", "x",
"--tumor_name", "x"
)
}

test_that("canrep parses without --dragen_hrd (optional)", {
p <- canrep_parser()
args <- p$parse_args(required_args())
expect_null(args$dragen_hrd)
})

test_that("canrep parses with --dragen_hrd when provided", {
p <- canrep_parser()
args <- p$parse_args(c(required_args(), "--dragen_hrd", "sample.hrdscore.csv"))
expect_equal(args$dragen_hrd, "sample.hrdscore.csv")
})