Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
5b0598d
Make sigrap (HRDetect, MutationalPatterns) individual process (#16)
qclayssen Aug 27, 2025
bcfcca0
linting
qclayssen Aug 26, 2025
26e3758
run more linting markdown and pre-commit
qclayssen Sep 16, 2025
b2ff432
add citation doi
qclayssen Oct 7, 2025
1054bfc
pcgr 2.2.1 for sash (#17)
qclayssen Oct 7, 2025
f9a96bb
add process and config for vcf2maf (#15)
qclayssen Oct 7, 2025
acea52a
Merge branch 'main' into release/0.7.0
qclayssen Oct 8, 2025
dc2fc10
fix typo
qclayssen Oct 8, 2025
595e542
remove debug command
qclayssen Oct 24, 2025
9c4bbff
0.70 test dependancy (#36)
qclayssen Oct 24, 2025
921f422
remove trailing whitespace
qclayssen Oct 31, 2025
b017b56
add XDG_CACHE_HOME path, solve issue sigven/pcgr#246
qclayssen Oct 31, 2025
5e46654
change path of XDG_CACHE_HOME modules to general env
qclayssen Nov 6, 2025
74c3522
bump sigrap version to dev 7
qclayssen Nov 6, 2025
116421e
bump gpgr dev version 14
qclayssen Nov 6, 2025
265faaf
Feat/prepare reference (#38)
qclayssen Nov 7, 2025
f9c4a64
Convert dragen dir paths to file objects (#12)
alexiswl Aug 11, 2025
672c302
update path vep_dir
qclayssen Nov 17, 2025
99aa12a
bump and synchronised bolt version
qclayssen Nov 24, 2025
39abd73
bump bolt version 0.3.0-dev-20
qclayssen Nov 25, 2025
d8365a2
revert gpgr container version
qclayssen Nov 25, 2025
5f01cf1
bump bolt version
qclayssen Dec 18, 2025
b9f152a
add label to process affected by hypermutated sample
qclayssen Dec 19, 2025
43784fe
bump bolt dev version to 27
qclayssen Dec 19, 2025
d3ea980
bump bolt dev version to 27
qclayssen Dec 22, 2025
db899ea
change label process_low to process_medium_memory for hypermutated sa…
qclayssen Dec 22, 2025
879ce3c
add process_medium_memory label to match ica config
qclayssen Dec 22, 2025
095caa3
fix typo
qclayssen Dec 23, 2025
6b11334
fix typo
qclayssen Dec 23, 2025
89fb9f9
change input vcf2maf to get pcgr reported variants
qclayssen Jan 20, 2026
ec18125
typo
qclayssen Jan 21, 2026
a854a20
typo abd chord input file check exist
qclayssen Jan 21, 2026
98b6ec1
fix stub for vcf2maf
qclayssen Mar 19, 2026
6cb5d38
add meta data to pcgr_pass_vcf from BOLT_SMLV_SOMATIC_REPORT
qclayssen Mar 24, 2026
23f2d5c
remove dupliate channel
qclayssen Mar 25, 2026
00a881e
add reference ensemble genome use by PCGR for VCF2MAF
qclayssen Mar 26, 2026
33ff6d0
add meta data mapping
qclayssen Mar 27, 2026
1264cae
chore: bump cancer_report container to bolt:0.3.0-dev-gpgr
qclayssen May 7, 2026
3fc9764
Update bolt cancer_report container to ghcr.io/umccr/bolt:0.3.0-dev-2…
qclayssen May 12, 2026
5e33d42
Bump version: 0.6.3 → 0.7.0
qclayssen May 13, 2026
e0d37b6
Bump all bolt containers to ghcr.io/umccr/bolt:0.3.0-dev-29
qclayssen May 13, 2026
b246d5a
update change log
qclayssen May 13, 2026
dfb703a
remove chord, input now from OA
qclayssen May 13, 2026
949608c
remove fasta_ensembl now from tarball
qclayssen May 13, 2026
28331e6
fix id to tumor id
qclayssen May 13, 2026
57e96fa
bump bolt version to dev-30
qclayssen May 13, 2026
7e088fb
Add addEnsemblFasta for cleaner prepare_reference
qclayssen May 13, 2026
fed190e
add assert size and remove misc_data channel
qclayssen May 13, 2026
b52e648
Bump all bolt containers to
qclayssen May 15, 2026
35c0254
Bump all bolt containers to ghcr.io/umccr/bolt:0.3.1
qclayssen May 18, 2026
27cb5c4
allow explicit DRAGEN VCF paths in samplesheet (#53)
qclayssen May 18, 2026
b56312a
fix process PAVE_SOMATIC checks for MNVTAG in the VCF header before …
qclayssen May 19, 2026
83105a8
Merge main into release/0.7.0
qclayssen May 19, 2026
025d5ed
Address Copilot review comments on PR #39
qclayssen May 19, 2026
a6ee835
Update README for 0.7.0
qclayssen May 19, 2026
e8bd7e6
revert: keep args template pattern in sigrap modules; restore citation
qclayssen May 19, 2026
64a3d80
fix PAVE_SOMATIC: tighten output glob to *.pave.somatic.vcf.gz to pre…
qclayssen May 19, 2026
09a56c0
remove redundant .first() on collect().map{} which is already a value…
qclayssen May 19, 2026
e514647
update changelog with PCGR
qclayssen May 21, 2026
556d5f6
bump sigrap version
qclayssen May 22, 2026
966f3f6
fix: bump bolt containers to 0.3.2 for PCGR hypermutated skip (sash#52)
qclayssen Jul 6, 2026
a06ecd7
fix: migrate sigrap containers to ghcr.io/umccr/sigrap:0.3.0
qclayssen Jul 6, 2026
3a52f70
docs: update CHANGELOG dependencies table for bolt 0.3.2, sigrap 0.3.0
qclayssen Jul 6, 2026
8015ae5
Merge remote-tracking branch 'origin/main' into release/0.7.0
qclayssen Jul 13, 2026
00d9f70
chore: bump version to 0.7.1 (bolt 0.3.2)
qclayssen Jul 17, 2026
05f6f49
feat!: remove plain directory input support from prepare_reference (s…
qclayssen Jul 21, 2026
c223378
docs: update ADR #1 with current PCGR variant limit implementation
qclayssen Jul 21, 2026
bf8939a
fix: resolve merge conflicts with main (version bumps, changelog)
qclayssen Jul 22, 2026
e210eaf
sash: skip VCF2MAF when PCGR not emitted for high-variant-count sampl…
qclayssen Jul 22, 2026
4278a5e
fix(bolt): guard PCGR html mv when PCGR skipped for high-variant-coun…
qclayssen Jul 31, 2026
3951d72
docs: fix stale 500k hypermutation threshold, clarify flag vs TMB impact
qclayssen Aug 4, 2026
e2686e8
fix(pave): eliminate SIGPIPE/pipefail race in MNV guard
qclayssen Aug 5, 2026
b6cdbaa
test: add real (non-stub) nf-test for BOLT_SMLV_SOMATIC_REPORT mv guard
qclayssen Aug 7, 2026
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 .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.7.0
current_version = 0.7.1
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>[a-z0-9+]+)
Expand Down
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@ Initial release of umccr/sash, created with the [nf-core](https://nf-co.re/) tem

### `Deprecated`

## [Unreleased]

### Fixed

- PAVE_SOMATIC MNV guard: `bcftools view -h | grep -q` could receive `SIGPIPE` on large real VCF headers, which under `pipefail` silently skipped MNV filtering even when `MNVTAG` was present, feeding unfiltered variants into PAVE 1.8 ([sash#66](https://github.com/umccr/sash/issues/66))

## [0.7.1] - 2026-07-17

### Fixed

- Bump bolt to 0.3.2: PCGR now gracefully skips hypermutated samples whose variant count still exceeds the per-chunk ceiling ([sash#52](https://github.com/umccr/sash/issues/52)), and PCGR chunk runs disable MSI/TMB estimates that were meaningless on partial VCFs

### Dependencies

| Tool | Old | New |
| ---- | ----- | ----- |
| bolt | 0.3.1 | 0.3.2 |

## [0.7.0] - 2026-05-13

### Added
Expand All @@ -38,14 +56,13 @@ Initial release of umccr/sash, created with the [nf-core](https://nf-co.re/) tem

### Fixed

- Bump bolt to 0.3.2: PCGR now gracefully skips hypermutated samples whose variant count still exceeds the per-chunk ceiling ([sash#52](https://github.com/umccr/sash/issues/52)), and PCGR chunk runs disable MSI/TMB estimates that were meaningless on partial VCFs
- Migrate sigrap containers from personal `docker.io/qclayssen/sigrap:0.3.0-dev-8` build to official `ghcr.io/umccr/sigrap:0.3.0`

### Dependencies

| Tool | Old | New |
| --------- | -------- | -------- |
| bolt | 0.2.17 | 0.3.2 |
| bolt | 0.2.17 | 0.3.1 |
| sigrap | — | 0.3.0 |
| PCGR | — | v2.2.5 |
| PCGR data | 20220203 | 20250314 |
Expand Down
24 changes: 24 additions & 0 deletions docs/adr.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,30 @@ Negative:
- pcgrr HTML skip: `sigven/pcgr`, `pcgrr/R/main.R` ~line 954
- sash #52, bolt #26, bolt #35

### The `Hypermutated` flag in the Cancer Report is a coarser, separate signal

The `Hypermutated: TRUE/FALSE` row curators see in the gpgr Cancer Report QC table is **not** the same thing as the PCGR tiered-filtering cascade described above. A `TRUE` result does not by itself mean clinically-prioritised filtering (steps 2–3 of the cascade) actually ran against that sample's variants.

**How the flag is computed** (bolt ≥ 0.3.0, `bolt/workflows/smlv_somatic/report.py::count_variant_process()`):

```python
counts['is_hypermutated'] = counts['dragen'] > constants.MAX_SOMATIC_VARIANTS
```

`dragen` is the raw DRAGEN variant count — **PASS and non-PASS included** (only novel SAGE calls are excluded). gpgr (≥ commit `f51919d`) reads this flag directly rather than re-deriving it; this replaced an earlier, less reliable inference based on `sage != annotated` count divergence.

**Why a `TRUE` flag doesn't necessarily mean TMB was affected.** The variant-count-limiting cascade in `bolt smlv_somatic annotate` (`annotate.py::select_variants()`) runs independently of, and _before_, `select_pcgr_variants()`. It tries progressively more aggressive reductions and returns as soon as the count is under `MAX_SOMATIC_VARIANTS`:

1. Exclude non-PASS variants (retaining hotspots) — FILTER tag `max_variants_non_pass`. If this alone brings the count under the limit, **the cascade stops here**.
2. Exclude common gnomAD population variants — FILTER tag `max_variants_gnomad`.
3. Restrict to the cancer gene panel region — FILTER tag `max_variants_non_cancer_genes`.

Because `is_hypermutated` is derived purely from the raw (PASS + non-PASS) count, a sample with a lot of non-PASS noise (e.g. FFPE artifacts) can trip the flag while only needing step 1 above — i.e. ordinary PASS-only filtering, identical in effect to what any non-hypermutated sample gets via the separate `BOLT_SMLV_SOMATIC_FILTER` module. In that case PCGR annotates the full PASS(+hotspot) variant set and the resulting TMB is not an underestimate; no cancer-gene-panel-only restriction occurred.

**Real case, verified directly from the published VCF** (2026-08-03, `L2600475__L2600476`): `dragen: 531,556; sage: 531,556; annotated: 163,996; filter_pass: 62,883`. Pulling `smlv_somatic/annotate/L2600475.annotations.vcf.gz` and counting FILTER tags confirms this precisely — `max_variants_non_pass` appears on 367,560 records (531,556 − 367,560 = 163,996 = `annotated`), and `max_variants_gnomad`/`max_variants_non_cancer_genes` appear on **zero** records. The cascade stopped after step 1. The sample was flagged hypermutated, but PCGR's TMB was computed from PASS-only variants with no region-based restriction — i.e. the flag was a false positive with respect to TMB accuracy.

**Caveat for curators:** the flag alone cannot distinguish "raw non-PASS noise tripped the threshold, only ordinary PASS filtering applied" from "PCGR received a clinically-prioritised, region-restricted subset". Confirming which occurred currently requires checking the `annotated`/`filter_pass` counts in `{tumor_id}.somatic.variant_counts_process.json`, or grepping the FILTER column of `{tumor_id}.annotations.vcf.gz` for `max_variants_gnomad`/`max_variants_non_cancer_genes` as above — there is no single boolean for this yet. Changing `is_hypermutated` itself to be based on a PASS-only count (e.g. `filter_pass`, already computed in the same function) has been raised as a follow-up fix in `bolt` (Slack `#genomics-technical`, 2026-08-03 thread on `C025TLC7D`).

---

## ADR #2: SV Caller Replacement — GRIDSS/GRIPSS → eSVee
Expand Down
4 changes: 2 additions & 2 deletions docs/details.md
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ These are populated from the DRAGEN mapping and coverage summary files ingested

- **SV prioritisation**: genes on this list raise a variant's priority tier in the `simple_sv_annotation` step ([Somatic Structural Variants → Prioritization](#somatic-structural-variants))
- **Somatic small variant annotation**: the gene region BED (`umccr_cancer_genes.gene_regions.bed`) and CDS region BED are passed to `bolt smlv_somatic annotate` and `bolt smlv_somatic report` ([modules/local/bolt/smlv_somatic/annotate/main.nf](modules/local/bolt/smlv_somatic/annotate/main.nf), [modules/local/bolt/smlv_somatic/report/main.nf](modules/local/bolt/smlv_somatic/report/main.nf))
- **Hypermutated sample handling**: when variant counts exceed 500,000, variants lacking clinical impact or hotspot annotations are filtered until the threshold is met; the cancer gene list defines what "clinical impact" means in this context
- **Hypermutated sample handling**: when variant counts exceed 450,000 (`MAX_SOMATIC_VARIANTS`), variants lacking clinical impact or hotspot annotations are filtered until the threshold is met; the cancer gene list defines what "clinical impact" means in this context. See [ADR #1](adr.md) for the full cascade and the caveat that the `Hypermutated` flag itself is computed separately, on raw (PASS + non-PASS) counts.

In [v0.6.4](https://github.com/umccr/sash/blob/main/CHANGELOG.md), the CDKN2A MANE Plus Clinical transcript `ENST00000579755` was added, fixing a gap in CDKN2A CDS coverage.

Expand Down Expand Up @@ -717,7 +717,7 @@ A: Rescue is performed by BOLT using SAGE hotspot calls layered onto the DRAGEN

### Q: How are hypermutated samples handled in the current version, and is there any impact on derived metrics such as TMB or MSI?

A: When the post-filter variant count exceeds PCGR's 500,000-variant limit, bolt progressively reduces the variant set before passing it to PCGR. The published filtered VCF and PURPLE-derived TMB/MSI are unaffected. See [ADR #1](adr.md) for the full rationale, implementation details, and history of the cancer report hypermutated flag revert.
A: When the post-filter variant count exceeds bolt's 450,000-variant cap (`MAX_SOMATIC_VARIANTS`, set below PCGR's own 500,000-variant limit as a safety margin), bolt progressively reduces the variant set before passing it to PCGR. The published filtered VCF and PURPLE-derived TMB/MSI are unaffected. See [ADR #1](adr.md) for the full rationale, implementation details, and history of the cancer report hypermutated flag revert — including the caveat that the `Hypermutated` flag itself is computed from the raw (PASS + non-PASS) DRAGEN count, so a `TRUE` result does not necessarily mean region-based filtering was applied to the variants PCGR actually annotated.

### Q: How are we handling non-standard chromosomes if present in the input VCFs (ALTs, chrM, etc)?

Expand Down
25 changes: 17 additions & 8 deletions modules/local/bolt/smlv_somatic/report/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ process BOLT_SMLV_SOMATIC_REPORT {
tuple val(meta), path("output/*.bcftools_stats.txt") , emit: bcftools_stats
tuple val(meta), path("output/*.variant_counts_type.yaml") , emit: counts_type
tuple val(meta), path("output/*.variant_counts_process.json") , emit: counts_process
tuple val(meta), path("output/pcgr/*.pcgr.grch38.pass.vcf.gz"), emit: pcgr_pass_vcf
path 'output/pcgr/' , emit: pcgr_dir
path "output/*.pcgr.grch38.html" , emit: pcgr_report
tuple val(meta), path("output/pcgr/*.pcgr.grch38.pass.vcf.gz"), emit: pcgr_pass_vcf, optional: true
path 'output/pcgr/' , emit: pcgr_dir , optional: true
path "output/*.pcgr.grch38.html" , emit: pcgr_report , optional: true
path 'versions.yml' , emit: versions

when:
Expand Down Expand Up @@ -52,7 +52,12 @@ process BOLT_SMLV_SOMATIC_REPORT {
--threads ${task.cpus} \\
--output_dir output/

mv output/pcgr/${meta.tumor_id}.pcgr.grch38.html output/
# NOTE(QC): PCGR is skipped (and output/pcgr/*.html never created) when the
# sample has too many PASS variants to trim below MAX_SOMATIC_VARIANTS
# (sash #59 / ADR-001) -- guard so the process still exits 0 in that case.
if [[ -f output/pcgr/${meta.tumor_id}.pcgr.grch38.html ]]; then
mv output/pcgr/${meta.tumor_id}.pcgr.grch38.html output/
fi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -61,16 +66,20 @@ process BOLT_SMLV_SOMATIC_REPORT {
"""

stub:
"""
def pcgr_skipped = smlv_vcf.name.contains('hypermutated')
def pcgr_stub_lines = pcgr_skipped ? '' : """
mkdir -p output/pcgr/
touch output/pcgr/pcgr.stub
touch output/pcgr/${meta.tumor_id}.pcgr.grch38.pass.vcf.gz
touch output/${meta.tumor_id}.pcgr.grch38.html
"""
"""
mkdir -p output/
touch output/af_tumor.txt
touch output/af_tumor_keygenes.txt
touch output/${meta.tumor_id}.somatic.variant_counts_type.yaml
touch output/${meta.tumor_id}.somatic.variant_counts_process.json
touch output/${meta.tumor_id}.somatic.bcftools_stats.txt
touch output/pcgr/${meta.tumor_id}.pcgr.grch38.pass.vcf.gz
touch output/${meta.tumor_id}.pcgr.grch38.html
${pcgr_stub_lines}
echo -e '${task.process}:\\n stub: noversions\\n' > versions.yml
"""
}
84 changes: 84 additions & 0 deletions modules/local/bolt/smlv_somatic/report/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
nextflow_process {

name "Test Process BOLT_SMLV_SOMATIC_REPORT"
script "modules/local/bolt/smlv_somatic/report/main.nf"
process "BOLT_SMLV_SOMATIC_REPORT"
config "modules/local/bolt/smlv_somatic/report/tests/nextflow.config"
tag "modules/local/bolt/smlv_somatic/report"

// Stub tests validate that the optional: true PCGR outputs (pcgr_pass_vcf,
// pcgr_dir, pcgr_report) are correctly present/absent per sample, and that
// the process still succeeds when they're absent (sash #59 / ADR-001).
// Branching is driven by the input VCF filename, mirroring PAVE's
// fixture-directory-name convention.

test("stub | normal sample — emits pcgr_pass_vcf/pcgr_dir/pcgr_report") {

options "-stub"

when {
process {
"""
def vcf = file("${projectDir}/modules/local/bolt/smlv_somatic/report/tests/fixtures/normal/normal.vcf.gz")
def filters_vcf = file("${projectDir}/modules/local/bolt/smlv_somatic/report/tests/fixtures/normal/normal.filters.vcf.gz")
def dragen_vcf = file("${projectDir}/modules/local/bolt/smlv_somatic/report/tests/fixtures/normal/normal.dragen.vcf.gz")
def purity = file("${projectDir}/modules/local/bolt/smlv_somatic/report/tests/fixtures/normal/purple.purity.tsv")
input[0] = [[id: 'TEST_01', tumor_id: 'TUMOR', normal_id: 'NORMAL'], vcf, filters_vcf, dragen_vcf, purity]
input[1] = []
input[2] = []
input[3] = []
input[4] = []
input[5] = []
input[6] = []
"""
}
}

then {
assert process.success
assert process.out.pcgr_pass_vcf.size() == 1
assert process.out.pcgr_dir.size() == 1
assert process.out.pcgr_report.size() == 1
assert process.out.af_global.size() == 1
assert process.out.bcftools_stats.size() == 1
assert process.out.counts_type.size() == 1
assert process.out.counts_process.size() == 1
assert process.out.versions.size() == 1
}
}

test("stub | hypermutated sample — PCGR skipped, process still succeeds") {

options "-stub"

when {
process {
"""
def vcf = file("${projectDir}/modules/local/bolt/smlv_somatic/report/tests/fixtures/hypermutated/hypermutated.vcf.gz")
def filters_vcf = file("${projectDir}/modules/local/bolt/smlv_somatic/report/tests/fixtures/hypermutated/hypermutated.filters.vcf.gz")
def dragen_vcf = file("${projectDir}/modules/local/bolt/smlv_somatic/report/tests/fixtures/hypermutated/hypermutated.dragen.vcf.gz")
def purity = file("${projectDir}/modules/local/bolt/smlv_somatic/report/tests/fixtures/hypermutated/purple.purity.tsv")
input[0] = [[id: 'TEST_02', tumor_id: 'TUMOR', normal_id: 'NORMAL'], vcf, filters_vcf, dragen_vcf, purity]
input[1] = []
input[2] = []
input[3] = []
input[4] = []
input[5] = []
input[6] = []
"""
}
}

then {
assert process.success
assert process.out.pcgr_pass_vcf.size() == 0
assert process.out.pcgr_dir.size() == 0
assert process.out.pcgr_report.size() == 0
assert process.out.af_global.size() == 1
assert process.out.bcftools_stats.size() == 1
assert process.out.counts_type.size() == 1
assert process.out.counts_process.size() == 1
assert process.out.versions.size() == 1
}
}
}
85 changes: 85 additions & 0 deletions modules/local/bolt/smlv_somatic/report/tests/main_real.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
nextflow_process {

name "Test Process BOLT_SMLV_SOMATIC_REPORT (real, non-stub)"
script "modules/local/bolt/smlv_somatic/report/main.nf"
process "BOLT_SMLV_SOMATIC_REPORT"
config "modules/local/bolt/smlv_somatic/report/tests/nextflow_docker.config"
tag "modules/local/bolt/smlv_somatic/report"
tag "real"
tag "docker"

// Real (non-stub) execution against the ghcr.io/umccr/bolt:0.3.2-pcgr container,
// exercising the actual `script:` block -- including the `mv output/pcgr/*.html`
// guard fix (sash #59 / ADR-001) that stub-mode tests structurally cannot reach,
// since -stub bypasses `script:` entirely. Caught a real bug this way earlier in
// this investigation: the mv was previously unconditional and crashed the whole
// process when PCGR was skipped, defeating the optional:true outputs.
//
// Input VCF is a synthetic ~550k-PASS-variant VCF (real REF/ALT vs the genome
// fasta, all records forced INFO/SAGE_HOTSPOT so select_pcgr_variants() has
// nothing droppable and genuinely fails to trim below MAX_SOMATIC_VARIANTS --
// see ~/workspace/synthetic_hypermutated/generate_synthetic_vcf_v2.py).
//
// NOT reproducible elsewhere as-is: every non-fixture path below is a hardcoded
// absolute path into this machine's ~/workspace (or ~/Documents/data), none of
// it committed to the repo -- the synthetic VCF, its generator script, and the
// real refdata (genome fasta, GIAB regions, cancer genes bed, a real sample's
// purity/dragen-vcf) all live outside version control. This is a local, manual
// diagnostic test, not part of the default nf-test suite and not CI-runnable;
// it will fail with missing-file errors on any other machine. Requires Docker.
// Prerequisites to rerun:
// 1. Docker running, `docker pull ghcr.io/umccr/bolt:0.3.2-pcgr` (~7.6GB)
// 2. Genome fasta+fai (GRCh38_full_analysis_set_plus_decoy_hla, ~3.2GB) and
// the GIAB high-confidence regions bed staged locally
// 3. UMCCR somatic cancer-gene-panel regions bed (umccr_reference_data)
// 4. A real sample's purple purity TSV + a small real PASS VCF to stand in
// for --vcf_dragen_fp (content doesn't need to match the synthetic VCF --
// only used for a stats/count comparison, not gating logic)
// 5. The synthetic VCF regenerated via generate_synthetic_vcf_v2.py against
// any real sample's PASS VCF + the genome fasta above
// If none of that is available, run modules/local/bolt/smlv_somatic/report/tests/
// main.nf.test instead (the -stub equivalent) -- it needs none of the above but
// can't exercise the real `script:` block this test is specifically for.

test("real | hypermutated sample — PCGR skipped, process still succeeds") {

options ""

when {
process {
"""
def vcf = file("/Users/quentinclayssen/workspace/synthetic_hypermutated/synthetic_550k_v3.sorted.vcf.gz")
def filters_vcf = file("/Users/quentinclayssen/workspace/synthetic_hypermutated/synthetic_550k_v3_filters.sorted.vcf.gz")
def dragen_vcf = file("/Users/quentinclayssen/workspace/sash_070_vs_older/0.7.0/L2600127_L2600126/smlv_somatic/filter/L2600127.pass.vcf.gz")
def purity = file("/Users/quentinclayssen/workspace/sash_070_vs_older/0.7.0/L2600127_L2600126/purple/L2600127.purple.purity.tsv")
def vep_dir = file("${projectDir}/modules/local/bolt/smlv_somatic/report/tests/fixtures/real_run/vep_dir_placeholder")
def pcgr_data_dir = file("${projectDir}/modules/local/bolt/smlv_somatic/report/tests/fixtures/real_run/pcgr_data_dir_placeholder")
def cancer_genes = file("/Users/quentinclayssen/Documents/data/reference_data/umccr_reference_data/v2--0/gene_panels/somatic/umccr_cancer_genes.gene_regions.bed")
def giab_regions = file("/Users/quentinclayssen/workspace/reference_data/annotations/HG001_GRCh38_GIAB_highconf_CG-IllFB-IllGATKHC-Ion-10X-SOLID_CHROM1-X_v.3.3.2_highconf_nosomaticdel_noCENorHET7.bed.gz")
def genome_fasta = file("/Users/quentinclayssen/workspace/reference_data/genomes/GRCh38_full_analysis_set_plus_decoy_hla.fa")
def genome_fai = file("/Users/quentinclayssen/workspace/reference_data/genomes/GRCh38_full_analysis_set_plus_decoy_hla.fa.fai")

input[0] = [[id: 'TEST_REAL', tumor_id: 'L2600127', normal_id: 'L2600126'], vcf, filters_vcf, dragen_vcf, purity]
input[1] = pcgr_data_dir
input[2] = vep_dir
input[3] = cancer_genes
input[4] = giab_regions
input[5] = genome_fasta
input[6] = genome_fai
"""
}
}

then {
assert process.success
assert process.out.pcgr_pass_vcf.size() == 0
assert process.out.pcgr_dir.size() == 0
assert process.out.pcgr_report.size() == 0
assert process.out.af_global.size() == 1
assert process.out.bcftools_stats.size() == 1
assert process.out.counts_type.size() == 1
assert process.out.counts_process.size() == 1
assert process.out.versions.size() == 1
}
}
}
Loading