diff --git a/modules/nf-core/manta/germline/main.nf b/modules/nf-core/manta/germline/main.nf index e052b7c9f0d..5232ede07af 100644 --- a/modules/nf-core/manta/germline/main.nf +++ b/modules/nf-core/manta/germline/main.nf @@ -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 @@ -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 diff --git a/modules/nf-core/manta/germline/meta.yml b/modules/nf-core/manta/germline/meta.yml index 2eb16ada53a..b0cf111df65 100644 --- a/modules/nf-core/manta/germline/meta.yml +++ b/modules/nf-core/manta/germline/meta.yml @@ -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: @@ -96,3 +100,4 @@ output: authors: - "@maxulysse" - "@ramprasadn" + - "@nvnieuwk" diff --git a/modules/nf-core/manta/somatic/main.nf b/modules/nf-core/manta/somatic/main.nf index 8ff8d90a11f..5cbf7c497d1 100644 --- a/modules/nf-core/manta/somatic/main.nf +++ b/modules/nf-core/manta/somatic/main.nf @@ -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 @@ -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}": diff --git a/modules/nf-core/manta/somatic/meta.yml b/modules/nf-core/manta/somatic/meta.yml index 457d66a5fdd..e59e3002d07 100644 --- a/modules/nf-core/manta/somatic/meta.yml +++ b/modules/nf-core/manta/somatic/meta.yml @@ -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: @@ -101,3 +115,4 @@ output: authors: - "@FriederikeHanssen" + - "@nvnieuwk" diff --git a/modules/nf-core/manta/tumoronly/main.nf b/modules/nf-core/manta/tumoronly/main.nf index e3d6ca1b142..46be430e062 100644 --- a/modules/nf-core/manta/tumoronly/main.nf +++ b/modules/nf-core/manta/tumoronly/main.nf @@ -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 @@ -29,27 +30,29 @@ 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 @@ -57,4 +60,20 @@ process MANTA_TUMORONLY { 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 + """ } diff --git a/modules/nf-core/manta/tumoronly/meta.yml b/modules/nf-core/manta/tumoronly/meta.yml index 398d684365b..bf6f554d859 100644 --- a/modules/nf-core/manta/tumoronly/meta.yml +++ b/modules/nf-core/manta/tumoronly/meta.yml @@ -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: @@ -85,3 +99,4 @@ output: authors: - "@maxulysse" + - "@nvnieuwk" diff --git a/tests/modules/nf-core/manta/germline/main.nf b/tests/modules/nf-core/manta/germline/main.nf index 1e0ac26c5a0..b6be6c2d741 100644 --- a/tests/modules/nf-core/manta/germline/main.nf +++ b/tests/modules/nf-core/manta/germline/main.nf @@ -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 { @@ -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 { @@ -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, [] ) } diff --git a/tests/modules/nf-core/manta/somatic/main.nf b/tests/modules/nf-core/manta/somatic/main.nf index 2fdceb00011..89296959f24 100644 --- a/tests/modules/nf-core/manta/somatic/main.nf +++ b/tests/modules/nf-core/manta/somatic/main.nf @@ -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 { @@ -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, [] ) } diff --git a/tests/modules/nf-core/manta/tumoronly/main.nf b/tests/modules/nf-core/manta/tumoronly/main.nf index dccf5591ba2..11f52f2786b 100644 --- a/tests/modules/nf-core/manta/tumoronly/main.nf +++ b/tests/modules/nf-core/manta/tumoronly/main.nf @@ -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 { @@ -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, [] ) }