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
16 changes: 10 additions & 6 deletions modules/nf-core/parabricks/mutectcaller/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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}
Expand All @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions modules/nf-core/parabricks/mutectcaller/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
30 changes: 21 additions & 9 deletions modules/nf-core/parabricks/mutectcaller/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ nextflow_process {

when {
params {
module_args = "--mutect-low-memory"
module_args = "--tumor-name tumour --mutect-low-memory"
}
process {
"""
Expand All @@ -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
"""
}
}
Expand Down Expand Up @@ -100,7 +104,7 @@ nextflow_process {

// when {
// params {
// module_args = "--mutect-low-memory"
// module_args = "--tumor-name tumour --mutect-low-memory"
// }
// process {
// """
Expand Down Expand Up @@ -227,7 +231,7 @@ nextflow_process {

when {
params {
module_args = "--mutect-low-memory"
module_args = "--tumor-name tumour --mutect-low-memory"
}
process {
"""
Expand All @@ -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
"""
}
}
Expand Down Expand Up @@ -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)
"""
}
}
Expand Down
12 changes: 3 additions & 9 deletions modules/nf-core/parabricks/mutectcaller/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand All @@ -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": [
Expand Down
Loading