From e494ed57f978bd5d0bf6ecc4538a8e04954f1a11 Mon Sep 17 00:00:00 2001 From: Quentin Clayssen Date: Mon, 25 May 2026 09:55:42 +1000 Subject: [PATCH 1/2] test: assert --dragen_hrd is optional in canrep CLI Regression guard: 563f946 accidentally re-introduced required=TRUE, causing crashes on samples without DRAGEN HRD files. --- tests/testthat/test-canrep-cli.R | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tests/testthat/test-canrep-cli.R diff --git a/tests/testthat/test-canrep-cli.R b/tests/testthat/test-canrep-cli.R new file mode 100644 index 0000000..d29caf7 --- /dev/null +++ b/tests/testthat/test-canrep-cli.R @@ -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") +}) From 0c68a6f87a925e50894e3a902e8b39107b8d53c6 Mon Sep 17 00:00:00 2001 From: Quentin Clayssen Date: Wed, 5 Aug 2026 09:31:16 +1000 Subject: [PATCH 2/2] docs: fix stale 500K hypermutation threshold in cancer report QC table Actual bolt safety threshold is 450,000 (MAX_SOMATIC_VARIANTS, ADR-001), not 500K. --- inst/rmd/umccrise/cancer_report.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/rmd/umccrise/cancer_report.Rmd b/inst/rmd/umccrise/cancer_report.Rmd index d6be0a4..f720a31 100644 --- a/inst/rmd/umccrise/cancer_report.Rmd +++ b/inst/rmd/umccrise/cancer_report.Rmd @@ -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)}"),