diff --git a/modules/nf-core/gatk4/mutect2/main.nf b/modules/nf-core/gatk4/mutect2/main.nf index 4448e2dd66b2..50252bc70572 100644 --- a/modules/nf-core/gatk4/mutect2/main.nf +++ b/modules/nf-core/gatk4/mutect2/main.nf @@ -12,6 +12,8 @@ process GATK4_MUTECT2 { tuple val(meta2), path(fasta) tuple val(meta3), path(fai) tuple val(meta4), path(dict) + path alleles + path alleles_tbi path germline_resource path germline_resource_tbi path panel_of_normals @@ -34,6 +36,7 @@ process GATK4_MUTECT2 { def interval_command = intervals ? "--intervals ${intervals}" : "" def pon_command = panel_of_normals ? "--panel-of-normals ${panel_of_normals}" : "" def gr_command = germline_resource ? "--germline-resource ${germline_resource}" : "" + def a_command = alleles ? "--alleles ${alleles}": "" def avail_mem = 3072 if (!task.memory) { @@ -50,6 +53,7 @@ process GATK4_MUTECT2 { --reference ${fasta} \\ ${pon_command} \\ ${gr_command} \\ + ${a_command} \\ ${interval_command} \\ --tmp-dir . \\ ${args} diff --git a/modules/nf-core/gatk4/mutect2/meta.yml b/modules/nf-core/gatk4/mutect2/meta.yml index 176f05a4724a..4e743d42684a 100644 --- a/modules/nf-core/gatk4/mutect2/meta.yml +++ b/modules/nf-core/gatk4/mutect2/meta.yml @@ -68,6 +68,17 @@ input: description: GATK sequence dictionary pattern: "*.dict" ontologies: [] + - alleles: + type: file + description: vcf file to be used to force-call alleles. + pattern: "*.vcf.gz" + ontologies: + - edam: http://edamontology.org/format_3989 # GZIP format + - alleles_tbi: + type: file + description: Index file for alleles to be force-called. + pattern: "*.vcf.gz.tbi" + ontologies: [] - germline_resource: type: file description: Population vcf of germline sequencing, containing allele fractions. @@ -143,3 +154,4 @@ authors: maintainers: - "@GCJMackenzie" - "@ramprasadn" + \ No newline at end of file diff --git a/modules/nf-core/gatk4/mutect2/tests/main.nf.test b/modules/nf-core/gatk4/mutect2/tests/main.nf.test index b0e22144c674..e7be4b217f8e 100644 --- a/modules/nf-core/gatk4/mutect2/tests/main.nf.test +++ b/modules/nf-core/gatk4/mutect2/tests/main.nf.test @@ -45,10 +45,12 @@ nextflow_process { [ id:'genome' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) ] - input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) - input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) - input[6] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) - input[7] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) + input[4] = [] + input[5] = [] + input[6] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) + input[7] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) + input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) + input[9] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) """ } } @@ -105,10 +107,12 @@ nextflow_process { [ id:'genome' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) ] - input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) - input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) - input[6] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) - input[7] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) + input[4] = [] + input[5] = [] + input[6] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) + input[7] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) + input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) + input[9] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) """ } } @@ -127,6 +131,7 @@ nextflow_process { ) } } + test("human - bam - tumor_only"){ when { params { @@ -152,10 +157,12 @@ nextflow_process { [ id:'genome' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) ] - input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) - input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) - input[6] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) - input[7] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) + input[4] = [] + input[5] = [] + input[6] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) + input[7] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) + input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) + input[9] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) """ } } @@ -174,6 +181,7 @@ nextflow_process { ) } } + test("human - cram"){ when { params { @@ -199,10 +207,12 @@ nextflow_process { [ id:'genome' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) ] - input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) - input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) - input[6] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) - input[7] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) + input[4] = [] + input[5] = [] + input[6] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) + input[7] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) + input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) + input[9] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) """ } } @@ -251,6 +261,8 @@ nextflow_process { input[5] = [] input[6] = [] input[7] = [] + input[8] = [] + input[9] = [] """ } } @@ -299,6 +311,8 @@ nextflow_process { input[5] = [] input[6] = [] input[7] = [] + input[8] = [] + input[9] = [] """ } } @@ -356,10 +370,12 @@ nextflow_process { [ id:'genome' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) ] - input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) - input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) - input[6] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) - input[7] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) + input[4] = [] + input[5] = [] + input[6] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) + input[7] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) + input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) + input[9] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) """ } } @@ -372,4 +388,115 @@ nextflow_process { } + test("human - bam - tumor_normal_pair - force_call") { + when { + params { + module_args = "" + } + process { + """ + input[0] = [ + [ + id:'test', + normal_id:'normal', + tumor_id:'tumour' + ], + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) + ], + [] + ] + input[1] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) + ] + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/axiom_exome_plus.genotypes.all_populations.poly.hg38.vcf.gz', checkIfExists: true) + input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/axiom_exome_plus.genotypes.all_populations.poly.hg38.vcf.gz.tbi', checkIfExists: true) + input[6] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) + input[7] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) + input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) + input[9] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { + assert snapshot( + path(process.out.vcf.get(0).get(1)).vcf.variantsMD5, + process.out.tbi.collect { file(it[1]).getName() }, + process.out.stats, + process.out.f1r2, + process.out.versions, + ).match() + } + ) + } + } + + test("human - bam - tumor_only - force_call"){ + when { + params { + module_args = '' + } + process { + """ + input[0] = [ + [ id:'test'], + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true)], + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true)], + [] + ] + input[1] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) + ] + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/axiom_exome_plus.genotypes.all_populations.poly.hg38.vcf.gz', checkIfExists: true) + input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/axiom_exome_plus.genotypes.all_populations.poly.hg38.vcf.gz.tbi', checkIfExists: true) + input[6] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) + input[7] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) + input[8] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true) + input[9] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true) + """ + } + } + then { + assertAll( + { assert process.success }, + { + assert snapshot( + path(process.out.vcf.get(0).get(1)).vcf.variantsMD5, + process.out.tbi.collect { file(it[1]).getName() }, + process.out.stats, + process.out.f1r2, + process.out.versions + ).match() + } + ) + } + } + } diff --git a/modules/nf-core/gatk4/mutect2/tests/main.nf.test.snap b/modules/nf-core/gatk4/mutect2/tests/main.nf.test.snap index 80d07bccbe73..83658618a914 100644 --- a/modules/nf-core/gatk4/mutect2/tests/main.nf.test.snap +++ b/modules/nf-core/gatk4/mutect2/tests/main.nf.test.snap @@ -26,6 +26,62 @@ }, "timestamp": "2025-04-08T15:44:32.616294519" }, + "human - bam - tumor_only - force_call": { + "content": [ + "9c2928d0e751262c048ac162b9223e4e", + [ + "test.vcf.gz.tbi" + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.stats:md5,2398263886ecb546c8055af4fbad6040" + ] + ], + [ + + ], + [ + "versions.yml:md5,8b99605d0a404d9ccbf8628ca881a8a4" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "25.04.6" + }, + "timestamp": "2025-09-08T17:28:49.754049381" + }, + "human - bam - tumor_normal_pair": { + "content": [ + "7418ed45a029394253817a5eb7149334", + [ + "test.vcf.gz.tbi" + ], + [ + [ + { + "id": "test", + "normal_id": "normal", + "tumor_id": "tumour" + }, + "test.vcf.gz.stats:md5,17d2091015d04cbd4a26b7a67dc659e6" + ] + ], + [ + + ], + [ + "versions.yml:md5,8b99605d0a404d9ccbf8628ca881a8a4" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-04-08T16:02:48.334206829" + }, "human - cram": { "content": [ "1b65f1a163b517944bf2e4b74230e035", @@ -80,20 +136,18 @@ }, "timestamp": "2025-04-08T15:44:46.867520687" }, - "human - bam - tumor_normal_pair": { + "human - bam - tumor_only": { "content": [ - "7418ed45a029394253817a5eb7149334", + "1b65f1a163b517944bf2e4b74230e035", [ "test.vcf.gz.tbi" ], [ [ { - "id": "test", - "normal_id": "normal", - "tumor_id": "tumour" + "id": "test" }, - "test.vcf.gz.stats:md5,17d2091015d04cbd4a26b7a67dc659e6" + "test.vcf.gz.stats:md5,55ed641e16089afb33cdbc478e202d3d" ] ], [ @@ -107,20 +161,22 @@ "nf-test": "0.9.2", "nextflow": "24.10.4" }, - "timestamp": "2025-04-08T16:02:48.334206829" + "timestamp": "2025-04-08T15:40:12.534802185" }, - "human - bam - tumor_only": { + "human - bam - tumor_normal_pair - force_call": { "content": [ - "1b65f1a163b517944bf2e4b74230e035", + "63c4ff01a8316f4243b6b12b06ded74e", [ "test.vcf.gz.tbi" ], [ [ { - "id": "test" + "id": "test", + "normal_id": "normal", + "tumor_id": "tumour" }, - "test.vcf.gz.stats:md5,55ed641e16089afb33cdbc478e202d3d" + "test.vcf.gz.stats:md5,81390058f99b80db30c89020aa9fc546" ] ], [ @@ -132,9 +188,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.4" + "nextflow": "25.04.6" }, - "timestamp": "2025-04-08T15:40:12.534802185" + "timestamp": "2025-09-08T17:24:41.459145834" }, "human - bam - tumor_normal_pair_f1r2 - stub": { "content": [ diff --git a/subworkflows/nf-core/bam_create_som_pon_gatk/main.nf b/subworkflows/nf-core/bam_create_som_pon_gatk/main.nf index a4b2c2c40c72..bc1cd077904d 100644 --- a/subworkflows/nf-core/bam_create_som_pon_gatk/main.nf +++ b/subworkflows/nf-core/bam_create_som_pon_gatk/main.nf @@ -30,6 +30,8 @@ workflow BAM_CREATE_SOM_PON_GATK { [], [], [], + [], + [], [] ) ch_versions = ch_versions.mix(GATK4_MUTECT2.out.versions.first()) diff --git a/subworkflows/nf-core/bam_create_som_pon_gatk/meta.yml b/subworkflows/nf-core/bam_create_som_pon_gatk/meta.yml index 26608360ca09..ed1ba59c4ea3 100644 --- a/subworkflows/nf-core/bam_create_som_pon_gatk/meta.yml +++ b/subworkflows/nf-core/bam_create_som_pon_gatk/meta.yml @@ -67,3 +67,4 @@ authors: - "@GCJMackenzie" maintainers: - "@GCJMackenzie" + \ No newline at end of file diff --git a/subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/main.nf b/subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/main.nf index 98ee1496b005..e0c4cf0da5df 100644 --- a/subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/main.nf +++ b/subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/main.nf @@ -13,6 +13,8 @@ workflow BAM_TUMOR_NORMAL_SOMATIC_VARIANT_CALLING_GATK { ch_fasta // channel: [ val(meta), path(fasta) ] ch_fai // channel: [ val(meta), path(fai) ] ch_dict // channel: [ val(meta), path(dict) ] + ch_alleles // channel: /path/to/alleles + ch_alleles_tbi // channel: /path/to/alleles/index ch_germline_resource // channel: /path/to/germline/resource ch_germline_resource_tbi // channel: /path/to/germline/index ch_panel_of_normals // channel: /path/to/panel/of/normals @@ -28,10 +30,12 @@ workflow BAM_TUMOR_NORMAL_SOMATIC_VARIANT_CALLING_GATK { ch_fasta, ch_fai, ch_dict, + ch_alleles, + ch_alleles_tbi, ch_germline_resource, ch_germline_resource_tbi, ch_panel_of_normals, - ch_panel_of_normals_tbi, + ch_panel_of_normals_tbi ) // Generate artifactpriors using learnreadorientationmodel on the f1r2 output of GATK4_MUTECT2. diff --git a/subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/meta.yml b/subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/meta.yml index b10244023320..a4c6bc8591b9 100644 --- a/subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/meta.yml +++ b/subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/meta.yml @@ -39,6 +39,14 @@ input: description: | GATK sequence dictionary Structure: [ path(dict) ] + - ch_alleles: + description: | + VCF file to be used for force calling of alleles. + Structure: [ path(alleles) ] + - ch_alleles_tbi: + description: | + Index of VCF file of alleles for force calling. + Structure: [ path(alleles_tbi) ] - ch_germline_resource: description: | Population vcf of germline sequencing, containing allele fractions. diff --git a/subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/tests/main.nf.test b/subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/tests/main.nf.test index 4a11f500de78..ac6cf7d22fbe 100644 --- a/subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/tests/main.nf.test +++ b/subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/tests/main.nf.test @@ -22,7 +22,7 @@ nextflow_workflow { when { workflow { """ - input[0] = Channel.of([ [ id:'test'], + input[0] = Channel.of([ [ id:'test'], [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true) @@ -31,20 +31,22 @@ nextflow_workflow { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) ], [] ]) - input[1] = Channel.of([[ id:'reference' ], + input[1] = Channel.of([[ id:'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) ]) - input[2] = Channel.of([[ id:'reference' ], + input[2] = Channel.of([[ id:'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) ]) - input[3] = Channel.of([[ id:'reference' ], + input[3] = Channel.of([[ id:'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) ]) - input[4] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true)) - input[5] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true)) - input[6] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true)) - input[7] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true)) - input[8] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.interval_list', checkIfExists: true)) + input[4] = [] + input[5] = [] + input[6] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true)) + input[7] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true)) + input[8] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true)) + input[9] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true)) + input[10] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.interval_list', checkIfExists: true)) """ } } @@ -78,7 +80,7 @@ nextflow_workflow { when { workflow { """ - input[0] = Channel.of([ [ id:'test'], + input[0] = Channel.of([ [ id:'test'], [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true) @@ -87,20 +89,22 @@ nextflow_workflow { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) ], [] ]) - input[1] = Channel.of([[ id:'reference' ], + input[1] = Channel.of([[ id:'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) ]) - input[2] = Channel.of([[ id:'reference' ], + input[2] = Channel.of([[ id:'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) ]) - input[3] = Channel.of([[ id:'reference' ], + input[3] = Channel.of([[ id:'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) ]) - input[4] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true)) - input[5] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true)) - input[6] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true)) - input[7] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true)) - input[8] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.interval_list', checkIfExists: true)) + input[4] = [] + input[5] = [] + input[6] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true)) + input[7] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true)) + input[8] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true)) + input[9] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true)) + input[10] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.interval_list', checkIfExists: true)) """ } } diff --git a/subworkflows/nf-core/bam_tumor_only_somatic_variant_calling_gatk/main.nf b/subworkflows/nf-core/bam_tumor_only_somatic_variant_calling_gatk/main.nf index 5ef1f9bb3013..53aa21d3095e 100644 --- a/subworkflows/nf-core/bam_tumor_only_somatic_variant_calling_gatk/main.nf +++ b/subworkflows/nf-core/bam_tumor_only_somatic_variant_calling_gatk/main.nf @@ -11,6 +11,8 @@ workflow BAM_TUMOR_ONLY_SOMATIC_VARIANT_CALLING_GATK { ch_fasta // channel: /path/to/reference/fasta ch_fai // channel: /path/to/reference/fasta/index ch_dict // channel: /path/to/reference/fasta/dictionary + ch_alleles // channel: /path/to/alleles + ch_alleles_tbi // channel: /path/to/alleles/index ch_germline_resource // channel: /path/to/germline/resource ch_germline_resource_tbi // channel: /path/to/germline/index ch_panel_of_normals // channel: /path/to/panel/of/normals @@ -26,10 +28,12 @@ workflow BAM_TUMOR_ONLY_SOMATIC_VARIANT_CALLING_GATK { ch_fasta, ch_fai, ch_dict, + ch_alleles, + ch_alleles_tbi, ch_germline_resource, ch_germline_resource_tbi, ch_panel_of_normals, - ch_panel_of_normals_tbi, + ch_panel_of_normals_tbi ) //Generate pileup summary table using getpileupsummaries. diff --git a/subworkflows/nf-core/bam_tumor_only_somatic_variant_calling_gatk/meta.yml b/subworkflows/nf-core/bam_tumor_only_somatic_variant_calling_gatk/meta.yml index 84def3ac5978..6d0ad89492da 100644 --- a/subworkflows/nf-core/bam_tumor_only_somatic_variant_calling_gatk/meta.yml +++ b/subworkflows/nf-core/bam_tumor_only_somatic_variant_calling_gatk/meta.yml @@ -44,6 +44,14 @@ input: type: file description: GATK sequence dictionary pattern: "*.dict" + - alleles: + type: file + description: vcf file to be used to force-call alleles. + pattern: "*.vcf.gz" + - alleles_tbi: + type: file + description: Index file for alleles to be force-called. + pattern: "*.vcf.gz.tbi" - germline_resource: type: file description: Population vcf of germline sequencing, containing allele fractions. diff --git a/subworkflows/nf-core/bam_tumor_only_somatic_variant_calling_gatk/tests/main.nf.test b/subworkflows/nf-core/bam_tumor_only_somatic_variant_calling_gatk/tests/main.nf.test index 224336b0987f..6b45db9c67c9 100644 --- a/subworkflows/nf-core/bam_tumor_only_somatic_variant_calling_gatk/tests/main.nf.test +++ b/subworkflows/nf-core/bam_tumor_only_somatic_variant_calling_gatk/tests/main.nf.test @@ -21,27 +21,29 @@ nextflow_workflow { when { workflow { """ - input[0] = Channel.of([ [ id:'test2'], + input[0] = Channel.of([ [ id:'test2'], [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true) ], [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) ], [] ]) - input[1] = Channel.of([[ id:'reference' ], + input[1] = Channel.of([[ id:'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) ]) - input[2] = Channel.of([[ id:'reference' ], + input[2] = Channel.of([[ id:'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) ]) - input[3] = Channel.of([[ id:'reference' ], + input[3] = Channel.of([[ id:'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) ]) - input[4] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true)) - input[5] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true)) - input[6] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true)) - input[7] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true)) - input[8] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.interval_list', checkIfExists: true)) + input[4] = [] + input[5] = [] + input[6] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true)) + input[7] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true)) + input[8] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true)) + input[9] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true)) + input[10] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.interval_list', checkIfExists: true)) """ } } @@ -72,27 +74,29 @@ nextflow_workflow { when { workflow { """ - input[0] = Channel.of([ [ id:'test'], + input[0] = Channel.of([ [ id:'test'], [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam', checkIfExists: true) ], [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true) ], [] ]) - input[1] = Channel.of([[ id:'reference' ], + input[1] = Channel.of([[ id:'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) ]) - input[2] = Channel.of([[ id:'reference' ], + input[2] = Channel.of([[ id:'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) ]) - input[3] = Channel.of([[ id:'reference' ], + input[3] = Channel.of([[ id:'reference' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) ]) - input[4] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true)) - input[5] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true)) - input[6] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true)) - input[7] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true)) - input[8] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.interval_list', checkIfExists: true)) + input[4] = [] + input[5] = [] + input[6] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true)) + input[7] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true)) + input[8] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz', checkIfExists: true)) + input[9] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/mills_and_1000G.indels.hg38.vcf.gz.tbi', checkIfExists: true)) + input[10] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.interval_list', checkIfExists: true)) """ } }