diff --git a/modules/nf-core/bcftools/annotate/main.nf b/modules/nf-core/bcftools/annotate/main.nf index 28964d2a72e4..18778cc2b0cb 100644 --- a/modules/nf-core/bcftools/annotate/main.nf +++ b/modules/nf-core/bcftools/annotate/main.nf @@ -8,10 +8,7 @@ process BCFTOOLS_ANNOTATE { : 'community.wave.seqera.io/library/bcftools_htslib:0a3fa2654b52006f'}" input: - tuple val(meta), path(input), path(index), path(annotations), path(annotations_index) - path columns - path header_lines - path rename_chrs + tuple val(meta), path(input), path(index), path(annotations), path(annotations_index), path(columns), path(header_lines), path(rename_chrs) output: tuple val(meta), path("${prefix}.${extension}"), emit: vcf diff --git a/modules/nf-core/bcftools/annotate/meta.yml b/modules/nf-core/bcftools/annotate/meta.yml index af8bcf84de80..863316616098 100644 --- a/modules/nf-core/bcftools/annotate/meta.yml +++ b/modules/nf-core/bcftools/annotate/meta.yml @@ -36,19 +36,19 @@ input: type: file description: Index of the annotations file ontologies: [] - - columns: - type: file - description: List of columns in the annotations file, one name per row - ontologies: [] - - header_lines: - type: file - description: Contains lines to append to the output VCF header - ontologies: [] - - rename_chrs: - type: file - description: Rename annotations according to this file containing "old_name new_name\n" - pairs separated by whitespaces, each on a separate line. - ontologies: [] + - columns: + type: file + description: List of columns in the annotations file, one name per row + ontologies: [] + - header_lines: + type: file + description: Contains lines to append to the output VCF header + ontologies: [] + - rename_chrs: + type: file + description: Rename annotations according to this file containing "old_name new_name\n" + pairs separated by whitespaces, each on a separate line. + ontologies: [] output: vcf: - - meta: diff --git a/modules/nf-core/bcftools/annotate/tests/bcf.config b/modules/nf-core/bcftools/annotate/tests/bcf.config deleted file mode 100644 index 79d26779da90..000000000000 --- a/modules/nf-core/bcftools/annotate/tests/bcf.config +++ /dev/null @@ -1,4 +0,0 @@ -process { - ext.args = "-x ID,INFO/DP,FORMAT/DP --output-type u" - ext.prefix = { "${meta.id}_ann" } -} diff --git a/modules/nf-core/bcftools/annotate/tests/main.nf.test b/modules/nf-core/bcftools/annotate/tests/main.nf.test index 39010bdc323a..3e1d257338c1 100644 --- a/modules/nf-core/bcftools/annotate/tests/main.nf.test +++ b/modules/nf-core/bcftools/annotate/tests/main.nf.test @@ -2,6 +2,7 @@ nextflow_process { name "Test Process BCFTOOLS_ANNOTATE" script "../main.nf" + config "./nextflow.config" process "BCFTOOLS_ANNOTATE" tag "modules" @@ -11,9 +12,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - vcf_output") { - config "./vcf.config" - when { + params { + args_modules = "-x ID,INFO/DP,FORMAT/DP --output-type z" + } process { """ input[0] = [ @@ -21,11 +23,9 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + [], [], [] ] - input[1] = [] - input[2] = [] - input[3] = [] """ } } @@ -45,9 +45,10 @@ nextflow_process { test("sarscov2 - [vcf, [], annotation, annotation_tbi], [], [], [] - vcf_output") { - config "./vcf.config" - when { + params { + args_modules = "-x ID,INFO/DP,FORMAT/DP --output-type z" + } process { """ input[0] = [ @@ -55,11 +56,9 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), [], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + [], [], [] ] - input[1] = [] - input[2] = [] - input[3] = [] """ } } @@ -79,9 +78,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - vcf_gz_index") { - config "./vcf_gz_index.config" - when { + params { + args_modules = "--output-type z --write-index --no-version" + } process { """ input[0] = [ @@ -89,11 +89,9 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + [], [], [] ] - input[1] = [] - input[2] = [] - input[3] = [] """ } } @@ -113,9 +111,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - vcf_gz_index_csi") { - config "./vcf_gz_index_csi.config" - when { + params { + args_modules = "--output-type z --write-index=csi --no-version" + } process { """ input[0] = [ @@ -123,11 +122,9 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + [], [], [] ] - input[1] = [] - input[2] = [] - input[3] = [] """ } } @@ -147,9 +144,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - vcf_gz_index_tbi") { - config "./vcf_gz_index_tbi.config" - when { + params { + args_modules = "--output-type z --write-index=tbi --no-version" + } process { """ input[0] = [ @@ -157,11 +155,9 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + [], [], [] ] - input[1] = [] - input[2] = [] - input[3] = [] """ } } @@ -181,24 +177,26 @@ nextflow_process { test("sarscov2 - [vcf, [], annotation, annotation_tbi], [], header, [] - bcf_output") { - config "./bcf.config" - when { + params { + args_modules = "-x ID,INFO/DP,FORMAT/DP --output-type u" + } process { """ - input[0] = [ + header = channel.of( + '##INFO=', + '##INFO=' + ).collectFile(name:"headers.vcf", newLine:true) + input[0] = channel.of([ [ id:'test', single_end:false ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), [], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) - ] - input[1] = [] - input[2] = Channel.of( - '##INFO=', - '##INFO=' - ).collectFile(name:"headers.vcf", newLine:true) - input[3] = [] + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + [] + ]) + .combine(header) + .combine(channel.of([[]])) """ } } @@ -218,21 +216,21 @@ nextflow_process { test("sarscov2 - [vcf, [], annotation, annotation_tbi], columns, [], [] - bcf_output") { - config "./bcf.config" - when { + params { + args_modules = "-x ID,INFO/DP,FORMAT/DP --output-type u" + } process { """ - input[0] = [ + columns = channel.of('INFO/ICB', 'INFO/HOB', 'INFO/DP4').collectFile(name:"columns.txt", newLine:true) + input[0] = channel.of([ [ id:'test', single_end:false ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), [], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) - ] - input[1] = Channel.of('INFO/ICB', 'INFO/HOB', 'INFO/DP4').collectFile(name:"columns.txt", newLine:true) - input[2] = [] - input[3] = [] + ]).combine(columns) + .combine(channel.of([[], []])) """ } } @@ -252,24 +250,26 @@ nextflow_process { test("sarscov2 - [vcf, [], annotation, annotation_tbi], [], header, rename_chrs - vcf_gz_index") { - config "./vcf_gz_index.config" - when { + params { + args_modules = "--output-type z --write-index --no-version" + } process { """ - input[0] = [ + headers = channel.of( + '##INFO=', + '##INFO=' + ).collectFile(name:"headers.vcf", newLine:true) + rename = channel.of('MT192765.1 renamed').collectFile(name:"rename.txt", newLine:true) + input[0] = channel.of([ [ id:'test', single_end:false ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), [], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) - ] - input[1] = [] - input[2] = Channel.of( - '##INFO=', - '##INFO=' - ).collectFile(name:"headers.vcf", newLine:true) - input[3] = Channel.of('MT192765.1 renamed').collectFile(name:"rename.txt", newLine:true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + [] + ]).combine(headers) + .combine(rename) """ } } @@ -289,10 +289,12 @@ nextflow_process { test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - stub") { - config "./vcf.config" options "-stub" when { + params { + args_modules = "-x ID,INFO/DP,FORMAT/DP --output-type z" + } process { """ input[0] = [ @@ -300,11 +302,9 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + [], [], [] ] - input[1] = [] - input[2] = [] - input[3] = [] """ } } @@ -324,10 +324,12 @@ nextflow_process { test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - vcf_gz_index - stub") { - config "./vcf_gz_index.config" options "-stub" when { + params { + args_modules = "--output-type z --write-index --no-version" + } process { """ input[0] = [ @@ -335,11 +337,9 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + [], [], [] ] - input[1] = [] - input[2] = [] - input[3] = [] """ } } @@ -359,10 +359,12 @@ nextflow_process { test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - vcf_gz_index_csi - stub") { - config "./vcf_gz_index_csi.config" options "-stub" when { + params { + args_modules = "--output-type z --write-index=csi --no-version" + } process { """ input[0] = [ @@ -370,11 +372,9 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + [], [], [] ] - input[1] = [] - input[2] = [] - input[3] = [] """ } } @@ -394,10 +394,12 @@ nextflow_process { test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - vcf_gz_index_tbi - stub") { - config "./vcf_gz_index_tbi.config" options "-stub" when { + params { + args_modules = "--output-type z --write-index=tbi --no-version" + } process { """ input[0] = [ @@ -405,11 +407,9 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), + [], [], [] ] - input[1] = [] - input[2] = [] - input[3] = [] """ } } diff --git a/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap b/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap index 4d57dfbb1bf3..10af196a1857 100644 --- a/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap @@ -7,7 +7,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz" + "test_ann.vcf.gz" ] ], [ @@ -19,7 +19,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz.csi" + "test_ann.vcf.gz.csi" ] ], { @@ -34,9 +34,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.3" }, - "timestamp": "2026-01-15T16:46:28.350541494" + "timestamp": "2026-02-27T15:29:19.618749659" }, "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - vcf_gz_index_tbi": { "content": [ @@ -46,7 +46,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz:variantsMD5,bc7bf3ee9e8430e064c539eb81e59bf9" + "test_ann.vcf.gz:variantsMD5,bc7bf3ee9e8430e064c539eb81e59bf9" ] ], [ @@ -55,7 +55,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz.tbi" + "test_ann.vcf.gz.tbi" ] ], [ @@ -73,9 +73,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.3" }, - "timestamp": "2026-01-15T17:35:23.346991616" + "timestamp": "2026-02-27T15:28:43.350060834" }, "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - vcf_gz_index_csi": { "content": [ @@ -85,7 +85,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz:variantsMD5,bc7bf3ee9e8430e064c539eb81e59bf9" + "test_ann.vcf.gz:variantsMD5,bc7bf3ee9e8430e064c539eb81e59bf9" ] ], [ @@ -97,7 +97,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz.csi" + "test_ann.vcf.gz.csi" ] ], { @@ -112,9 +112,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.3" }, - "timestamp": "2026-01-15T17:35:15.126643898" + "timestamp": "2026-02-27T15:28:36.101003418" }, "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - vcf_gz_index_tbi - stub": { "content": [ @@ -124,7 +124,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz" + "test_ann.vcf.gz" ] ], [ @@ -133,7 +133,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz.tbi" + "test_ann.vcf.gz.tbi" ] ], [ @@ -151,9 +151,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.3" }, - "timestamp": "2026-01-15T16:46:46.844515012" + "timestamp": "2026-02-27T15:29:34.19449127" }, "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - vcf_gz_index_csi - stub": { "content": [ @@ -163,7 +163,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz" + "test_ann.vcf.gz" ] ], [ @@ -175,7 +175,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz.csi" + "test_ann.vcf.gz.csi" ] ], { @@ -190,9 +190,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.3" }, - "timestamp": "2026-01-15T16:46:37.561478889" + "timestamp": "2026-02-27T15:29:26.927815399" }, "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - vcf_gz_index": { "content": [ @@ -202,7 +202,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz:variantsMD5,bc7bf3ee9e8430e064c539eb81e59bf9" + "test_ann.vcf.gz:variantsMD5,bc7bf3ee9e8430e064c539eb81e59bf9" ] ], [ @@ -214,7 +214,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz.csi" + "test_ann.vcf.gz.csi" ] ], { @@ -229,9 +229,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.3" }, - "timestamp": "2026-01-15T17:35:06.608740206" + "timestamp": "2026-02-27T15:28:28.891823681" }, "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - stub": { "content": [ @@ -241,7 +241,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz" + "test_ann.vcf.gz" ] ], [ @@ -262,9 +262,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.3" }, - "timestamp": "2026-01-15T16:46:18.623176402" + "timestamp": "2026-02-27T15:29:12.400301681" }, "sarscov2 - [vcf, [], annotation, annotation_tbi], [], header, [] - bcf_output": { "content": [ @@ -295,9 +295,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.3" }, - "timestamp": "2026-01-15T16:57:59.109447684" + "timestamp": "2026-02-27T15:28:50.375384421" }, "sarscov2 - [vcf, [], annotation, annotation_tbi], [], [], [] - vcf_output": { "content": [ @@ -307,7 +307,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz:variantsMD5,250b64289ab9d48f76359d01699fdf7d" + "test_ann.vcf.gz:variantsMD5,250b64289ab9d48f76359d01699fdf7d" ] ], [ @@ -328,9 +328,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.3" }, - "timestamp": "2026-01-15T17:34:58.100296619" + "timestamp": "2026-02-27T15:28:21.320211288" }, "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [], [], [] - vcf_output": { "content": [ @@ -340,7 +340,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz:variantsMD5,250b64289ab9d48f76359d01699fdf7d" + "test_ann.vcf.gz:variantsMD5,250b64289ab9d48f76359d01699fdf7d" ] ], [ @@ -361,9 +361,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.3" }, - "timestamp": "2026-01-15T17:34:49.49779004" + "timestamp": "2026-02-27T15:28:13.274072987" }, "sarscov2 - [vcf, [], annotation, annotation_tbi], [], header, rename_chrs - vcf_gz_index": { "content": [ @@ -373,7 +373,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz" + "test_ann.vcf.gz" ] ], [ @@ -385,7 +385,7 @@ "id": "test", "single_end": false }, - "test_vcf.vcf.gz.csi" + "test_ann.vcf.gz.csi" ] ], { @@ -400,9 +400,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.3" }, - "timestamp": "2026-01-15T16:58:16.686295153" + "timestamp": "2026-02-27T15:29:05.094685409" }, "sarscov2 - [vcf, [], annotation, annotation_tbi], columns, [], [] - bcf_output": { "content": [ @@ -433,8 +433,8 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.3" }, - "timestamp": "2026-01-15T16:58:07.908352766" + "timestamp": "2026-02-27T15:28:57.906382655" } } \ No newline at end of file diff --git a/modules/nf-core/bcftools/annotate/tests/nextflow.config b/modules/nf-core/bcftools/annotate/tests/nextflow.config new file mode 100644 index 000000000000..102351009b58 --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/nextflow.config @@ -0,0 +1,4 @@ +process { + ext.args = "${params.args_modules}" + ext.prefix = { "${meta.id}_ann" } +} diff --git a/modules/nf-core/bcftools/annotate/tests/vcf.config b/modules/nf-core/bcftools/annotate/tests/vcf.config deleted file mode 100644 index 611868d55ca1..000000000000 --- a/modules/nf-core/bcftools/annotate/tests/vcf.config +++ /dev/null @@ -1,4 +0,0 @@ -process { - ext.args = "-x ID,INFO/DP,FORMAT/DP --output-type z" - ext.prefix = { "${meta.id}_vcf" } -} diff --git a/modules/nf-core/bcftools/annotate/tests/vcf_gz_index.config b/modules/nf-core/bcftools/annotate/tests/vcf_gz_index.config deleted file mode 100644 index 2fd9a225f03e..000000000000 --- a/modules/nf-core/bcftools/annotate/tests/vcf_gz_index.config +++ /dev/null @@ -1,4 +0,0 @@ -process { - ext.args = "--output-type z --write-index --no-version" - ext.prefix = { "${meta.id}_vcf" } -} diff --git a/modules/nf-core/bcftools/annotate/tests/vcf_gz_index_csi.config b/modules/nf-core/bcftools/annotate/tests/vcf_gz_index_csi.config deleted file mode 100644 index 512c1dfb0548..000000000000 --- a/modules/nf-core/bcftools/annotate/tests/vcf_gz_index_csi.config +++ /dev/null @@ -1,4 +0,0 @@ -process { - ext.args = "--output-type z --write-index=csi --no-version" - ext.prefix = { "${meta.id}_vcf" } -} diff --git a/modules/nf-core/bcftools/annotate/tests/vcf_gz_index_tbi.config b/modules/nf-core/bcftools/annotate/tests/vcf_gz_index_tbi.config deleted file mode 100644 index 7feb5ebbed38..000000000000 --- a/modules/nf-core/bcftools/annotate/tests/vcf_gz_index_tbi.config +++ /dev/null @@ -1,4 +0,0 @@ -process { - ext.args = "--output-type z --write-index=tbi --no-version" - ext.prefix = { "${meta.id}_vcf" } -} diff --git a/modules/nf-core/bcftools/merge/main.nf b/modules/nf-core/bcftools/merge/main.nf index 6c944151b6a1..f1acbd3da4b1 100644 --- a/modules/nf-core/bcftools/merge/main.nf +++ b/modules/nf-core/bcftools/merge/main.nf @@ -8,10 +8,8 @@ process BCFTOOLS_MERGE { : 'community.wave.seqera.io/library/bcftools_htslib:0a3fa2654b52006f'}" input: - tuple val(meta), path(vcfs), path(tbis) - tuple val(meta2), path(fasta) - tuple val(meta3), path(fai) - tuple val(meta4), path(bed) + tuple val(meta), path(vcfs), path(tbis), path(bed) + tuple val(meta2), path(fasta), path(fai) output: tuple val(meta), path("*.{bcf,vcf}{,.gz}"), emit: vcf diff --git a/modules/nf-core/bcftools/merge/meta.yml b/modules/nf-core/bcftools/merge/meta.yml index f66b688456e8..445e5c56be97 100644 --- a/modules/nf-core/bcftools/merge/meta.yml +++ b/modules/nf-core/bcftools/merge/meta.yml @@ -31,6 +31,11 @@ input: List containing the tbi index files corresponding to the vcfs input files e.g. [ 'file1.vcf.tbi', 'file2.vcf.tbi' ] ontologies: [] + - bed: + type: file + description: "(Optional) The bed regions to merge on" + pattern: "*.bed" + ontologies: [] - - meta2: type: map description: | @@ -42,27 +47,12 @@ input: FILE` parameter)" pattern: "*.{fasta,fa}" ontologies: [] - - - meta3: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - fai: type: file description: "(Optional) The fasta reference file index (only necessary for the `--gvcf FILE` parameter)" pattern: "*.fai" ontologies: [] - - - meta4: - type: map - description: | - Groovy Map containing bed information - e.g. [ id:'genome' ] - - bed: - type: file - description: "(Optional) The bed regions to merge on" - pattern: "*.bed" - ontologies: [] output: vcf: - - meta: diff --git a/modules/nf-core/bcftools/merge/tests/bcf.config b/modules/nf-core/bcftools/merge/tests/bcf.config deleted file mode 100644 index 4467d07d96a0..000000000000 --- a/modules/nf-core/bcftools/merge/tests/bcf.config +++ /dev/null @@ -1,3 +0,0 @@ -process { - ext.args = '--output-type u --no-version' -} diff --git a/modules/nf-core/bcftools/merge/tests/bcf_gz.config b/modules/nf-core/bcftools/merge/tests/bcf_gz.config deleted file mode 100644 index 280de8db094e..000000000000 --- a/modules/nf-core/bcftools/merge/tests/bcf_gz.config +++ /dev/null @@ -1,3 +0,0 @@ -process { - ext.args = '--output-type b --no-version' -} diff --git a/modules/nf-core/bcftools/merge/tests/main.nf.test b/modules/nf-core/bcftools/merge/tests/main.nf.test index e863f1816beb..3a1f12206b17 100644 --- a/modules/nf-core/bcftools/merge/tests/main.nf.test +++ b/modules/nf-core/bcftools/merge/tests/main.nf.test @@ -2,6 +2,8 @@ nextflow_process { name "Test Process BCFTOOLS_MERGE" script "../main.nf" + config "./nextflow.config" + process "BCFTOOLS_MERGE" tag "modules" @@ -11,9 +13,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], []") { - config "./nextflow.config" - when { + params { + args_modules = "--force-samples --force-single --no-version" + } process { """ input[0] = [ @@ -25,11 +28,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -48,9 +50,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - vcf output") { - config "./vcf.config" - when { + params { + args_modules = "--output-type v --no-version" + } process { """ input[0] = [ @@ -62,11 +65,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -85,9 +87,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output") { - config "./vcf_gz.config" - when { + params { + args_modules = "--output-type z --no-version" + } process { """ input[0] = [ @@ -99,11 +102,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -122,9 +124,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - bcf output") { - config "./bcf.config" - when { + params { + args_modules = "--output-type u --no-version" + } process { """ input[0] = [ @@ -136,11 +139,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -159,9 +161,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - bcf.gz output") { - config "./bcf_gz.config" - when { + params { + args_modules = "--output-type b --no-version" + } process { """ input[0] = [ @@ -173,11 +176,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -196,9 +198,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - index") { - config "./vcf_gz_index.config" - when { + params { + args_modules = "--output-type z --write-index --no-version" + } process { """ input[0] = [ @@ -210,11 +213,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -235,10 +237,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - csi index") { - config "./vcf_gz_index_csi.config" - when { - + params { + args_modules = "--output-type z --write-index=csi --no-version" + } process { """ input[0] = [ @@ -250,11 +252,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -275,9 +276,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - tbi index") { - config "./vcf_gz_index_tbi.config" - when { + params { + args_modules = "--output-type z --write-index=tbi --no-version" + } process { """ input[0] = [ @@ -289,11 +291,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -314,9 +315,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], bed") { - config "./nextflow.config" - when { + params { + args_modules = "--force-samples --force-single --no-version" + } process { """ input[0] = [ @@ -328,14 +330,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] - ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [ - [ id:'test' ], // meta map - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] + ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] + input[1] = [[],[],[]] """ } } @@ -354,9 +352,10 @@ nextflow_process { test("homo_sapiens - [vcf, tbi], fasta, fai, bed - vcf.gz output") { - config "./nextflow.gvcf.config" - when { + params { + args_modules = "--force-samples --no-version --output-type z --gvcf genome.fasta" + } process { """ input[0] = [ @@ -368,20 +367,14 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz.tbi', checkIfExists: true), - ] + ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ] input[1] = [ [ id:'test' ], // meta map - [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] - ] - input[2] = [ - [ id:'test' ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ], [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ] ] - input[3] = [ - [ id:'test' ], // meta map - [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ] - ] """ } } @@ -400,8 +393,10 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - one sample") { - config "./nextflow.config" when { + params { + args_modules = "--force-samples --force-single --no-version" + } process { """ input[0] = [ @@ -411,11 +406,10 @@ nextflow_process { ], [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -435,9 +429,11 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - stub") { options "-stub" - config "./nextflow.config" when { + params { + args_modules = "--force-samples --force-single --no-version" + } process { """ input[0] = [ @@ -449,11 +445,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -470,9 +465,11 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - vcf output - stub") { options "-stub" - config "./vcf.config" when { + params { + args_modules = "--output-type v --no-version" + } process { """ input[0] = [ @@ -484,11 +481,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -505,9 +501,11 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - stub") { options "-stub" - config "./vcf_gz.config" when { + params { + args_modules = "--output-type z --no-version" + } process { """ input[0] = [ @@ -519,11 +517,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -540,9 +537,11 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - bcf output - stub") { options "-stub" - config "./bcf.config" when { + params { + args_modules = "--output-type u --no-version" + } process { """ input[0] = [ @@ -554,11 +553,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -575,9 +573,11 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - bcf.gz output - stub") { options "-stub" - config "./bcf_gz.config" when { + params { + args_modules = "--output-type b --no-version" + } process { """ input[0] = [ @@ -589,11 +589,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -610,9 +609,11 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - index - stub") { options "-stub" - config "./vcf_gz_index.config" when { + params { + args_modules = "--output-type z --write-index --no-version" + } process { """ input[0] = [ @@ -624,11 +625,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -646,9 +646,11 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - csi index - stub") { options "-stub" - config "./vcf_gz_index_csi.config" when { + params { + args_modules = "--output-type z --write-index=csi --no-version" + } process { """ input[0] = [ @@ -660,11 +662,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] + ], + [] ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] + input[1] = [[],[],[]] """ } } @@ -682,45 +683,11 @@ nextflow_process { test("sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - tbi index - stub") { options "-stub" - config "./vcf_gz_index_tbi.config" when { - process { - """ - input[0] = [ - [ id:'test' ], // meta map - [ - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) - ], - [ - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] - ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] - """ + params { + args_modules = "--output-type z --write-index=tbi --no-version" } - } - - then { - assertAll( - { assert process.success }, - { assert process.out.vcf.get(0).get(1).endsWith("vcf.gz") }, - { assert process.out.index.get(0).get(1).endsWith("tbi") }, - { assert snapshot(process.out).match() } - ) - } - } - - test("sarscov2 - [vcf, tbi], [], [], bed - stub") { - - options "-stub" - config "./nextflow.config" - - when { process { """ input[0] = [ @@ -732,57 +699,10 @@ nextflow_process { [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz.tbi', checkIfExists: true), - ] - ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [ - [ id:'test' ], // meta map - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] - ] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert process.out.vcf.get(0).get(1).endsWith("vcf") }, - { assert snapshot(process.out).match() } - ) - } - } - - test("homo_sapiens - [vcf, tbi], fasta, fai, bed - vcf.gz output - stub") { - - options "-stub" - config "./nextflow.gvcf.config" - when { - process { - """ - input[0] = [ - [ id:'test' ], // meta map - [ - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz', checkIfExists: true) ], - [ - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test2.genome.vcf.gz.tbi', checkIfExists: true), - ] - ] - input[1] = [ - [ id:'test' ], // meta map - [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] - ] - input[2] = [ - [ id:'test' ], // meta map - [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ] - ] - input[3] = [ - [ id:'test' ], // meta map - [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ] + [] ] + input[1] = [[],[],[]] """ } } @@ -791,39 +711,7 @@ nextflow_process { assertAll( { assert process.success }, { assert process.out.vcf.get(0).get(1).endsWith("vcf.gz") }, - { assert snapshot(process.out).match() } - ) - } - } - - test("sarscov2 - [vcf, tbi], [], [], [] - one sample - stub") { - - options "-stub" - config "./nextflow.config" - - when { - process { - """ - input[0] = [ - [ id:'test' ], // meta map - [ - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true) - ], - [ - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) - ] - ] - input[1] = [[],[]] - input[2] = [[],[]] - input[3] = [[],[]] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert process.out.vcf.get(0).get(1).endsWith("vcf") }, + { assert process.out.index.get(0).get(1).endsWith("tbi") }, { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/bcftools/merge/tests/main.nf.test.snap b/modules/nf-core/bcftools/merge/tests/main.nf.test.snap index 8f925a8e2ae0..9dd0917830f7 100644 --- a/modules/nf-core/bcftools/merge/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/merge/tests/main.nf.test.snap @@ -351,53 +351,6 @@ }, "timestamp": "2026-01-20T12:04:22.660557224" }, - "sarscov2 - [vcf, tbi], [], [], bed - stub": { - "content": [ - { - "0": [ - [ - { - "id": "test" - }, - "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - - ], - "2": [ - [ - "BCFTOOLS_MERGE", - "bcftools", - "1.22" - ] - ], - "index": [ - - ], - "vcf": [ - [ - { - "id": "test" - }, - "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "versions_bcftools": [ - [ - "BCFTOOLS_MERGE", - "bcftools", - "1.22" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2026-01-20T12:06:42.799574825" - }, "sarscov2 - [vcf, tbi], [], [], [] - bcf output": { "content": [ "test.bcf", @@ -464,100 +417,6 @@ }, "timestamp": "2026-01-20T12:05:59.932077434" }, - "sarscov2 - [vcf, tbi], [], [], [] - one sample - stub": { - "content": [ - { - "0": [ - [ - { - "id": "test" - }, - "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - - ], - "2": [ - [ - "BCFTOOLS_MERGE", - "bcftools", - "1.22" - ] - ], - "index": [ - - ], - "vcf": [ - [ - { - "id": "test" - }, - "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "versions_bcftools": [ - [ - "BCFTOOLS_MERGE", - "bcftools", - "1.22" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2026-01-20T12:07:00.260709958" - }, - "homo_sapiens - [vcf, tbi], fasta, fai, bed - vcf.gz output - stub": { - "content": [ - { - "0": [ - [ - { - "id": "test" - }, - "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] - ], - "1": [ - - ], - "2": [ - [ - "BCFTOOLS_MERGE", - "bcftools", - "1.22" - ] - ], - "index": [ - - ], - "vcf": [ - [ - { - "id": "test" - }, - "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] - ], - "versions_bcftools": [ - [ - "BCFTOOLS_MERGE", - "bcftools", - "1.22" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2026-01-20T12:06:52.181671234" - }, "sarscov2 - [vcf, tbi], [], [], [] - vcf.gz output - index": { "content": [ "e0de448dc8e712956a03ce68d79a0b3a", diff --git a/modules/nf-core/bcftools/merge/tests/nextflow.config b/modules/nf-core/bcftools/merge/tests/nextflow.config index c3f0b7159956..36f2fa1a506f 100644 --- a/modules/nf-core/bcftools/merge/tests/nextflow.config +++ b/modules/nf-core/bcftools/merge/tests/nextflow.config @@ -1,5 +1,5 @@ process { withName: BCFTOOLS_MERGE { - ext.args = '--force-samples --force-single --no-version' + ext.args = "${params.args_modules}" } } diff --git a/modules/nf-core/bcftools/merge/tests/nextflow.gvcf.config b/modules/nf-core/bcftools/merge/tests/nextflow.gvcf.config deleted file mode 100644 index 8c457b716dbe..000000000000 --- a/modules/nf-core/bcftools/merge/tests/nextflow.gvcf.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - withName: BCFTOOLS_MERGE { - ext.args = { "--force-samples --no-version --output-type z --gvcf $fasta" } - } -} diff --git a/modules/nf-core/bcftools/merge/tests/vcf.config b/modules/nf-core/bcftools/merge/tests/vcf.config deleted file mode 100644 index 759222e58ca7..000000000000 --- a/modules/nf-core/bcftools/merge/tests/vcf.config +++ /dev/null @@ -1,3 +0,0 @@ -process { - ext.args = '--output-type v --no-version' -} diff --git a/modules/nf-core/bcftools/merge/tests/vcf_gz.config b/modules/nf-core/bcftools/merge/tests/vcf_gz.config deleted file mode 100644 index 8b6ad8b4fdcf..000000000000 --- a/modules/nf-core/bcftools/merge/tests/vcf_gz.config +++ /dev/null @@ -1,3 +0,0 @@ -process { - ext.args = '--output-type z --no-version' -} diff --git a/modules/nf-core/bcftools/merge/tests/vcf_gz_index.config b/modules/nf-core/bcftools/merge/tests/vcf_gz_index.config deleted file mode 100644 index 9f1e9b1d8f2b..000000000000 --- a/modules/nf-core/bcftools/merge/tests/vcf_gz_index.config +++ /dev/null @@ -1,3 +0,0 @@ -process { - ext.args = "--output-type z --write-index --no-version" -} diff --git a/modules/nf-core/bcftools/merge/tests/vcf_gz_index_csi.config b/modules/nf-core/bcftools/merge/tests/vcf_gz_index_csi.config deleted file mode 100644 index 8308ee1aed4f..000000000000 --- a/modules/nf-core/bcftools/merge/tests/vcf_gz_index_csi.config +++ /dev/null @@ -1,3 +0,0 @@ -process { - ext.args = "--output-type z --write-index=csi --no-version" -} diff --git a/modules/nf-core/bcftools/merge/tests/vcf_gz_index_tbi.config b/modules/nf-core/bcftools/merge/tests/vcf_gz_index_tbi.config deleted file mode 100644 index 9be4075bc17b..000000000000 --- a/modules/nf-core/bcftools/merge/tests/vcf_gz_index_tbi.config +++ /dev/null @@ -1,3 +0,0 @@ -process { - ext.args = "--output-type z --write-index=tbi --no-version" -} diff --git a/modules/nf-core/bcftools/mpileup/main.nf b/modules/nf-core/bcftools/mpileup/main.nf index 27fc67ce9dd9..0b35ddac402a 100644 --- a/modules/nf-core/bcftools/mpileup/main.nf +++ b/modules/nf-core/bcftools/mpileup/main.nf @@ -8,8 +8,8 @@ process BCFTOOLS_MPILEUP { : 'community.wave.seqera.io/library/bcftools_htslib:0a3fa2654b52006f'}" input: - tuple val(meta), path(bam), path(intervals) - tuple val(meta2), path(fasta) + tuple val(meta), path(bam), path(intervals_mpileup, stageAs: 'mpileup_intervals/*'), path(intervals_call, stageAs: 'call_intervals/*') + tuple val(meta2), path(fasta), path(fai) val save_mpileup output: @@ -29,7 +29,8 @@ process BCFTOOLS_MPILEUP { def prefix = task.ext.prefix ?: "${meta.id}" def mpileup = save_mpileup ? "| tee ${prefix}.mpileup" : "" def bgzip_mpileup = save_mpileup ? "bgzip ${prefix}.mpileup" : "" - def intervals_cmd = intervals ? "-T ${intervals}" : "" + def intervals_mpileup_cmd = intervals_mpileup ? "-T ${intervals_mpileup}" : "" + def intervals_call_cmd = intervals_call ? "-T ${intervals_call}" : "" """ echo "${meta.id}" > sample_name.list @@ -38,9 +39,9 @@ process BCFTOOLS_MPILEUP { --fasta-ref ${fasta} \\ ${args} \\ ${bam} \\ - ${intervals_cmd} \\ + ${intervals_mpileup_cmd} \\ ${mpileup} \\ - | bcftools call --output-type v ${args2} \\ + | bcftools call --output-type v ${args2} ${intervals_call_cmd} \\ | bcftools reheader --samples sample_name.list \\ | bcftools view --output-file ${prefix}.vcf.gz --output-type z ${args3} diff --git a/modules/nf-core/bcftools/mpileup/meta.yml b/modules/nf-core/bcftools/mpileup/meta.yml index b90ff762dbd0..53d38ca42dbc 100644 --- a/modules/nf-core/bcftools/mpileup/meta.yml +++ b/modules/nf-core/bcftools/mpileup/meta.yml @@ -24,10 +24,15 @@ input: description: Input BAM file pattern: "*.{bam}" ontologies: [] - - intervals: + - intervals_mpileup: type: file description: Input intervals file. A file (commonly '.bed') containing regions - to subset + to subset used by mpileup + ontologies: [] + - intervals_call: + type: file + description: Input intervals file. A file (commonly '.bed') containing regions + to subset used by call but need a fourth column with REF,ALT ontologies: [] - - meta2: type: map @@ -39,6 +44,11 @@ input: description: FASTA reference file pattern: "*.{fasta,fa}" ontologies: [] + - fai: + type: file + description: FASTA reference file index + pattern: "*.fai" + ontologies: [] - save_mpileup: type: boolean description: Save mpileup file generated by bcftools mpileup diff --git a/modules/nf-core/bcftools/mpileup/tests/main.nf.test b/modules/nf-core/bcftools/mpileup/tests/main.nf.test index 0b9c86c3f07b..2bbb355298cc 100644 --- a/modules/nf-core/bcftools/mpileup/tests/main.nf.test +++ b/modules/nf-core/bcftools/mpileup/tests/main.nf.test @@ -8,6 +8,7 @@ nextflow_process { tag "modules_nfcore" tag "bcftools" tag "bcftools/mpileup" + tag "bcftools/query" config "./nextflow.config" @@ -19,11 +20,13 @@ nextflow_process { input[0] = [ [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [], [] ] input[1] = [ [ id:'sarscov2' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ] input[2] = false """ @@ -53,11 +56,13 @@ nextflow_process { input[0] = [ [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [], [] ] input[1] = [ [ id:'sarscov2' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ] input[2] = false """ @@ -80,11 +85,13 @@ nextflow_process { input[0] = [ [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [], [] ] input[1] = [ [ id:'sarscov2' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ] input[2] = true """ @@ -115,11 +122,13 @@ nextflow_process { input[0] = [ [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [], [] ] input[1] = [ [ id:'sarscov2' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ] input[2] = true """ @@ -135,19 +144,21 @@ nextflow_process { } } - test("sarscov2 - [bam, bed], fasta, false") { + test("sarscov2 - [bam, bed_mpileup], fasta, false") { when { process { """ - input[0] = [ + input[0] = channel.of([ [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) - ] + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true), + [] + ]) input[1] = [ [ id:'sarscov2' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ] input[2] = false """ @@ -167,21 +178,89 @@ nextflow_process { } } - test("sarscov2 - [bam, bed], fasta, false stub") { + test("sarscov2 - [bam, bed_call], fasta, false") { - options "-stub" + setup { + run("BCFTOOLS_QUERY") { + script "../../query/main.nf" + process { + """ + input[0] = channel.of([ + [id: "test", chr: "MT192765.1"], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists:true), + [] + ]) + input[1] = [] + input[2] = [] + input[3] = [] + """ + } + } + } when { process { """ - input[0] = [ + input[0] = channel.of([ [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + [] + ]).combine(BCFTOOLS_QUERY.out.output.map{meta, tsv -> [tsv]}) + input[1] = [ + [ id:'sarscov2' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ] + input[2] = false + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + path(process.out.vcf.get(0).get(1)).vcf.variantsMD5, + file(process.out.tbi[0][1]).name, + process.out.stats, + process.out.findAll { key, val -> key.startsWith("versions") } + ).match() } + ) + } + } + + test("sarscov2 - [bam, bed_mpileup, bed_call], fasta, false") { + + setup { + run("BCFTOOLS_QUERY") { + script "../../query/main.nf" + process { + """ + input[0] = channel.of([ + [id: "test", chr: "MT192765.1"], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists:true), + [] + ]) + input[1] = [] + input[2] = [] + input[3] = [] + """ + } + } + } + + when { + process { + """ + input[0] = channel.of([ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + ]).combine(BCFTOOLS_QUERY.out.output.map{meta, tsv -> [tsv]}) + .combine(BCFTOOLS_QUERY.out.output.map{meta, tsv -> [tsv]}) input[1] = [ [ id:'sarscov2' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ] input[2] = false """ @@ -191,7 +270,12 @@ nextflow_process { then { assert process.success assertAll( - { assert snapshot(process.out).match()} + { assert snapshot( + path(process.out.vcf.get(0).get(1)).vcf.variantsMD5, + file(process.out.tbi[0][1]).name, + process.out.stats, + process.out.findAll { key, val -> key.startsWith("versions") } + ).match() } ) } } diff --git a/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap b/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap index 806d18056d98..b7091f997939 100644 --- a/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap @@ -29,11 +29,11 @@ ] } ], + "timestamp": "2025-12-21T14:06:18.298267588", "meta": { "nf-test": "0.9.3", "nextflow": "25.10.2" - }, - "timestamp": "2025-12-21T14:06:18.298267588" + } }, "sarscov2 - [bam, []], fasta, false stub": { "content": [ @@ -118,13 +118,13 @@ ] } ], + "timestamp": "2025-12-22T09:01:23.428267089", "meta": { "nf-test": "0.9.3", "nextflow": "25.10.2" - }, - "timestamp": "2025-12-22T09:01:23.428267089" + } }, - "sarscov2 - [bam, bed], fasta, false": { + "sarscov2 - [bam, bed_mpileup], fasta, false": { "content": [ "7341fd584a827cddfc5f181a81ed5076", "test.vcf.gz.tbi", @@ -146,11 +146,11 @@ ] } ], + "timestamp": "2026-03-02T13:20:19.914560249", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2025-12-21T14:06:32.030402944" + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } }, "sarscov2 - [bam, []], fasta, true stub": { "content": [ @@ -235,86 +235,53 @@ ] } ], + "timestamp": "2025-12-22T09:01:37.014405367", "meta": { "nf-test": "0.9.3", "nextflow": "25.10.2" - }, - "timestamp": "2025-12-22T09:01:37.014405367" + } }, - "sarscov2 - [bam, bed], fasta, false stub": { + "sarscov2 - [bam, bed_mpileup, bed_call], fasta, false": { "content": [ + "c3e829c86ad6ce72945789383bb0108f", + "test.vcf.gz.tbi", + [ + [ + { + "id": "test" + }, + "test.bcftools_stats.txt:md5,163481111816620f6b76a5e96976e93a" + ] + ], { - "0": [ - [ - { - "id": "test" - }, - "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] - ], - "1": [ - [ - { - "id": "test" - }, - "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "2": [ - [ - { - "id": "test" - }, - "test.bcftools_stats.txt:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "3": [ - [ - { - "id": "test" - }, - "test.mpileup.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] - ], - "4": [ + "versions_bcftools": [ [ "BCFTOOLS_MPILEUP", "bcftools", "1.22" ] - ], - "mpileup": [ - [ - { - "id": "test" - }, - "test.mpileup.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] - ], - "stats": [ - [ - { - "id": "test" - }, - "test.bcftools_stats.txt:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "tbi": [ - [ - { - "id": "test" - }, - "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "vcf": [ - [ - { - "id": "test" - }, - "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] - ], + ] + } + ], + "timestamp": "2026-03-02T13:20:37.262876642", + "meta": { + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } + }, + "sarscov2 - [bam, bed_call], fasta, false": { + "content": [ + "46cbd80967ad92b1d603492e503e6a06", + "test.vcf.gz.tbi", + [ + [ + { + "id": "test" + }, + "test.bcftools_stats.txt:md5,6ae3528d5393335f19135bd0e39f80e8" + ] + ], + { "versions_bcftools": [ [ "BCFTOOLS_MPILEUP", @@ -324,11 +291,11 @@ ] } ], + "timestamp": "2026-02-27T17:05:45.469300576", "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2025-12-22T09:01:50.667461984" + "nextflow": "25.10.3" + } }, "sarscov2 - [bam, []], fasta, false": { "content": [ @@ -352,10 +319,10 @@ ] } ], + "timestamp": "2025-12-21T14:06:04.63975552", "meta": { "nf-test": "0.9.3", "nextflow": "25.10.2" - }, - "timestamp": "2025-12-21T14:06:04.63975552" + } } } \ No newline at end of file diff --git a/modules/nf-core/bcftools/mpileup/tests/nextflow.config b/modules/nf-core/bcftools/mpileup/tests/nextflow.config index e9cc0a0b4974..39b718cbb879 100644 --- a/modules/nf-core/bcftools/mpileup/tests/nextflow.config +++ b/modules/nf-core/bcftools/mpileup/tests/nextflow.config @@ -1,4 +1,10 @@ process { - ext.args2 = '--no-version --ploidy 1 --multiallelic-caller' - ext.args3 = '--no-version' + withName: "BCFTOOLS_MPILEUP" { + ext.args2 = '--no-version --ploidy 1 --multiallelic-caller' + ext.args3 = '--no-version' + } + + withName: "BCFTOOLS_QUERY" { + ext.args = "-f'%CHROM\t%POS\t%REF,%ALT\n'" + } } diff --git a/modules/nf-core/ngscheckmate/ncm/main.nf b/modules/nf-core/ngscheckmate/ncm/main.nf index 56e5d18fbab9..3c4ee39e56e6 100644 --- a/modules/nf-core/ngscheckmate/ncm/main.nf +++ b/modules/nf-core/ngscheckmate/ncm/main.nf @@ -9,7 +9,7 @@ process NGSCHECKMATE_NCM { input: tuple val(meta), path(files) tuple val(meta2), path(snp_bed) - tuple val(meta3), path(fasta) + tuple val(meta3), path(fasta), path(fai) output: tuple val(meta), path("*_corr_matrix.txt"), emit: corr_matrix diff --git a/modules/nf-core/ngscheckmate/ncm/meta.yml b/modules/nf-core/ngscheckmate/ncm/meta.yml index 176208e40705..ea031b4aa9a0 100644 --- a/modules/nf-core/ngscheckmate/ncm/meta.yml +++ b/modules/nf-core/ngscheckmate/ncm/meta.yml @@ -46,7 +46,12 @@ input: - fasta: type: file description: fasta file for the genome, only used in the bam mode - pattern: "*.{bed}" + pattern: "*.{fasta}" + ontologies: [] + - fai: + type: file + description: fasta index file for the genome, only used in the bam mode + pattern: "*.{fai}" ontologies: [] output: corr_matrix: diff --git a/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test b/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test index 525399ac67e9..65a0c1309777 100644 --- a/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test +++ b/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test @@ -20,10 +20,12 @@ nextflow_process { input[0] = [ [ id:'test1' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true), + [] ] input[1] = [ [ id:'sarscov2' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ] input[2] = false """ @@ -37,10 +39,12 @@ nextflow_process { input[0] = [ [ id:'test2' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true), + [] ] input[1] = [ [ id:'sarscov2' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ] input[2] = false """ @@ -49,7 +53,6 @@ nextflow_process { } - test("sarscov2 - bam") { config "./bam.config" when { @@ -68,7 +71,8 @@ nextflow_process { ] input[1] = Channel.of([ [id:'test_bed'], bed_file]) input[2] = [ [ id:'sarscov2' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ] """ } @@ -100,7 +104,8 @@ nextflow_process { input[0] = BCFTOOLS_MPILEUP1.out.vcf.combine(BCFTOOLS_MPILEUP2.out.vcf.map{it[1]}).map{meta, one, two -> [meta, [one, two]]}.map{meta, stuff -> [meta, stuff.flatten()]} input[1] = Channel.of([ [id:'test_bed'], bed_file]) input[2] = [ [ id:'sarscov2' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ] """ } @@ -139,7 +144,8 @@ nextflow_process { ] input[1] = [ [ id:'bed' ], []] input[2] = [ [ id:'sarscov2' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ] """ } @@ -162,10 +168,11 @@ nextflow_process { when { process { """ - input[0] = BCFTOOLS_MPILEUP1.out.vcf.combine(BCFTOOLS_MPILEUP2.out.vcf.map{it[1]}) + input[0] = BCFTOOLS_MPILEUP1.out.vcf.combine(BCFTOOLS_MPILEUP2.out.vcf.map{it[1]}).map{meta, one, two -> [meta, [one, two]]}.map{meta, stuff -> [meta, stuff.flatten()]} input[1] = [ [ id:'bed' ], []] input[2] = [ [ id:'sarscov2' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ] """ } diff --git a/modules/nf-core/ngscheckmate/ncm/tests/nextflow.config b/modules/nf-core/ngscheckmate/ncm/tests/nextflow.config index cf3d42a0e98e..0d50c161b7b9 100644 --- a/modules/nf-core/ngscheckmate/ncm/tests/nextflow.config +++ b/modules/nf-core/ngscheckmate/ncm/tests/nextflow.config @@ -1,8 +1,4 @@ process { - withName: BEDTOOLS_MAKEWINDOWS { - ext.args = '-w 1' - ext.prefix = 'test_split' - } withName: BCFTOOLS_MPILEUP1 { ext.args2 = '--no-version --ploidy 1 --multiallelic-caller' ext.args3 = '--no-version' diff --git a/modules/nf-core/ngscheckmate/ncm/tests/vcf.config b/modules/nf-core/ngscheckmate/ncm/tests/vcf.config index 67053c14dabc..c5f2543aa28e 100644 --- a/modules/nf-core/ngscheckmate/ncm/tests/vcf.config +++ b/modules/nf-core/ngscheckmate/ncm/tests/vcf.config @@ -1,5 +1,5 @@ - process { +process { withName: NGSCHECKMATE_NCM { ext.args = '-V' } - } +} diff --git a/subworkflows/nf-core/bam_ngscheckmate/main.nf b/subworkflows/nf-core/bam_ngscheckmate/main.nf index c68c1c9e9a99..71f3e7b12f92 100644 --- a/subworkflows/nf-core/bam_ngscheckmate/main.nf +++ b/subworkflows/nf-core/bam_ngscheckmate/main.nf @@ -6,13 +6,14 @@ workflow BAM_NGSCHECKMATE { take: ch_input // channel: [ val(meta1), bam/cram ] ch_snp_bed // channel: [ val(meta2), bed ] - ch_fasta // channel: [ val(meta3), fasta ] + ch_fasta // channel: [ val(meta3), fasta, fai ] main: - ch_input_bed = ch_input.combine(ch_snp_bed) - .map{ input_meta, input_file, _bed_meta, bed_file -> - [input_meta, input_file, bed_file] - } + ch_input_bed = ch_input + .combine(ch_snp_bed) + .map{ input_meta, input_file, _bed_meta, bed_file -> + [input_meta, input_file, bed_file, []] + } BCFTOOLS_MPILEUP (ch_input_bed, ch_fasta.collect(), false) diff --git a/subworkflows/nf-core/bam_ngscheckmate/meta.yml b/subworkflows/nf-core/bam_ngscheckmate/meta.yml index 7de0a114d404..ce45cbba2cea 100644 --- a/subworkflows/nf-core/bam_ngscheckmate/meta.yml +++ b/subworkflows/nf-core/bam_ngscheckmate/meta.yml @@ -37,6 +37,10 @@ input: type: file description: fasta file for the genome pattern: "*.{fasta}" + - fai: + type: file + description: fasta file index for the genome + pattern: "*.{fai}" output: - pdf: type: file diff --git a/subworkflows/nf-core/bam_ngscheckmate/tests/main.nf.test b/subworkflows/nf-core/bam_ngscheckmate/tests/main.nf.test index 9452ec104013..3f502a186002 100644 --- a/subworkflows/nf-core/bam_ngscheckmate/tests/main.nf.test +++ b/subworkflows/nf-core/bam_ngscheckmate/tests/main.nf.test @@ -35,7 +35,8 @@ nextflow_workflow { input[1] = Channel.of([ [id:'test_bed'], bed_file]) input[2] = Channel.of([ [ id:'sarscov2'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ]) """ } @@ -75,7 +76,8 @@ nextflow_workflow { input[1] = Channel.of([ [id:'test_bed'], bed_file]) input[2] = Channel.of([ [ id:'homo_sapiens'], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true), + [] ]) """ } @@ -118,7 +120,8 @@ nextflow_workflow { input[1] = Channel.of([ [id:'test_bed'], bed_file]) input[2] = Channel.of([ [ id:'sarscov2'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] ]) """ } diff --git a/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/main.nf b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/main.nf new file mode 100644 index 000000000000..e21cf57644bc --- /dev/null +++ b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/main.nf @@ -0,0 +1,111 @@ +include { BCFTOOLS_MPILEUP } from '../../../modules/nf-core/bcftools/mpileup' +include { BCFTOOLS_MERGE } from '../../../modules/nf-core/bcftools/merge' +include { BCFTOOLS_ANNOTATE } from '../../../modules/nf-core/bcftools/annotate' +include { VCF_GATHER_BCFTOOLS } from '../vcf_gather_bcftools' + +workflow BAM_VARIANT_CALLING_MPILEUP_BCFTOOLS { + + take: + ch_bam // channel: [ [id], bam, bai ] + ch_posfile // channel: [ [panel_id, chr], posfile_comma] + ch_fasta // channel: [ [genome], fasta, fai ] + meta_sample_merge_key // val : [ "id" ] + meta_sample_merge_value // val : [ "all_samples" ] + meta_region_gather_keys // val : [ "panel_id", "id" ] + sort_region_gather // val : boolean + annotate // val : boolean + + main: + ch_multiqc_files = channel.empty() + + ch_mpileup = ch_bam + .combine(ch_posfile) + .map{meta_bam, bam, _bai, meta_posfile, tsv -> + [meta_bam + meta_posfile, bam, tsv, tsv] + } + + def posfile_count = ch_posfile + .map{ _meta, posfile -> posfile} + .collect() + .map { posfile -> posfile.size() } + + BCFTOOLS_MPILEUP( + ch_mpileup, + ch_fasta, + false + ) + ch_multiqc_files = ch_multiqc_files.mix(BCFTOOLS_MPILEUP.out.stats.map{ _meta, stats -> stats }) + + // Branch depending on number of files + ch_all_vcf = BCFTOOLS_MPILEUP.out.vcf + .join(BCFTOOLS_MPILEUP.out.tbi) + .map{ meta, vcf, tbi -> // Get all keys except merge_key + def groupKeys = meta.keySet().findAll { key -> key != meta_sample_merge_key } + def groupMeta = meta.subMap(groupKeys) + [groupMeta, [meta, vcf, tbi]] + } + .groupTuple() + .view() + .map{ meta_group, filestups -> + // Assign meta_sample_merge_key to meta_sample_merge_value + [ + meta_group + [ + (meta_sample_merge_key): meta_sample_merge_value, + metas: filestups + .collect{ meta, _vcf, _index -> meta } + .sort() + ], + filestups.collect{_meta, vcf, _index -> vcf}, + filestups.collect{_meta, _vcf, index -> index}, + filestups.collect{_meta, vcf, _index -> vcf}.size() + ] + } + .branch{ _meta, _vcf, _index, size -> + single: size == 1 + multiple: size > 1 + } + + // Merge VCFs all individuals + BCFTOOLS_MERGE( + ch_all_vcf.multiple.map{ + meta, vcf_list, index_list, _size -> [ meta, vcf_list, index_list, [] ] + }, + ch_fasta + ) + + // Mix all vcfs + ch_to_concat = ch_all_vcf.single + .map{ meta, vcf_list, index_list, _size -> [ + meta, vcf_list[0], index_list[0] + ] } + .mix( + BCFTOOLS_MERGE.out.vcf + .join(BCFTOOLS_MERGE.out.index) + ) + + // Merge all chromosomes + VCF_GATHER_BCFTOOLS( + ch_to_concat.combine(posfile_count), + meta_region_gather_keys, + sort_region_gather + ) + + if (annotate) { + // Annotate the variants + BCFTOOLS_ANNOTATE(VCF_GATHER_BCFTOOLS.out.vcf_index + .combine(channel.of([[], [], [], [], []])) + ) + // Output + ch_output = BCFTOOLS_ANNOTATE.out.vcf + .join(BCFTOOLS_ANNOTATE.out.tbi.mix( + BCFTOOLS_ANNOTATE.out.csi + )) + } else { + // Output without annotation + ch_output = VCF_GATHER_BCFTOOLS.out.vcf_index + } + + emit: + vcf_index = ch_output // channel: [ [id, panel], vcf, index ] + multiqc_files = ch_multiqc_files +} diff --git a/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/meta.yml b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/meta.yml new file mode 100644 index 000000000000..c00f1f68fc80 --- /dev/null +++ b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/meta.yml @@ -0,0 +1,110 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "BAM_VARIANT_CALLING_MPILEUP_BCFTOOLS" +description: | + Subworkflow to compute genotype likelihoods from BAM files using + bcftools/mpileup and bcftools/call variants by chromosomes. + The resulting VCF files are then merged by chromosomes and + annotated with bcftools/annotate to give an ID for each variants. + During samples merging and region concatenation, all metadata will + be preserved and stored in the key `metas` at each step. +keywords: + - BAM + - genotype likelihoods + - bcftools +components: + - gawk + - tabix/bgzip + - bcftools/mpileup + - bcftools/merge + - bcftools/annotate + - bcftools/concat + - vcf_gather_bcftools +input: + - ch_bam: + description: Channel with input data + structure: + - meta: + type: map + description: Metadata map + - bam: + type: file + description: Input BAM file + pattern: "*.bam" + - index: + type: file + description: Input BAM index file + pattern: "*.{bai,csi}" + - ch_posfile: + description: Channel with position to call variants by chromosomes + structure: + - meta: + type: map + description: | + Metadata map that will be combined with the input data map + - posfile: + type: file + description: Region to extract from the BAM file in the format + "CHR\tPOS\tREF,ALT" + - ch_fasta: + description: Channel with reference genome data + structure: + - meta: + type: map + description: Metadata map + - fasta: + type: file + description: FASTA file of the reference genome + pattern: "*.fa[sta]+" + - fai: + type: file + description: FASTA index file of the reference genome + pattern: "*.fai" + - meta_sample_merge_key: + type: list + description: | + List of keys that define the sample. + All file sharing the same values for these keys will be merged together. + e.g. [ "id" ] + - meta_sample_merge_value: + description: | + Shared value that will be set to `meta_sample_merge_key` for all samples to be merged together. + e.g. "all_samples" + - meta_region_gather_keys: + type: list + description: | + List of keys to be used to gather the VCF files by region with vcf_gather_bcftools. + All file sharing the same values for these keys will be gathered together. + e.g. [ "id", "panel_id" ] + - sort_region_gather: + type: boolean + description: | + Whether to sort the VCF files by region after concatenation with + vcf_gather_bcftools. + - annotate: + type: boolean + description: | + Whether to annotate the merged VCF file with bcftools/annotate to give + an ID for each variants +output: + - multiqc_files: + description: Channel containing stat files of bcftools mpileup and call + type: file + - vcf_index: + description: Channel with one VCF files by chromosomes + structure: + - meta: + type: map + description: | + Metadata map combined with the ch_posfile data map. + - vcf: + type: file + description: VCF file with all individuals merged by chromosomes + pattern: "*.{vcf,bcf,vcf.gz}" + - index: + type: file + description: VCF index file + pattern: "*.{tbi,csi}" +authors: + - "@louislenezet" +maintainers: + - "@louislenezet" diff --git a/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test new file mode 100644 index 000000000000..27fdc93b8366 --- /dev/null +++ b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test @@ -0,0 +1,215 @@ +nextflow_workflow { + + name "Test Subworkflow BAM_VARIANT_CALLING_MPILEUP_BCFTOOLS" + script "../main.nf" + config "./nextflow.config" + + workflow "BAM_VARIANT_CALLING_MPILEUP_BCFTOOLS" + + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/bam_variant_calling_mpileup_bcftools" + tag "subworkflows/vcf_gather_bcftools" + tag "bam_variant_calling_mpileup_bcftools" + tag "vcf_gather_bcftools" + + tag "gawk" + tag "tabix" + tag "tabix/bgzip" + tag "bcftools" + tag "bcftools/mpileup" + tag "bcftools/annotate" + tag "bcftools/merge" + tag "bcftools/concat" + + test("Two individuals and two chromosomes, sort and annotate") { + setup { // Change CHR\tPOS\tREF\tALT to CHR\tPOS\tREF,tALT + run("GAWK") { + script "../../../../modules/nf-core/gawk/main.nf" + process { + """ + input[0] = channel.of([ + [panel_id: "1000GP", chr: "22"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/1000GP.chr22.posfile', checkIfExists:true) + ], [ + [panel_id: "1000GP", chr: "21"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/1000GP.chr21.posfile', checkIfExists:true) + ]) + input[1] = [] + input[2] = false + """ + } + } + } + + when { + workflow { + """ + input[0] = channel.of([ + [id: "NA12878"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam', checkIfExists:true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam.bai', checkIfExists:true), + ], [ + [id: "NA19401"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/NA19401.chr21_22.1X.bam', checkIfExists:true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/NA19401.chr21_22.1X.bam.bai', checkIfExists:true), + ]) + input[1] = GAWK.out.output + input[2] = channel.of([ + [id: "GRCh38"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genomeGRCh38_chr21_22.fa.gz', checkIfExists:true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genomeGRCh38_chr21_22.fa.gz.fai', checkIfExists:true), + ]).collect() + input[3] = "id" + input[4] = "all_samples" + input[5] = ["panel_id", "id"] + input[6] = true + input[7] = true + """ + } + } + + then { + assert workflow.success + assert snapshot( + workflow.out.vcf_index.collect{ meta, vcf, index -> + def metaForSnapshot = meta.findAll { key, value -> key != 'metas' } + // Add a deterministic count instead of the full metas list + if (meta.metas) { + metaForSnapshot.metas_count = meta.metas.size() + } + [ + metaForSnapshot, + path(vcf).getFileName().toString(), + path(vcf).vcf.summary, // Two individuals and 1739 variants + path(vcf).vcf.variantsMD5, + path(index).getFileName().toString() + ] }, + workflow.out.multiqc_files + ).match() + } + } + + test("One individual and one chromosome") { + setup { + run("GAWK") { + script "../../../../modules/nf-core/gawk/main.nf" + process { + """ + input[0] = channel.of([ + [panel_id: "1000GP", chr: "22"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/1000GP.chr22.posfile', checkIfExists:true) + ]) + input[1] = [] + input[2] = false + """ + } + } + } + when { + workflow { + """ + input[0] = channel.of([ + [id: "NA12878"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam', checkIfExists:true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam.bai', checkIfExists:true), + ]) + input[1] = GAWK.out.output + input[2] = channel.of([ + [id: "GRCh38"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genomeGRCh38_chr21_22.fa.gz', checkIfExists:true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genomeGRCh38_chr21_22.fa.gz.fai', checkIfExists:true), + ]).collect() + input[3] = "id" + input[4] = "all_samples" + input[5] = ["panel_id", "id"] + input[6] = false + input[7] = false + """ + } + } + + then { + assert workflow.success + assert snapshot( + workflow.out.vcf_index.collect{ meta, vcf, index -> + def metaForSnapshot = meta.findAll { key, value -> key != 'metas' } + // Add a deterministic count instead of the full metas list + if (meta.metas) { + metaForSnapshot.metas_count = meta.metas.size() + } + [ + metaForSnapshot, + path(vcf).getFileName().toString(), + path(vcf).vcf.summary, // One individuals and 902 variants + path(vcf).vcf.variantsMD5, + path(index).getFileName().toString() + ] }, + workflow.out.multiqc_files + ).match() + } + } + + test("One individual and two chromosomes") { + setup { + run("GAWK") { + script "../../../../modules/nf-core/gawk/main.nf" + process { + """ + input[0] = channel.of([ + [panel_id: "1000GP", chr: "22"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/1000GP.chr22.posfile', checkIfExists:true) + ], [ + [panel_id: "1000GP", chr: "21"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/1000GP.chr21.posfile', checkIfExists:true) + ]) + input[1] = [] + input[2] = false + """ + } + } + } + when { + workflow { + """ + input[0] = channel.of([ + [id: "NA12878"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam', checkIfExists:true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam.bai', checkIfExists:true), + ]) + input[1] = GAWK.out.output + input[2] = channel.of([ + [id: "GRCh38"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genomeGRCh38_chr21_22.fa.gz', checkIfExists:true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genomeGRCh38_chr21_22.fa.gz.fai', checkIfExists:true), + ]).collect() + input[3] = "id" + input[4] = "all_samples" + input[5] = ["panel_id", "id"] + input[6] = false + input[7] = false + """ + } + } + + then { + assert workflow.success + assert snapshot( + workflow.out.vcf_index.collect{ meta, vcf, index -> + def metaForSnapshot = meta.findAll { key, value -> key != 'metas' } + // Add a deterministic count instead of the full metas list + if (meta.metas) { + metaForSnapshot.metas_count = meta.metas.size() + } + [ + metaForSnapshot, + path(vcf).getFileName().toString(), + path(vcf).vcf.summary, // One individuals and 1737 variants + path(vcf).vcf.variantsMD5, + path(index).getFileName().toString() + ] }, + workflow.out.multiqc_files + ).match() + } + } +} diff --git a/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test.snap b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test.snap new file mode 100644 index 000000000000..505389781c8e --- /dev/null +++ b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test.snap @@ -0,0 +1,81 @@ +{ + "One individual and one chromosome": { + "content": [ + [ + [ + { + "panel_id": "1000GP", + "id": "all_samples", + "metas_count": 1 + }, + "NA12878_22.vcf.gz", + "VcfFile [chromosomes=[chr22], sampleCount=1, variantCount=902, phased=false, phasedAutodetect=false]", + "b852b1cae943360e00ab93004509808a", + "NA12878_22.vcf.gz.tbi" + ] + ], + [ + "NA12878_22.bcftools_stats.txt:md5,e35386eaea9c0047d0c9ce56ae966d10" + ] + ], + "timestamp": "2026-02-27T18:26:40.379067986", + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + } + }, + "Two individuals and two chromosomes, sort and annotate": { + "content": [ + [ + [ + { + "panel_id": "1000GP", + "id": "all_samples", + "metas_count": 2 + }, + "all_samples_all_chr.annotate.vcf.gz", + "VcfFile [chromosomes=[chr21, chr22], sampleCount=2, variantCount=1737, phased=false, phasedAutodetect=false]", + "96e0517b17306ab297c8ac87d753d4d9", + "all_samples_all_chr.annotate.vcf.gz.tbi" + ] + ], + [ + "NA12878_21.bcftools_stats.txt:md5,29f310e5ed86cc2d3f6f77eb5da2a7e0", + "NA12878_22.bcftools_stats.txt:md5,e35386eaea9c0047d0c9ce56ae966d10", + "NA19401_21.bcftools_stats.txt:md5,16730f1e8df6e0446ed2779d87c98168", + "NA19401_22.bcftools_stats.txt:md5,e9b457859517dcfaf886335cbbe442b3" + ] + ], + "timestamp": "2026-03-02T13:24:14.07373231", + "meta": { + "nf-test": "0.9.4", + "nextflow": "25.10.4" + } + }, + "One individual and two chromosomes": { + "content": [ + [ + [ + { + "panel_id": "1000GP", + "id": "all_samples", + "metas_count": 2 + }, + "all_samples_all_chr.concat.vcf.gz", + "VcfFile [chromosomes=[chr21, chr22], sampleCount=1, variantCount=1737, phased=false, phasedAutodetect=false]", + "2e125158b5531e9325cc00f004cebeeb", + "all_samples_all_chr.concat.vcf.gz.tbi" + ] + ], + [ + "NA12878_21.bcftools_stats.txt:md5,29f310e5ed86cc2d3f6f77eb5da2a7e0", + "NA12878_22.bcftools_stats.txt:md5,e35386eaea9c0047d0c9ce56ae966d10" + ] + ], + "timestamp": "2026-02-27T18:26:57.619510735", + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.3" + } + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/nextflow.config b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/nextflow.config new file mode 100644 index 000000000000..fcf1ad2e65b1 --- /dev/null +++ b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/nextflow.config @@ -0,0 +1,28 @@ +process { + withName: GAWK { + ext.args2 = "'BEGIN { OFS=\"\\t\" } NR>1 { split(\$1, a, \"[:-_]\"); print a[1], \$2, \$3\",\"\$4 }'" + ext.prefix = { "${meta.panel_id}.${meta.chr}.posfile.comma" } + ext.suffix = "txt" + } + + withName: BCFTOOLS_MPILEUP { + ext.args = "-I -E -a 'FORMAT/DP'" + ext.args2 = "-Aim -C alleles" + ext.prefix = { "${meta.id}_${meta.chr}" } + } + + withName: BCFTOOLS_MERGE { + ext.args = "--write-index=tbi --output-type z" + ext.prefix = { "${meta.id}_${meta.chr}" } + } + + withName: BCFTOOLS_CONCAT { + ext.args = ["--ligate", "-Oz", "--write-index=tbi"].join(' ') + ext.prefix = { "${meta.id}_all_chr.concat" } + } + + withName: BCFTOOLS_ANNOTATE { + ext.args = ["--set-id '%CHROM:%POS:%REF:%ALT'", "-Oz", "--write-index=tbi"].join(' ') + ext.prefix = { "${meta.id}_all_chr.annotate" } + } +} diff --git a/subworkflows/nf-core/vcf_extract_relate_somalier/tests/main.nf.test b/subworkflows/nf-core/vcf_extract_relate_somalier/tests/main.nf.test index 119fd7efffbc..fe71eda43c70 100644 --- a/subworkflows/nf-core/vcf_extract_relate_somalier/tests/main.nf.test +++ b/subworkflows/nf-core/vcf_extract_relate_somalier/tests/main.nf.test @@ -210,11 +210,10 @@ nextflow_workflow { [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/NA12878_GIAB.chr21_22.vcf.gz.csi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/NA24385_sv.vcf.gz.tbi', checkIfExists: true) - ] + ], + [] ]) - input[1] = [[], []] - input[2] = [[], []] - input[3] = [[], []] + input[1] = [[], [], []] """ } }