diff --git a/CHANGELOG.md b/CHANGELOG.md index 2107ec86..e1779c01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## v1.2.0dev +### `Added` + +- [#188](https://github.com/IntGenomicsLab/lrsomatic/pull/188) - Added `modkit_args` (default `--cpg --modified-bases 5mC`) to control the arguments passed to `modkit pileup`, and `modkit_phased` to run the pileup with `--phased` on the Longphase-haplotagged BAMs, producing `_hp1`, `_hp2` and `_combined` bedMethyl files per sample (@ljwharbers). + ### `Changed` - [#184](https://github.com/IntGenomicsLab/lrsomatic/pull/184) - Replaced the CHM13 Severus panel of normals with the merged 1000 Genomes + ASAP panel (@AmberVerhasselt). ### `Fixed` +- [#188](https://github.com/IntGenomicsLab/lrsomatic/pull/188) - `MODKIT_PILEUP` now runs a patched modkit 0.6.4 (`ghcr.io/ljwharbers/modkit:0.6.4-pacbiofix-6e0afa2`, built from [ljwharbers/modkit@pacbio-conflict-fix](https://github.com/ljwharbers/modkit/tree/pacbio-conflict-fix)) that keeps reads whose 5mC and 5hmC probabilities sum above 1, fixes pileup on PacBio-style MM tags, and honours `--phased` and `--modified-bases` in the general pileup workers that modkit uses for PacBio BAMs with 6mA calls (stock modkit wrote empty `_hp1`/`_hp2` files and an `h` row next to every `m` row for those). Stock modkit 0.4.3-0.6.4 silently dropped 32-65 % of reads from recent PacBio HiFi BAMs (Jasmine >= 26.1.3) and returned empty `--cpg` pileups ([nanoporetech/modkit#612](https://github.com/nanoporetech/modkit/issues/612); fixes proposed upstream in [nanoporetech/modkit#720](https://github.com/nanoporetech/modkit/pull/720)). The module should return to the nf-core biocontainer once a modkit release includes the fix. `MODKIT_PILEUP` now also defaults to `--cpg --modified-bases 5mC`; the previous unfiltered pileup (all modification codes, all contexts) produced 30-45 GB per sample (@ljwharbers). - [#182](https://github.com/IntGenomicsLab/lrsomatic/pull/182) - Added `--vcf` to the default `vep_args` so VEP writes VCF output rather than its default tab-delimited format (@AmberVerhasselt). ## v1.1.0 - [2026-04-28] diff --git a/conf/modules.config b/conf/modules.config index 9f7d3c34..706bf505 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -327,6 +327,12 @@ process { // withName: '.*:MODKIT_PILEUP' { + ext.args = { + [ + params.modkit_args ?: '', + params.modkit_phased ? '--phased' : '' + ].join(' ').trim() + } publishDir = [ path: { "${params.outdir}/${meta.id}/methylation/${meta.type}/modkit_pileup" }, mode: params.publish_dir_mode, diff --git a/docs/output.md b/docs/output.md index 61d82b28..51b95d8c 100644 --- a/docs/output.md +++ b/docs/output.md @@ -223,15 +223,20 @@ QC outputs are placed under `tumor/` for all samples, and additionally under `no ├── methylation │ ├── tumor │ │ └── modkit_pileup -│ │ └── sample.bed.gz +│ │ ├── sample.bed.gz # default +│ │ ├── sample_hp1.bed.gz # --modkit_phased only +│ │ ├── sample_hp2.bed.gz # --modkit_phased only +│ │ └── sample_combined.bed.gz # --modkit_phased only │ ├── normal # paired samples only │ │ └── modkit_pileup -│ │ └── sample.bed.gz +│ │ └── ... # same layout as tumor ``` -| File | Description | -| -------------------------------------------- | ----------------------------------------------------------------------------------- | -| `{tumor,normal}/modkit_pileup/sample.bed.gz` | Modkit pileup BED file containing per-CpG methylation frequency and coverage values | +| File | Description | +| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `{tumor,normal}/modkit_pileup/sample.bed.gz` | Modkit pileup bedMethyl table (bgzip) with per-strand methylation frequency and coverage. By default (`--modkit_args '--cpg --modified-bases 5mC'`) rows are 5mC calls at CpG sites only. | +| `{tumor,normal}/modkit_pileup/sample_{hp1,hp2}.bed.gz` | With `--modkit_phased`: bedMethyl tables restricted to reads carrying haplotype tag `HP:1` or `HP:2` from the Longphase-haplotagged BAM. | +| `{tumor,normal}/modkit_pileup/sample_combined.bed.gz` | With `--modkit_phased`: bedMethyl table over all reads, including untagged ones (equivalent to the unphased default output). | diff --git a/docs/usage.md b/docs/usage.md index d0546eb0..3bbbfbfd 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -137,22 +137,24 @@ For structural variants, the CHM13 panel of normals is a merged panel combining #### Skipping options: -| Parameter | Description | -| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `--skip_qc` | A boolean to skip all QC steps, including `mosdepth`, `samtools`,`fibertools`, `cramino`. Default = `false` | -| `--skip_fiber` | A boolean to skip all `fibertools` related modules. Default = `false` | -| `--skip_cramino` | A boolean to skip `cramino`. Default = `false` | -| `--skip_mosdepth` | A boolean to skip `mosdepth`. Default = `false` | -| `--skip_ascat` | A boolean to skip `ascat`. Default = `false` | -| `--skip_bamstats` | A boolean to skip `bamstats`. Default = `false` | -| `--skip_wakhan` | A boolean to skip `wakhan`. Default = `false` | -| `--skip_vep` | A boolean to skip `vep`. Default = `false` | -| `--skip_m6a` | A boolean to skip `fibertools_m6a`, used if you have m6a calls but would still like nucleosome positions for PacBio data (ONT data is required to have m6a calls). Default = `false` | -| `--skip_nanoplot` | A boolean to skip NanoPlot QC on aligned and unaligned BAM files. Default = `false` | -| `--skip_normalfiber` | A boolean to skip fibertools processing for the normal sample. Default = `false` | -| `--skip_modcall` | A boolean to skip modkit methylation calling. Default = `false` | -| `--skip_modkit` | A boolean to skip the modkit pileup step. Default = `false` | -| `--skip_whatshapstats` | A boolean to skip WhatsHap phasing statistics. Default = `false` | +| Parameter | Description | +| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `--skip_qc` | A boolean to skip all QC steps, including `mosdepth`, `samtools`,`fibertools`, `cramino`. Default = `false` | +| `--skip_fiber` | A boolean to skip all `fibertools` related modules. Default = `false` | +| `--skip_cramino` | A boolean to skip `cramino`. Default = `false` | +| `--skip_mosdepth` | A boolean to skip `mosdepth`. Default = `false` | +| `--skip_ascat` | A boolean to skip `ascat`. Default = `false` | +| `--skip_bamstats` | A boolean to skip `bamstats`. Default = `false` | +| `--skip_wakhan` | A boolean to skip `wakhan`. Default = `false` | +| `--skip_vep` | A boolean to skip `vep`. Default = `false` | +| `--skip_m6a` | A boolean to skip `fibertools_m6a`, used if you have m6a calls but would still like nucleosome positions for PacBio data (ONT data is required to have m6a calls). Default = `false` | +| `--skip_nanoplot` | A boolean to skip NanoPlot QC on aligned and unaligned BAM files. Default = `false` | +| `--skip_normalfiber` | A boolean to skip fibertools processing for the normal sample. Default = `false` | +| `--skip_modcall` | A boolean to skip modkit methylation calling. Default = `false` | +| `--skip_modkit` | A boolean to skip the modkit pileup step. Default = `false` | +| `--modkit_args` | Additional arguments passed to `modkit pileup`. The default restricts output to 5mC calls at CpG sites; note that `--modified-bases` only filters the output, so PacBio positions where the 5mC and 5hmC probabilities sum above 1 are still dropped. Default = `--cpg --modified-bases 5mC` | +| `--modkit_phased` | A boolean to run `modkit pileup --phased` on the Longphase-haplotagged BAMs, producing `_hp1`, `_hp2` and `_combined` bedMethyl files per sample instead of a single unphased file. Default = `false` | +| `--skip_whatshapstats` | A boolean to skip WhatsHap phasing statistics. Default = `false` | #### LONGPHASE options: diff --git a/modules/nf-core/modkit/pileup/main.nf b/modules/nf-core/modkit/pileup/main.nf index 7487783d..635849b6 100644 --- a/modules/nf-core/modkit/pileup/main.nf +++ b/modules/nf-core/modkit/pileup/main.nf @@ -3,9 +3,10 @@ process MODKIT_PILEUP { label 'process_high' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/ont-modkit:0.6.1--hcdda2d0_0': - 'biocontainers/ont-modkit:0.6.1--hcdda2d0_0' }" + // Patched modkit 0.6.4 (nanoporetech/modkit#720) that keeps PacBio reads with 5mC+5hmC > 1 and honours --phased/--modified-bases in the general workers; revert to the biocontainer once released + container "${workflow.containerEngine == 'singularity' || workflow.containerEngine == 'apptainer' + ? 'oras://ghcr.io/ljwharbers/modkit-sif:0.6.4-pacbiofix-6e0afa2' + : 'ghcr.io/ljwharbers/modkit:0.6.4-pacbiofix-6e0afa2'}" input: tuple val(meta), path(bam), path(bai) diff --git a/modules/nf-core/modkit/pileup/modkit-pileup.diff b/modules/nf-core/modkit/pileup/modkit-pileup.diff index d880bb11..c04f4809 100644 --- a/modules/nf-core/modkit/pileup/modkit-pileup.diff +++ b/modules/nf-core/modkit/pileup/modkit-pileup.diff @@ -1,9 +1,20 @@ Changes in component 'nf-core/modkit/pileup' +'modules/nf-core/modkit/pileup/environment.yml' is unchanged 'modules/nf-core/modkit/pileup/meta.yml' is unchanged Changes in 'modkit/pileup/main.nf': --- modules/nf-core/modkit/pileup/main.nf +++ modules/nf-core/modkit/pileup/main.nf -@@ -9,8 +9,9 @@ +@@ -3,14 +3,16 @@ + label 'process_high' + + conda "${moduleDir}/environment.yml" +- container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? +- 'https://depot.galaxyproject.org/singularity/ont-modkit:0.6.1--hcdda2d0_0': +- 'biocontainers/ont-modkit:0.6.1--hcdda2d0_0' }" ++ // Patched modkit 0.6.4 (nanoporetech/modkit#720) that keeps PacBio reads with 5mC+5hmC > 1 and honours --phased/--modified-bases in the general workers; revert to the biocontainer once released ++ container "${workflow.containerEngine == 'singularity' || workflow.containerEngine == 'apptainer' ++ ? 'oras://ghcr.io/ljwharbers/modkit-sif:0.6.4-pacbiofix-6e0afa2' ++ : 'ghcr.io/ljwharbers/modkit:0.6.4-pacbiofix-6e0afa2'}" input: tuple val(meta), path(bam), path(bai) @@ -16,8 +27,375 @@ Changes in 'modkit/pileup/main.nf': output: tuple val(meta), path("*.bed.gz") , emit: bedgz , optional: true -'modules/nf-core/modkit/pileup/environment.yml' is unchanged -'modules/nf-core/modkit/pileup/tests/main.nf.test' is unchanged -'modules/nf-core/modkit/pileup/tests/main.nf.test.snap' is unchanged 'modules/nf-core/modkit/pileup/tests/nextflow.config' is unchanged +'modules/nf-core/modkit/pileup/tests/main.nf.test' is unchanged +Changes in 'modkit/pileup/tests/main.nf.test.snap': +--- modules/nf-core/modkit/pileup/tests/main.nf.test.snap ++++ modules/nf-core/modkit/pileup/tests/main.nf.test.snap +@@ -17,7 +17,7 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" ++ "0.6.4" + ] + ], + "bedgz": [ +@@ -35,7 +35,7 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" ++ "0.6.4" + ] + ] + } +@@ -69,30 +69,30 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" +- ] +- ], +- "bedgz": [ +- [ +- { +- "id": "test" +- }, +- "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" +- ] +- ], +- "log": [ +- [ +- { +- "id": "test" +- }, +- "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" +- ] +- ], +- "versions_modkit": [ +- [ +- "MODKIT_PILEUP", +- "modkit", +- "0.6.1" ++ "0.6.4" ++ ] ++ ], ++ "bedgz": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ++ ] ++ ], ++ "log": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "versions_modkit": [ ++ [ ++ "MODKIT_PILEUP", ++ "modkit", ++ "0.6.4" + ] + ] + } +@@ -125,7 +125,7 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" ++ "0.6.4" + ] + ], + "bedgz": [ +@@ -147,7 +147,7 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" ++ "0.6.4" + ] + ] + } +@@ -181,30 +181,30 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" +- ] +- ], +- "bedgz": [ +- [ +- { +- "id": "test" +- }, +- "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" +- ] +- ], +- "log": [ +- [ +- { +- "id": "test" +- }, +- "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" +- ] +- ], +- "versions_modkit": [ +- [ +- "MODKIT_PILEUP", +- "modkit", +- "0.6.1" ++ "0.6.4" ++ ] ++ ], ++ "bedgz": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ++ ] ++ ], ++ "log": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "versions_modkit": [ ++ [ ++ "MODKIT_PILEUP", ++ "modkit", ++ "0.6.4" + ] + ] + } +@@ -233,7 +233,7 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" ++ "0.6.4" + ] + ], + "bedgz": [ +@@ -251,7 +251,7 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" ++ "0.6.4" + ] + ] + } +@@ -280,7 +280,7 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" ++ "0.6.4" + ] + ], + "bedgz": [ +@@ -298,7 +298,7 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" ++ "0.6.4" + ] + ] + } +@@ -331,7 +331,7 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" ++ "0.6.4" + ] + ], + "bedgz": [ +@@ -353,7 +353,7 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" ++ "0.6.4" + ] + ] + } +@@ -387,30 +387,30 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" +- ] +- ], +- "bedgz": [ +- [ +- { +- "id": "test" +- }, +- "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" +- ] +- ], +- "log": [ +- [ +- { +- "id": "test" +- }, +- "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" +- ] +- ], +- "versions_modkit": [ +- [ +- "MODKIT_PILEUP", +- "modkit", +- "0.6.1" ++ "0.6.4" ++ ] ++ ], ++ "bedgz": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ++ ] ++ ], ++ "log": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "versions_modkit": [ ++ [ ++ "MODKIT_PILEUP", ++ "modkit", ++ "0.6.4" + ] + ] + } +@@ -444,30 +444,30 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" +- ] +- ], +- "bedgz": [ +- [ +- { +- "id": "test" +- }, +- "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" +- ] +- ], +- "log": [ +- [ +- { +- "id": "test" +- }, +- "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" +- ] +- ], +- "versions_modkit": [ +- [ +- "MODKIT_PILEUP", +- "modkit", +- "0.6.1" ++ "0.6.4" ++ ] ++ ], ++ "bedgz": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ++ ] ++ ], ++ "log": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "versions_modkit": [ ++ [ ++ "MODKIT_PILEUP", ++ "modkit", ++ "0.6.4" + ] + ] + } +@@ -501,30 +501,30 @@ + [ + "MODKIT_PILEUP", + "modkit", +- "0.6.1" +- ] +- ], +- "bedgz": [ +- [ +- { +- "id": "test" +- }, +- "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" +- ] +- ], +- "log": [ +- [ +- { +- "id": "test" +- }, +- "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" +- ] +- ], +- "versions_modkit": [ +- [ +- "MODKIT_PILEUP", +- "modkit", +- "0.6.1" ++ "0.6.4" ++ ] ++ ], ++ "bedgz": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ++ ] ++ ], ++ "log": [ ++ [ ++ { ++ "id": "test" ++ }, ++ "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" ++ ] ++ ], ++ "versions_modkit": [ ++ [ ++ "MODKIT_PILEUP", ++ "modkit", ++ "0.6.4" + ] + ] + } + ************************************************************ diff --git a/modules/nf-core/modkit/pileup/tests/main.nf.test.snap b/modules/nf-core/modkit/pileup/tests/main.nf.test.snap index 55ba8d79..e9b21b80 100644 --- a/modules/nf-core/modkit/pileup/tests/main.nf.test.snap +++ b/modules/nf-core/modkit/pileup/tests/main.nf.test.snap @@ -17,7 +17,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ], "bedgz": [ @@ -35,7 +35,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ] } @@ -69,7 +69,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ], "bedgz": [ @@ -92,7 +92,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ] } @@ -125,7 +125,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ], "bedgz": [ @@ -147,7 +147,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ] } @@ -181,7 +181,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ], "bedgz": [ @@ -204,7 +204,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ] } @@ -233,7 +233,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ], "bedgz": [ @@ -251,7 +251,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ] } @@ -280,7 +280,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ], "bedgz": [ @@ -298,7 +298,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ] } @@ -331,7 +331,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ], "bedgz": [ @@ -353,7 +353,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ] } @@ -387,7 +387,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ], "bedgz": [ @@ -410,7 +410,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ] } @@ -444,7 +444,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ], "bedgz": [ @@ -467,7 +467,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ] } @@ -501,7 +501,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ], "bedgz": [ @@ -524,7 +524,7 @@ [ "MODKIT_PILEUP", "modkit", - "0.6.1" + "0.6.4" ] ] } diff --git a/nextflow.config b/nextflow.config index cb53306c..ba166779 100644 --- a/nextflow.config +++ b/nextflow.config @@ -25,6 +25,10 @@ params { // Longphase options longphase_tag_supplementary = false + // Modkit options + modkit_args = '--cpg --modified-bases 5mC' + modkit_phased = false + // PON Options clairsto_pon_vcfs = null clairsto_pon_flags = null diff --git a/nextflow_schema.json b/nextflow_schema.json index bdc64a04..77459b31 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -118,6 +118,24 @@ } } }, + "modkit_options": { + "title": "Modkit options", + "type": "object", + "description": "Options for modkit pileup of base modifications", + "properties": { + "modkit_args": { + "type": "string", + "description": "Additional command line arguments passed to `modkit pileup`. The default restricts the bedMethyl output to 5mC calls at CpG sites. Note that `--modified-bases` only filters the output: on PacBio data, positions where the 5mC and 5hmC probabilities sum above 1 are still dropped, and non-conflicting 5hmC calls are counted in the `N_other` column.", + "fa_icon": "fas fa-terminal", + "default": "--cpg --modified-bases 5mC" + }, + "modkit_phased": { + "type": "boolean", + "description": "Run `modkit pileup --phased` on the Longphase-haplotagged BAMs (HP tag) instead of the unphased aligned BAMs, producing `_hp1.bed.gz`, `_hp2.bed.gz` and `_combined.bed.gz`. Pileup then runs after phasing and haplotagging.", + "default": false + } + } + }, "reference_genome_options": { "title": "Reference genome options", "type": "object", @@ -531,6 +549,9 @@ { "$ref": "#/$defs/longphase_options" }, + { + "$ref": "#/$defs/modkit_options" + }, { "$ref": "#/$defs/reference_genome_options" }, diff --git a/workflows/lrsomatic.nf b/workflows/lrsomatic.nf index 211552df..73e1dfe2 100644 --- a/workflows/lrsomatic.nf +++ b/workflows/lrsomatic.nf @@ -530,14 +530,6 @@ workflow LRSOMATIC { .set { ch_minimap_bam } // ch_minimap_bam: [meta, bam] -- post-alignment BAM (replicates merged) - // - // MODULE: MODKIT_PILEUP - // - - if (!params.skip_modkit) { - MODKIT_PILEUP(ch_index_minimap, ch_fasta, ch_fai, [[:],[]]) - } - ch_index_minimap .branch { meta, _bams, _bais -> paired: meta.paired_data // meta.paired_data is the normal sample ID for tumors, or the tumor ID for normals @@ -659,6 +651,17 @@ workflow LRSOMATIC { ch_fai ) + // + // MODULE: MODKIT_PILEUP (haplotagged BAM with --modkit_phased, merged BAM otherwise) + // + if (!params.skip_modkit) { + ch_modkit_input = params.modkit_phased + ? PHASING_HAPLOTYPING.out.tumor_normal_hapbams_ch + : ch_index_minimap + // ch_modkit_input: [meta, bam, bai] -- BAM to pile up; meta.type selects the publish directory + MODKIT_PILEUP(ch_modkit_input, ch_fasta, ch_fai, [[:],[]]) + } + // Prepare phased VCFs for VEP: add empty 'extra' list required by ENSEMBLVEP_VEP PHASING_HAPLOTYPING.out.phased_somatic_vcf .map { meta, vcf, _tbi ->