diff --git a/modules/nf-core/parabricks/mutectcaller/main.nf b/modules/nf-core/parabricks/mutectcaller/main.nf index 77552744bb37..7b254940595c 100644 --- a/modules/nf-core/parabricks/mutectcaller/main.nf +++ b/modules/nf-core/parabricks/mutectcaller/main.nf @@ -10,6 +10,7 @@ process PARABRICKS_MUTECTCALLER { input: tuple val(meta), path(tumor_bam), path(tumor_bam_index), path(normal_bam), path(normal_bam_index), path(intervals) tuple val(ref_meta), path(fasta) + tuple val(fai_meta), path(fasta_fai) path panel_of_normals path panel_of_normals_index @@ -33,9 +34,13 @@ process PARABRICKS_MUTECTCALLER { def intervals_command = intervals ? (intervals instanceof List ? intervals.collect { interval -> "--interval-file ${interval}" }.join(' ') : "--interval-file ${intervals}") : "" def prepon_command = panel_of_normals ? "cp -L ${panel_of_normals_index} `readlink -f ${panel_of_normals}`.tbi && pbrun prepon --in-pon-file ${panel_of_normals}" : "" - def postpon_command = panel_of_normals ? "pbrun postpon --in-vcf ${prefix}.vcf.gz --in-pon-file ${panel_of_normals} --out-vcf ${prefix}_annotated.vcf.gz" : "" + // pbrun postpon requires uncompressed .vcf input; output uncompressed when PON is provided + def mutect_out = panel_of_normals ? "${prefix}.vcf" : "${prefix}.vcf.gz" + def stats_rename = panel_of_normals ? "mv ${prefix}.vcf.stats ${prefix}.vcf.gz.stats" : "" + def postpon_command = panel_of_normals ? "pbrun postpon --in-vcf ${prefix}.vcf --in-pon-file ${panel_of_normals} --out-vcf ${prefix}.vcf.gz" : "" def num_gpus = task.accelerator ? "--num-gpus ${task.accelerator.request}" : "" + def normal_bam_flag = normal_bam ? "--in-normal-bam ${normal_bam}" : "" """ # if panel of normals specified, run prepon ${prepon_command} @@ -44,23 +49,22 @@ process PARABRICKS_MUTECTCALLER { mutectcaller \\ --ref ${fasta} \\ --in-tumor-bam ${tumor_bam} \\ - --tumor-name ${meta.tumor_id} \\ - --out-vcf ${prefix}.vcf.gz \\ + ${normal_bam_flag} \\ + --out-vcf ${mutect_out} \\ ${intervals_command} \\ ${num_gpus} \\ ${args} - # if panel of normals specified, run postpon + # if panel of normals specified, rename stats and run postpon + ${stats_rename} ${postpon_command} """ stub: def prefix = task.ext.prefix ?: "${meta.id}" - def postpon_command = panel_of_normals ? "echo '' | gzip > ${prefix}_annotated.vcf.gz" : "" """ echo "" | gzip > ${prefix}.vcf.gz touch ${prefix}.vcf.gz.stats - ${postpon_command} # Capture the full version output once and store it in a variable pbrun_version_output=\$(pbrun mutectcaller --version 2>&1) diff --git a/modules/nf-core/parabricks/mutectcaller/meta.yml b/modules/nf-core/parabricks/mutectcaller/meta.yml index 7e0972221070..6360c346b240 100644 --- a/modules/nf-core/parabricks/mutectcaller/meta.yml +++ b/modules/nf-core/parabricks/mutectcaller/meta.yml @@ -61,6 +61,16 @@ input: description: reference fasta - must be unzipped. pattern: "*.fasta" ontologies: [] + - - fai_meta: + type: map + description: | + Groovy Map containing reference index information + [ id:'homo_sapiens' ] + - fasta_fai: + type: file + description: reference fasta index - required when input is in CRAM format. + pattern: "*.fai" + ontologies: [] - panel_of_normals: type: file description: (Optional) panel of normals file. diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test index d75b2763ce9c..5a2c2a50555e 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test @@ -16,7 +16,7 @@ nextflow_process { when { params { - module_args = "--mutect-low-memory" + module_args = "--tumor-name tumour --mutect-low-memory" } process { """ @@ -32,8 +32,12 @@ nextflow_process { [ id: 'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) ] - input[2] = [] // pon - input[3] = [] // pon index + input[2] = [ // fasta_fai + [ id: 'reference' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [] // pon + input[4] = [] // pon index """ } } @@ -100,7 +104,7 @@ nextflow_process { // when { // params { - // module_args = "--mutect-low-memory" + // module_args = "--tumor-name tumour --mutect-low-memory" // } // process { // """ @@ -227,7 +231,7 @@ nextflow_process { when { params { - module_args = "--mutect-low-memory" + module_args = "--tumor-name tumour --mutect-low-memory" } process { """ @@ -243,8 +247,12 @@ nextflow_process { [ id: 'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) ] - input[2] = [] // pon - input[3] = [] // pon index + input[2] = [ // fasta_fai + [ id: 'reference' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [] // pon + input[4] = [] // pon index """ } } @@ -283,8 +291,12 @@ nextflow_process { [ id: 'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) ] - input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) - input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) + input[2] = [ // fasta_fai + [ id: 'reference' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) """ } } diff --git a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap index f4bc60a6fd26..8a90bb4ac47e 100644 --- a/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap +++ b/modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap @@ -8,10 +8,7 @@ "id": "test", "tumor_id": "tumour" }, - [ - "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test_annotated.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "1": [ @@ -51,10 +48,7 @@ "id": "test", "tumor_id": "tumour" }, - [ - "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test_annotated.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "versions_parabricks": [ @@ -70,7 +64,7 @@ "nf-test": "0.9.3", "nextflow": "25.10.2" }, - "timestamp": "2026-01-21T13:36:25.252321993" + "timestamp": "2026-05-14T09:11:19.859893899" }, "human - bam - stub": { "content": [