Skip to content

Commit

Permalink
Add config option to manta modules (nf-core#3890)
Browse files Browse the repository at this point in the history
* new module picard/scatterintervalsbyns

* update annotsv to 3.3.6

* update installannotations

* add config to manta modules

* fix mv somatic

* add config tests
  • Loading branch information
nvnieuwk authored and Leon Rauschning committed Oct 16, 2023
1 parent d3dcfc7 commit 9a0ae7a
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 56 deletions.
25 changes: 14 additions & 11 deletions modules/nf-core/manta/germline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ process MANTA_GERMLINE {
tuple val(meta), path(input), path(index), path(target_bed), path(target_bed_tbi)
tuple val(meta2), path(fasta)
tuple val(meta3), path(fai)
path(config)

output:
tuple val(meta), path("*candidate_small_indels.vcf.gz") , emit: candidate_small_indels_vcf
Expand All @@ -31,27 +32,29 @@ process MANTA_GERMLINE {
def prefix = task.ext.prefix ?: "${meta.id}"
def input_files = input.collect{"--bam ${it}"}.join(' ')
def options_manta = target_bed ? "--callRegions $target_bed" : ""
def config_option = config ? "--config ${config}" : ""
"""
configManta.py \
${input_files} \
--reference $fasta \
--runDir manta \
$options_manta \
configManta.py \\
${input_files} \\
${config_option} \\
--reference $fasta \\
--runDir manta \\
$options_manta \\
$args
python manta/runWorkflow.py -m local -j $task.cpus
mv manta/results/variants/candidateSmallIndels.vcf.gz \
mv manta/results/variants/candidateSmallIndels.vcf.gz \\
${prefix}.candidate_small_indels.vcf.gz
mv manta/results/variants/candidateSmallIndels.vcf.gz.tbi \
mv manta/results/variants/candidateSmallIndels.vcf.gz.tbi \\
${prefix}.candidate_small_indels.vcf.gz.tbi
mv manta/results/variants/candidateSV.vcf.gz \
mv manta/results/variants/candidateSV.vcf.gz \\
${prefix}.candidate_sv.vcf.gz
mv manta/results/variants/candidateSV.vcf.gz.tbi \
mv manta/results/variants/candidateSV.vcf.gz.tbi \\
${prefix}.candidate_sv.vcf.gz.tbi
mv manta/results/variants/diploidSV.vcf.gz \
mv manta/results/variants/diploidSV.vcf.gz \\
${prefix}.diploid_sv.vcf.gz
mv manta/results/variants/diploidSV.vcf.gz.tbi \
mv manta/results/variants/diploidSV.vcf.gz.tbi \\
${prefix}.diploid_sv.vcf.gz.tbi
cat <<-END_VERSIONS > versions.yml
Expand Down
5 changes: 5 additions & 0 deletions modules/nf-core/manta/germline/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ input:
type: file
description: Genome reference FASTA index file
pattern: "*.{fa.fai,fasta.fai}"
- config:
type: file
description: Manta configuration file
pattern: "*.{ini,conf,config}"

output:
- meta:
Expand Down Expand Up @@ -96,3 +100,4 @@ output:
authors:
- "@maxulysse"
- "@ramprasadn"
- "@nvnieuwk"
62 changes: 45 additions & 17 deletions modules/nf-core/manta/somatic/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ process MANTA_SOMATIC {

input:
tuple val(meta), path(input_normal), path(input_index_normal), path(input_tumor), path(input_index_tumor), path(target_bed), path(target_bed_tbi)
path fasta
path fai
tuple val(meta2), path(fasta)
tuple val(meta3), path(fai)
path(config)

output:
tuple val(meta), path("*.candidate_small_indels.vcf.gz") , emit: candidate_small_indels_vcf
Expand All @@ -31,26 +32,53 @@ process MANTA_SOMATIC {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def options_manta = target_bed ? "--callRegions $target_bed" : ""

def config_option = config ? "--config ${config}" : ""
"""
configManta.py \
--tumorBam $input_tumor \
--normalBam $input_normal \
--reference $fasta \
--runDir manta \
$options_manta \
configManta.py \\
--tumorBam $input_tumor \\
--normalBam $input_normal \\
--reference $fasta \\
${config_option} \\
--runDir manta \\
$options_manta \\
$args
python manta/runWorkflow.py -m local -j $task.cpus
mv manta/results/variants/candidateSmallIndels.vcf.gz ${prefix}.candidate_small_indels.vcf.gz
mv manta/results/variants/candidateSmallIndels.vcf.gz.tbi ${prefix}.candidate_small_indels.vcf.gz.tbi
mv manta/results/variants/candidateSV.vcf.gz ${prefix}.candidate_sv.vcf.gz
mv manta/results/variants/candidateSV.vcf.gz.tbi ${prefix}.candidate_sv.vcf.gz.tbi
mv manta/results/variants/diploidSV.vcf.gz ${prefix}.diploid_sv.vcf.gz
mv manta/results/variants/diploidSV.vcf.gz.tbi ${prefix}.diploid_sv.vcf.gz.tbi
mv manta/results/variants/somaticSV.vcf.gz ${prefix}.somatic_sv.vcf.gz
mv manta/results/variants/somaticSV.vcf.gz.tbi ${prefix}.somatic_sv.vcf.gz.tbi
mv manta/results/variants/candidateSmallIndels.vcf.gz \\
${prefix}.candidate_small_indels.vcf.gz
mv manta/results/variants/candidateSmallIndels.vcf.gz.tbi \\
${prefix}.candidate_small_indels.vcf.gz.tbi
mv manta/results/variants/candidateSV.vcf.gz \\
${prefix}.candidate_sv.vcf.gz
mv manta/results/variants/candidateSV.vcf.gz.tbi \\
${prefix}.candidate_sv.vcf.gz.tbi
mv manta/results/variants/diploidSV.vcf.gz \\
${prefix}.diploid_sv.vcf.gz
mv manta/results/variants/diploidSV.vcf.gz.tbi \\
${prefix}.diploid_sv.vcf.gz.tbi
mv manta/results/variants/somaticSV.vcf.gz \\
${prefix}.somatic_sv.vcf.gz
mv manta/results/variants/somaticSV.vcf.gz.tbi \\
${prefix}.somatic_sv.vcf.gz.tbi
cat <<-END_VERSIONS > versions.yml
"${task.process}":
manta: \$( configManta.py --version )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.candidate_small_indels.vcf.gz
touch ${prefix}.candidate_small_indels.vcf.gz.tbi
touch ${prefix}.candidate_sv.vcf.gz
touch ${prefix}.candidate_sv.vcf.gz.tbi
touch ${prefix}.diploid_sv.vcf.gz
touch ${prefix}.diploid_sv.vcf.gz.tbi
touch ${prefix}.somatic_sv.vcf.gz
touch ${prefix}.somatic_sv.vcf.gz.tbi
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
15 changes: 15 additions & 0 deletions modules/nf-core/manta/somatic/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,28 @@ input:
type: file
description: Index for BED file containing target regions for variant calling
pattern: "*.{bed.tbi}"
- meta2:
type: map
description: |
Groovy Map containing reference information
e.g. [ id:'genome' ]
- fasta:
type: file
description: Genome reference FASTA file
pattern: "*.{fa,fasta}"
- meta3:
type: map
description: |
Groovy Map containing reference information
e.g. [ id:'genome' ]
- fai:
type: file
description: Genome reference FASTA index file
pattern: "*.{fa.fai,fasta.fai}"
- config:
type: file
description: Manta configuration file
pattern: "*.{ini,conf,config}"

output:
- meta:
Expand Down Expand Up @@ -101,3 +115,4 @@ output:

authors:
- "@FriederikeHanssen"
- "@nvnieuwk"
45 changes: 32 additions & 13 deletions modules/nf-core/manta/tumoronly/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ process MANTA_TUMORONLY {

input:
tuple val(meta), path(input), path(input_index), path(target_bed), path(target_bed_tbi)
path fasta
path fai
tuple val(meta2), path(fasta)
tuple val(meta3), path(fai)
path(config)

output:
tuple val(meta), path("*candidate_small_indels.vcf.gz") , emit: candidate_small_indels_vcf
Expand All @@ -29,32 +30,50 @@ process MANTA_TUMORONLY {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def options_manta = target_bed ? "--callRegions $target_bed" : ""
def config_option = config ? "--config ${config}" : ""
"""
configManta.py \
--tumorBam $input \
--reference $fasta \
--runDir manta \
$options_manta \
configManta.py \\
--tumorBam $input \\
--reference $fasta \\
${config_option} \\
--runDir manta \\
$options_manta \\
$args
python manta/runWorkflow.py -m local -j $task.cpus
mv manta/results/variants/candidateSmallIndels.vcf.gz \
mv manta/results/variants/candidateSmallIndels.vcf.gz \\
${prefix}.candidate_small_indels.vcf.gz
mv manta/results/variants/candidateSmallIndels.vcf.gz.tbi \
mv manta/results/variants/candidateSmallIndels.vcf.gz.tbi \\
${prefix}.candidate_small_indels.vcf.gz.tbi
mv manta/results/variants/candidateSV.vcf.gz \
mv manta/results/variants/candidateSV.vcf.gz \\
${prefix}.candidate_sv.vcf.gz
mv manta/results/variants/candidateSV.vcf.gz.tbi \
mv manta/results/variants/candidateSV.vcf.gz.tbi \\
${prefix}.candidate_sv.vcf.gz.tbi
mv manta/results/variants/tumorSV.vcf.gz \
mv manta/results/variants/tumorSV.vcf.gz \\
${prefix}.tumor_sv.vcf.gz
mv manta/results/variants/tumorSV.vcf.gz.tbi \
mv manta/results/variants/tumorSV.vcf.gz.tbi \\
${prefix}.tumor_sv.vcf.gz.tbi
cat <<-END_VERSIONS > versions.yml
"${task.process}":
manta: \$( configManta.py --version )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.candidate_small_indels.vcf.gz
touch ${prefix}.candidate_small_indels.vcf.gz.tbi
touch ${prefix}.candidate_sv.vcf.gz
touch ${prefix}.candidate_sv.vcf.gz.tbi
touch ${prefix}.tumor_sv.vcf.gz
touch ${prefix}.tumor_sv.vcf.gz.tbi
cat <<-END_VERSIONS > versions.yml
"${task.process}":
manta: \$( configManta.py --version )
END_VERSIONS
"""
}
15 changes: 15 additions & 0 deletions modules/nf-core/manta/tumoronly/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,28 @@ input:
type: file
description: Index for BED file containing target regions for variant calling
pattern: "*.{bed.tbi}"
- meta2:
type: map
description: |
Groovy Map containing reference information
e.g. [ id:'genome' ]
- fasta:
type: file
description: Genome reference FASTA file
pattern: "*.{fa,fasta}"
- meta3:
type: map
description: |
Groovy Map containing reference information
e.g. [ id:'genome' ]
- fai:
type: file
description: Genome reference FASTA index file
pattern: "*.{fa.fai,fasta.fai}"
- config:
type: file
description: Manta configuration file
pattern: "*.{ini,conf,config}"

output:
- meta:
Expand Down Expand Up @@ -85,3 +99,4 @@ output:

authors:
- "@maxulysse"
- "@nvnieuwk"
9 changes: 6 additions & 3 deletions tests/modules/nf-core/manta/germline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ workflow test_manta_germline {
file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
]

MANTA_GERMLINE ( input, fasta, fai )
config = Channel.of("[manta]", "enableRemoteReadRetrievalForInsertionsInGermlineCallingModes = 0")
.collectFile(name:"manta_options.ini", newLine:true)

MANTA_GERMLINE ( input, fasta, fai, config )
}

workflow test_manta_germline_target_bed {
Expand All @@ -36,7 +39,7 @@ workflow test_manta_germline_target_bed {
file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
]

MANTA_GERMLINE ( input, fasta, fai )
MANTA_GERMLINE ( input, fasta, fai, [] )
}

workflow test_manta_germline_target_bed_jointcalling {
Expand All @@ -56,5 +59,5 @@ workflow test_manta_germline_target_bed_jointcalling {
file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
]

MANTA_GERMLINE ( input, fasta, fai )
MANTA_GERMLINE ( input, fasta, fai, [] )
}
25 changes: 19 additions & 6 deletions tests/modules/nf-core/manta/somatic/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ workflow test_manta_somatic {
[], []
]

fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
fasta = [ [id:'genome'],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
]

MANTA_SOMATIC ( input, fasta, fai )
fai = [ [id:'genome'],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
]

config = Channel.of("[manta]", "enableRemoteReadRetrievalForInsertionsInGermlineCallingModes = 0")
.collectFile(name:"manta_options.ini", newLine:true)

MANTA_SOMATIC ( input, fasta, fai, config )
}

workflow test_manta_somatic_target_bed {
Expand All @@ -33,8 +41,13 @@ workflow test_manta_somatic_target_bed {
file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed_gz_tbi'], checkIfExists: true),
]

fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
fasta = [ [id:'genome'],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
]

fai = [ [id:'genome'],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
]

MANTA_SOMATIC ( input, fasta, fai )
MANTA_SOMATIC ( input, fasta, fai, [] )
}
25 changes: 19 additions & 6 deletions tests/modules/nf-core/manta/tumoronly/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@ workflow test_manta_tumoronly {
[], []
]

fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
fasta = [ [id:'genome'],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
]

MANTA_TUMORONLY ( input, fasta, fai )
fai = [ [id:'genome'],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
]

config = Channel.of("[manta]", "enableRemoteReadRetrievalForInsertionsInGermlineCallingModes = 0")
.collectFile(name:"manta_options.ini", newLine:true)

MANTA_TUMORONLY ( input, fasta, fai, config )
}

workflow test_manta_tumoronly_target_bed {
Expand All @@ -27,8 +35,13 @@ workflow test_manta_tumoronly_target_bed {
file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed_gz_tbi'], checkIfExists: true)
]

fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
fasta = [ [id:'genome'],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
]

fai = [ [id:'genome'],
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
]

MANTA_TUMORONLY ( input, fasta, fai )
MANTA_TUMORONLY ( input, fasta, fai, [] )
}

0 comments on commit 9a0ae7a

Please sign in to comment.