From bb3ec8984b4c5fb8180ac485cb45c16b7be98797 Mon Sep 17 00:00:00 2001 From: Felix Lenner Date: Fri, 14 Feb 2025 07:53:15 +0000 Subject: [PATCH 01/12] Add output index type to samtools view --- modules/nf-core/samtools/view/main.nf | 36 +- .../samtools/view/tests/cram_index.config | 3 + .../nf-core/samtools/view/tests/main.nf.test | 249 ++++++ .../samtools/view/tests/main.nf.test.snap | 724 ++++++++++++++---- 4 files changed, 867 insertions(+), 145 deletions(-) create mode 100644 modules/nf-core/samtools/view/tests/cram_index.config diff --git a/modules/nf-core/samtools/view/main.nf b/modules/nf-core/samtools/view/main.nf index a6941e63888..3aa8f83c8ea 100644 --- a/modules/nf-core/samtools/view/main.nf +++ b/modules/nf-core/samtools/view/main.nf @@ -11,6 +11,7 @@ process SAMTOOLS_VIEW { tuple val(meta), path(input), path(index) tuple val(meta2), path(fasta) path qname + val index_format output: tuple val(meta), path("${prefix}.bam"), emit: bam, optional: true @@ -20,7 +21,7 @@ process SAMTOOLS_VIEW { tuple val(meta), path("${prefix}.${file_type}.csi"), emit: csi, optional: true tuple val(meta), path("${prefix}.${file_type}.crai"), emit: crai, optional: true tuple val(meta), path("${prefix}.unselected.${file_type}"), emit: unselected, optional: true - tuple val(meta), path("${prefix}.unselected.${file_type}.{bai,csi,crsi}"), emit: unselected_index, optional: true + tuple val(meta), path("${prefix}.unselected.${file_type}.{csi,crai}"), emit: unselected_index, optional: true path "versions.yml", emit: versions when: @@ -35,8 +36,19 @@ process SAMTOOLS_VIEW { args.contains("--output-fmt bam") ? "bam" : args.contains("--output-fmt cram") ? "cram" : input.getExtension() + + output_file = index_format ? "${prefix}.${file_type}##idx##${prefix}.${file_type}.${index_format}" : "${prefix}.${file_type}" + // Can't choose index type of unselected file readnames = qname ? "--qname-file ${qname} --output-unselected ${prefix}.unselected.${file_type}": "" + if ("$input" == "${prefix}.${file_type}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + if (index_format) { + if (!index_format.matches('bai|csi|crai')) { + error "Index format not one of bai, csi, crai." + } else if (file_type == "sam") { + error "Indexing not compatible with SAM output" + } + } """ samtools \\ view \\ @@ -44,7 +56,7 @@ process SAMTOOLS_VIEW { ${reference} \\ ${readnames} \\ $args \\ - -o ${prefix}.${file_type} \\ + -o ${output_file} \\ $input \\ $args2 @@ -61,13 +73,27 @@ process SAMTOOLS_VIEW { args.contains("--output-fmt bam") ? "bam" : args.contains("--output-fmt cram") ? "cram" : input.getExtension() - if ("$input" == "${prefix}.${file_type}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" - - index = args.contains("--write-index") ? "touch ${prefix}.${file_type}.csi" : "" + default_index_format = + file_type == "bam" ? "csi" : + file_type == "cram" ? "crai" : "" + index = args.contains("--write-index") && index_format ? "touch ${prefix}.${file_type}.${index_format}" : args.contains("--write-index") ? "touch ${prefix}.${file_type}.${default_index_format}" : "" + unselected = qname ? "touch ${prefix}.unselected.${file_type}" : "" + // Can't choose index type of unselected file + unselected_index = qname && args.contains("--write-index") ? "touch ${prefix}.unselected.${file_type}.${default_index_format}" : "" + if ("$input" == "${prefix}.${file_type}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" + if (index_format) { + if (!index_format.matches('bai|csi|crai')) { + error "Index format not one of bai, csi, crai." + } else if (file_type == "sam") { + error "Indexing not compatible with SAM output." + } + } """ touch ${prefix}.${file_type} ${index} + ${unselected} + ${unselected_index} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/samtools/view/tests/cram_index.config b/modules/nf-core/samtools/view/tests/cram_index.config new file mode 100644 index 00000000000..ed87c3349db --- /dev/null +++ b/modules/nf-core/samtools/view/tests/cram_index.config @@ -0,0 +1,3 @@ +process { + ext.args = "--output-fmt cram --write-index" +} diff --git a/modules/nf-core/samtools/view/tests/main.nf.test b/modules/nf-core/samtools/view/tests/main.nf.test index 37b81a91630..d8551dd8c6b 100644 --- a/modules/nf-core/samtools/view/tests/main.nf.test +++ b/modules/nf-core/samtools/view/tests/main.nf.test @@ -21,6 +21,7 @@ nextflow_process { ]) input[1] = [[],[]] input[2] = [] + input[3] = [] """ } } @@ -39,6 +40,135 @@ nextflow_process { } } + test("bam_csi_index") { + + config "./bam_index.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [] + ]) + input[1] = [[],[]] + input[2] = [] + input[3] = 'csi' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + file(process.out.csi[0][1]).name, + process.out.versions).match() + } + ) + } + } + + test("bam_bai_index") { + + config "./bam_index.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [] + ]) + input[1] = [[],[]] + input[2] = [] + input[3] = 'bai' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + file(process.out.bai[0][1]).name, + process.out.versions).match() } + ) + } + } + + test("bam_bai_index_unselected") { + + config "./bam_index.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [] + ]) + input[1] = [[],[]] + input[2] = Channel.of('testN:1') + .collectFile(name: 'selected_reads.txt') + input[3] = 'bai' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.bam[0][1]).name, + file(process.out.bai[0][1]).name, + file(process.out.unselected[0][1]).name, + file(process.out.unselected_index[0][1]).name, + process.out.versions).match() + } + ) + } + } + + test("cram_crai_index_unselected") { + + config "./cram_index.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [] + ]) + input[1] = [[],[]] + input[2] = Channel.of('testN:1') + .collectFile(name: 'selected_reads.txt') + input[3] = 'crai' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.cram[0][1]).name, + file(process.out.crai[0][1]).name, + file(process.out.unselected[0][1]).name, + file(process.out.unselected_index[0][1]).name, + process.out.versions).match() + } + ) + } + } + test("cram") { when { @@ -54,6 +184,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]) input[2] = [] + input[3] = [] """ } } @@ -89,6 +220,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]) input[2] = [] + input[3] = [] """ } } @@ -124,6 +256,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]) input[2] = [] + input[3] = [] """ } } @@ -159,6 +292,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]) input[2] = Channel.of("testN:2817", "testN:2814").collectFile(name: "readnames.list", newLine: true) + input[3] = [] """ } } @@ -194,6 +328,7 @@ nextflow_process { ]) input[1] = [[],[]] input[2] = [] + input[3] = [] """ } } @@ -211,4 +346,118 @@ nextflow_process { ) } } + + test("bam_csi_index - stub") { + + options "-stub" + config "./bam_index.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [] + ]) + input[1] = [[],[]] + input[2] = [] + input[3] = 'csi' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("bam_bai_index - stub") { + + options "-stub" + config "./bam_index.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [] + ]) + input[1] = [[],[]] + input[2] = [] + input[3] = 'bai' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("bam_bai_index_uselected - stub") { + + options "-stub" + config "./bam_index.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [] + ]) + input[1] = [[],[]] + input[2] = Channel.of('testN:1') + .collectFile(name: 'selected_reads.txt') + input[3] = 'bai' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("cram_crai_index_unselected - stub") { + + options "-stub" + config "./cram_index.config" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [] + ]) + input[1] = [[],[]] + input[2] = Channel.of('testN:1') + .collectFile(name: 'selected_reads.txt') + input[3] = 'crai' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } diff --git a/modules/nf-core/samtools/view/tests/main.nf.test.snap b/modules/nf-core/samtools/view/tests/main.nf.test.snap index 63849b037b7..1cb793f2700 100644 --- a/modules/nf-core/samtools/view/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/view/tests/main.nf.test.snap @@ -9,16 +9,6 @@ }, "timestamp": "2024-02-12T19:37:51.256068" }, - "cram_to_bam_index_csi": { - "content": [ - "test.bam.csi" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" - }, - "timestamp": "2024-02-12T19:38:12.958617" - }, "bam_stub_bam": { "content": [ "test.bam" @@ -60,36 +50,32 @@ ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.3" }, - "timestamp": "2024-09-16T09:26:24.461775464" + "timestamp": "2025-02-14T07:43:43.6526401" }, - "cram_to_bam_index_cram": { + "cram_to_bam_index_qname_csi": { "content": [ - [ - - ] + "test.bam.csi" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:12.972288" + "timestamp": "2024-02-12T19:38:23.325496" }, - "cram_to_bam_sam": { + "cram_to_bam_index_qname_unselected_csi": { "content": [ - [ - - ] + "test.unselected.bam.csi" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:04.999247" + "timestamp": "2024-02-12T19:38:23.328458" }, - "cram_to_bam_index_sam": { + "bam_csi": { "content": [ [ @@ -99,55 +85,182 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:12.976457" + "timestamp": "2024-02-12T19:37:51.262882" }, - "cram_crai": { + "cram_to_bam_index_bam": { "content": [ - [ - - ] + "test.bam" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:37:56.497581" + "timestamp": "2024-02-12T19:38:12.95456" }, - "cram_csi": { + "cram_to_bam_index_versions": { "content": [ [ - + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-12T19:37:56.50038" + "timestamp": "2024-09-16T09:25:14.475388399" }, - "cram_to_bam_cram": { + "bam_csi_index": { "content": [ + "test.bam", + "test.bam.csi", [ - + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.2", + "nextflow": "24.10.3" }, - "timestamp": "2024-02-12T19:38:04.992239" + "timestamp": "2025-02-14T07:45:19.718077276" }, - "cram_to_bam_index_qname_csi": { + "bam_versions": { "content": [ - "test.bam.csi" + [ + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-02-13T16:13:00.739468586" + }, + "cram_crai_index_unselected - stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.unselected.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.unselected.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ], + "bai": [ + + ], + "bam": [ + + ], + "crai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "cram": [ + [ + { + "id": "test", + "single_end": false + }, + "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "csi": [ + + ], + "sam": [ + + ], + "unselected": [ + [ + { + "id": "test", + "single_end": false + }, + "test.unselected.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "unselected_index": [ + [ + { + "id": "test", + "single_end": false + }, + "test.unselected.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-02-14T07:47:20.903462221" + }, + "bam_crai": { + "content": [ + [ + + ] ], "meta": { "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:23.325496" + "timestamp": "2024-02-12T19:37:51.259774" }, - "bam_stub_sam": { + "bam_cram": { "content": [ [ @@ -157,29 +270,33 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:32.079529" + "timestamp": "2024-02-12T19:37:51.261287" }, - "cram_cram": { + "cram_sam": { "content": [ - "test.cram" + [ + + ] ], "meta": { "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:37:56.490286" + "timestamp": "2024-02-12T19:37:56.502625" }, - "cram_to_bam_index_qname_unselected_csi": { + "cram_versions": { "content": [ - "test.unselected.bam.csi" + [ + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.2", + "nextflow": "24.10.3" }, - "timestamp": "2024-02-12T19:38:23.328458" + "timestamp": "2025-02-13T16:33:28.319991831" }, - "bam_csi": { + "cram_to_bam_index_bai": { "content": [ [ @@ -189,9 +306,9 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:37:51.262882" + "timestamp": "2024-02-12T19:38:12.962863" }, - "cram_to_bam_crai": { + "cram_to_bam_index_qname_sam": { "content": [ [ @@ -201,65 +318,247 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:04.989247" + "timestamp": "2024-02-12T19:38:23.337634" }, - "cram_to_bam_index_crai": { + "bam_csi_index - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "5": [ + + ], + "6": [ + + ], + "7": [ + + ], + "8": [ + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ], + "bai": [ + + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "crai": [ + + ], + "cram": [ + + ], + "csi": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "sam": [ + + ], + "unselected": [ + + ], + "unselected_index": [ + + ], + "versions": [ + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-02-14T07:46:52.477256747" + }, + "cram_to_bam_index_csi": { "content": [ - [ - - ] + "test.bam.csi" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:12.967681" + "timestamp": "2024-02-12T19:38:12.958617" }, - "cram_to_bam_index_qname_versions": { + "bam_bai_index": { "content": [ + "test.bam", + "test.bam.bai", [ "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.3" }, - "timestamp": "2024-09-16T09:25:51.953436682" + "timestamp": "2025-02-14T07:45:29.205677197" }, - "cram_to_bam_bam": { + "cram_to_bam_index_cram": { "content": [ - "test.bam" + [ + + ] ], "meta": { "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:04.982361" + "timestamp": "2024-02-12T19:38:12.972288" }, - "cram_to_bam_index_bam": { + "bam_bai_index - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + + ], + "7": [ + + ], + "8": [ + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "crai": [ + + ], + "cram": [ + + ], + "csi": [ + + ], + "sam": [ + + ], + "unselected": [ + + ], + "unselected_index": [ + + ], + "versions": [ + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-02-14T07:51:10.220507926" + }, + "cram_to_bam_sam": { "content": [ - "test.bam" + [ + + ] ], "meta": { "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:12.95456" + "timestamp": "2024-02-12T19:38:04.999247" }, - "cram_to_bam_index_versions": { + "cram_to_bam_index_sam": { "content": [ [ - "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.8.4", + "nextflow": "23.04.3" }, - "timestamp": "2024-09-16T09:25:14.475388399" + "timestamp": "2024-02-12T19:38:12.976457" }, - "cram_to_bam_bai": { + "cram_crai": { "content": [ [ @@ -269,21 +568,21 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:04.98601" + "timestamp": "2024-02-12T19:37:56.497581" }, - "cram_to_bam_versions": { + "cram_csi": { "content": [ [ - "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.8.4", + "nextflow": "23.04.3" }, - "timestamp": "2024-09-16T09:24:49.673441798" + "timestamp": "2024-02-12T19:37:56.50038" }, - "cram_bam": { + "cram_to_bam_cram": { "content": [ [ @@ -293,9 +592,9 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:37:56.495512" + "timestamp": "2024-02-12T19:38:04.992239" }, - "bam_stub_cram": { + "bam_stub_sam": { "content": [ [ @@ -305,21 +604,19 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:32.076908" + "timestamp": "2024-02-12T19:38:32.079529" }, - "cram_to_bam_index_qname_bai": { + "cram_cram": { "content": [ - [ - - ] + "test.cram" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:23.328458" + "timestamp": "2024-02-12T19:37:56.490286" }, - "cram_to_bam_index_qname_crai": { + "cram_to_bam_crai": { "content": [ [ @@ -329,9 +626,9 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:23.330789" + "timestamp": "2024-02-12T19:38:04.989247" }, - "cram_bai": { + "cram_to_bam_index_crai": { "content": [ [ @@ -341,63 +638,71 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:37:56.493129" + "timestamp": "2024-02-12T19:38:12.967681" }, - "bam_stub_crai": { + "cram_crai_index_unselected": { "content": [ + "test.cram", + "test.cram.crai", + "test.unselected.cram", + "test.unselected.cram.crai", [ - + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.2", + "nextflow": "24.10.3" }, - "timestamp": "2024-02-12T19:38:32.074313" + "timestamp": "2025-02-14T07:45:48.461930073" }, - "cram_to_bam_index_qname_bam": { + "cram_to_bam_index_qname_versions": { "content": [ - "test.bam" + [ + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-12T19:38:23.322874" + "timestamp": "2024-09-16T09:25:51.953436682" }, - "cram_to_bam_index_qname_unselected": { + "cram_to_bam_bam": { "content": [ - "test.unselected.bam" + "test.bam" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:23.322874" + "timestamp": "2024-02-12T19:38:04.982361" }, - "cram_to_bam_index_qname_unselected_csi": { + "cram_to_bam_bai": { "content": [ - "test.unselected.bam.csi" + [ + + ] ], "meta": { "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:23.328458" + "timestamp": "2024-02-12T19:38:04.98601" }, - "bam_versions": { + "cram_to_bam_versions": { "content": [ [ "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.3" }, - "timestamp": "2024-09-16T09:23:27.151650338" + "timestamp": "2025-02-13T16:33:39.363718229" }, - "cram_to_bam_index_qname_cram": { + "cram_bam": { "content": [ [ @@ -407,9 +712,9 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:23.333248" + "timestamp": "2024-02-12T19:37:56.495512" }, - "bam_crai": { + "bam_stub_cram": { "content": [ [ @@ -419,9 +724,9 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:37:51.259774" + "timestamp": "2024-02-12T19:38:32.076908" }, - "bam_cram": { + "cram_to_bam_index_qname_bai": { "content": [ [ @@ -431,9 +736,9 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:37:51.261287" + "timestamp": "2024-02-12T19:38:23.328458" }, - "cram_to_bam_csi": { + "cram_to_bam_index_qname_crai": { "content": [ [ @@ -443,9 +748,9 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:04.995454" + "timestamp": "2024-02-12T19:38:23.330789" }, - "cram_sam": { + "cram_bai": { "content": [ [ @@ -455,23 +760,23 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:37:56.502625" + "timestamp": "2024-02-12T19:37:56.493129" }, - "cram_versions": { + "bam_stub_crai": { "content": [ [ - "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.8.4", + "nextflow": "23.04.3" }, - "timestamp": "2024-09-16T09:24:12.95416913" + "timestamp": "2024-02-12T19:38:32.074313" }, - "cram_to_bam_index_qname_unselected": { + "cram_to_bam_index_qname_bam": { "content": [ - "test.unselected.bam" + "test.bam" ], "meta": { "nf-test": "0.8.4", @@ -479,7 +784,23 @@ }, "timestamp": "2024-02-12T19:38:23.322874" }, - "bam_sam": { + "bam_bai_index_unselected": { + "content": [ + "test.bam", + "test.bam.bai", + "test.unselected.bam", + "test.unselected.bam.csi", + [ + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-02-14T07:45:38.993014707" + }, + "cram_to_bam_index_qname_cram": { "content": [ [ @@ -489,9 +810,9 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:37:51.264651" + "timestamp": "2024-02-12T19:38:23.333248" }, - "cram_to_bam_index_bai": { + "cram_to_bam_csi": { "content": [ [ @@ -501,9 +822,132 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:12.962863" + "timestamp": "2024-02-12T19:38:04.995454" }, - "cram_to_bam_index_qname_sam": { + "bam_bai_index_uselected - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.unselected.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.unselected.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "crai": [ + + ], + "cram": [ + + ], + "csi": [ + + ], + "sam": [ + + ], + "unselected": [ + [ + { + "id": "test", + "single_end": false + }, + "test.unselected.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "unselected_index": [ + [ + { + "id": "test", + "single_end": false + }, + "test.unselected.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,176db5ec46b965219604bcdbb3ef9e07" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-02-14T07:51:24.947216832" + }, + "cram_to_bam_index_qname_unselected": { + "content": [ + "test.unselected.bam" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.04.3" + }, + "timestamp": "2024-02-12T19:38:23.322874" + }, + "bam_sam": { "content": [ [ @@ -513,7 +957,7 @@ "nf-test": "0.8.4", "nextflow": "23.04.3" }, - "timestamp": "2024-02-12T19:38:23.337634" + "timestamp": "2024-02-12T19:37:51.264651" }, "bam_stub_csi": { "content": [ From ca0e2d98798f3dab538a57c21c0049da688ea58b Mon Sep 17 00:00:00 2001 From: Felix Lenner Date: Fri, 14 Feb 2025 08:05:58 +0000 Subject: [PATCH 02/12] fix modules/subworkflows with samtools view --- modules/nf-core/yahs/tests/main.nf.test | 5 +++-- subworkflows/nf-core/bam_split_by_region/main.nf | 2 +- subworkflows/nf-core/bam_subsampledepth_samtools/main.nf | 1 + .../nf-core/fastq_create_umi_consensus_fgbio/main.nf | 2 +- tests/modules/nf-core/endorspy/main.nf | 8 ++++---- tests/modules/nf-core/graphtyper/genotype/main.nf | 6 +++--- tests/modules/nf-core/leehom/main.nf | 2 +- tests/modules/nf-core/metaphlan3/metaphlan3/main.nf | 2 +- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/modules/nf-core/yahs/tests/main.nf.test b/modules/nf-core/yahs/tests/main.nf.test index ee53a110d92..27572cb21f4 100644 --- a/modules/nf-core/yahs/tests/main.nf.test +++ b/modules/nf-core/yahs/tests/main.nf.test @@ -26,13 +26,14 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]) input[2] = [] + input[3] = [] """ } } } test("homo_sapiens-bam-fasta-fai") { - + when { process { """ @@ -50,5 +51,5 @@ nextflow_process { ) } } - + } diff --git a/subworkflows/nf-core/bam_split_by_region/main.nf b/subworkflows/nf-core/bam_split_by_region/main.nf index 82b00f3ce4c..71b4d01c4e3 100644 --- a/subworkflows/nf-core/bam_split_by_region/main.nf +++ b/subworkflows/nf-core/bam_split_by_region/main.nf @@ -45,7 +45,7 @@ workflow BAM_SPLIT_BY_REGION { .map{ meta, bam, bai, regions, chrom -> [ meta + [ genomic_region:chrom ], bam, bai ] } // The specified region is put into ext.args2 from the meta. See nextflow.config of the subworkflow. - SAMTOOLS_VIEW(ch_bam_for_splitting, [[],[]], []) + SAMTOOLS_VIEW(ch_bam_for_splitting, [[],[]], [], []) ch_versions = ch_versions.mix(SAMTOOLS_VIEW.out.versions.first()) // diff --git a/subworkflows/nf-core/bam_subsampledepth_samtools/main.nf b/subworkflows/nf-core/bam_subsampledepth_samtools/main.nf index b7f54e63046..754ff312c99 100644 --- a/subworkflows/nf-core/bam_subsampledepth_samtools/main.nf +++ b/subworkflows/nf-core/bam_subsampledepth_samtools/main.nf @@ -37,6 +37,7 @@ workflow BAM_SUBSAMPLEDEPTH_SAMTOOLS { SAMTOOLS_VIEW( ch_input_subsample, ch_fasta, + [], [] ) ch_versions = ch_versions.mix(SAMTOOLS_VIEW.out.versions.first()) diff --git a/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf b/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf index 661d79327d9..1138f3f3bd6 100644 --- a/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf +++ b/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf @@ -123,7 +123,7 @@ workflow FASTQ_CREATE_UMI_CONSENSUS_FGBIO { dummy_bam_bai = ZIPPERBAMS_PRE.out.bam.map{meta, bam -> [meta, bam, dummyIndexFile]} check_dummy_bam_bai = dummy_bam_bai.dump(tag: 'dummy_index') // then applying samtools view to filter only paired reads - BAMFILTER ( dummy_bam_bai, [[],[]], [] ) + BAMFILTER ( dummy_bam_bai, [[],[]], [], [] ) ch_versions = ch_versions.mix(BAMFILTER.out.versions) groupready_bam = BAMFILTER.out.bam // deleting dummy file diff --git a/tests/modules/nf-core/endorspy/main.nf b/tests/modules/nf-core/endorspy/main.nf index 0e747fedd7a..a324b1c87e1 100644 --- a/tests/modules/nf-core/endorspy/main.nf +++ b/tests/modules/nf-core/endorspy/main.nf @@ -35,7 +35,7 @@ workflow test_endorspy_raw_qualityfilter { SAMTOOLS_FLAGSTAT1 ( input ) - SAMTOOLS_VIEW ( input, [], [] ) + SAMTOOLS_VIEW ( input, [], [], [] ) SAMTOOLS_INDEX ( SAMTOOLS_VIEW.out.bam ) input2 = SAMTOOLS_VIEW.out.bam .mix(SAMTOOLS_INDEX.out.bai) @@ -62,7 +62,7 @@ workflow test_endorspy_raw_qualityfilter_dedup { SAMTOOLS_FLAGSTAT1 ( input ) - SAMTOOLS_VIEW ( input, [], [] ) + SAMTOOLS_VIEW ( input, [], [], [] ) SAMTOOLS_INDEX ( SAMTOOLS_VIEW.out.bam ) input2 = SAMTOOLS_VIEW.out.bam .mix(SAMTOOLS_INDEX.out.bai) @@ -91,7 +91,7 @@ workflow test_endorspy_raw_dedup { SAMTOOLS_FLAGSTAT1 ( input ) - SAMTOOLS_VIEW ( input, [], [] ) + SAMTOOLS_VIEW ( input, [], [], [] ) SAMTOOLS_INDEX ( SAMTOOLS_VIEW.out.bam ) input2 = SAMTOOLS_VIEW.out.bam .mix(SAMTOOLS_INDEX.out.bai) @@ -117,7 +117,7 @@ workflow test_endorspy_qualityfilter_dedup { SAMTOOLS_FLAGSTAT1 ( input ) - SAMTOOLS_VIEW ( input, [], [] ) + SAMTOOLS_VIEW ( input, [], [], [] ) SAMTOOLS_INDEX ( SAMTOOLS_VIEW.out.bam ) input2 = SAMTOOLS_VIEW.out.bam .mix(SAMTOOLS_INDEX.out.bai) diff --git a/tests/modules/nf-core/graphtyper/genotype/main.nf b/tests/modules/nf-core/graphtyper/genotype/main.nf index bbeb4a1b166..006ec405b81 100644 --- a/tests/modules/nf-core/graphtyper/genotype/main.nf +++ b/tests/modules/nf-core/graphtyper/genotype/main.nf @@ -8,7 +8,7 @@ include { SAMTOOLS_VIEW } from '../../../../ include { SAMTOOLS_INDEX } from '../../../../../modules/nf-core/samtools/index/main.nf' workflow test_graphtyper_genotype_single { - + input = [ [ id:'test' ], // meta map [ file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) ], @@ -22,7 +22,7 @@ workflow test_graphtyper_genotype_single { } workflow test_graphtyper_genotype_multi { - + input = Channel.fromList ( [ [ [ id: 'test1' ], // meta map @@ -40,7 +40,7 @@ workflow test_graphtyper_genotype_multi { ref_index = [ [ id: 'ref_index' ], file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true)] region = file(params.test_data['sarscov2']['genome']['regions_txt'], checkIfExists: true) - SAMTOOLS_VIEW ( input, reference, []) + SAMTOOLS_VIEW ( input, reference, [], []) SAMTOOLS_INDEX ( SAMTOOLS_VIEW.out.cram ) cram_grouped = SAMTOOLS_VIEW.out.cram.map{ [[id: 'group'], it[1]] }.groupTuple() crai_grouped = SAMTOOLS_INDEX.out.crai.map{ [[id: 'group'], it[1]] }.groupTuple() diff --git a/tests/modules/nf-core/leehom/main.nf b/tests/modules/nf-core/leehom/main.nf index aeacd31bb75..de8e32d539a 100644 --- a/tests/modules/nf-core/leehom/main.nf +++ b/tests/modules/nf-core/leehom/main.nf @@ -12,7 +12,7 @@ workflow test_leehom_bam { [] ] - SAMTOOLS_VIEW ( input, [] , []) + SAMTOOLS_VIEW ( input, [] , [], []) LEEHOM ( SAMTOOLS_VIEW.out.bam ) } diff --git a/tests/modules/nf-core/metaphlan3/metaphlan3/main.nf b/tests/modules/nf-core/metaphlan3/metaphlan3/main.nf index 4a0f7948f5c..a1bb8607f2a 100644 --- a/tests/modules/nf-core/metaphlan3/metaphlan3/main.nf +++ b/tests/modules/nf-core/metaphlan3/metaphlan3/main.nf @@ -49,7 +49,7 @@ workflow test_metaphlan3_sam { db = [ [], file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/metaphlan_database.tar.gz', checkIfExists: true) ] UNTAR ( db ) - SAMTOOLS_VIEW ( input, [] ) + SAMTOOLS_VIEW ( input, [], [] ) METAPHLAN3_METAPHLAN3 ( SAMTOOLS_VIEW.out.bam, UNTAR.out.untar.map{ it[1] } ) } From aa151d88204f789e5896371dc1efb83249206daa Mon Sep 17 00:00:00 2001 From: Felix Lenner Date: Fri, 14 Feb 2025 08:09:35 +0000 Subject: [PATCH 03/12] fix meta.yml --- modules/nf-core/samtools/view/meta.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/samtools/view/meta.yml b/modules/nf-core/samtools/view/meta.yml index caa7b0150d4..53445916cc1 100644 --- a/modules/nf-core/samtools/view/meta.yml +++ b/modules/nf-core/samtools/view/meta.yml @@ -43,6 +43,10 @@ input: type: file description: Optional file with read names to output only select alignments pattern: "*.{txt,list}" + - - index_format: + type: string + description: Index format, used together with ext.args = '--write-index' + pattern: "*.{bai,csi,crai}" output: - bam: - meta: @@ -120,10 +124,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - ${prefix}.unselected.${file_type}.{bai,csi,crsi}: + - ${prefix}.unselected.${file_type}.{csi,crai}: type: file description: index for the "unselected" file - pattern: "*.unselected.{bai,csi,crai}" + pattern: "*.unselected.{csi,crai}" - versions: - versions.yml: type: file From 09ce07601adb4bd8d60c874301bc8661be3576c8 Mon Sep 17 00:00:00 2001 From: Felix Lenner Date: Fri, 14 Feb 2025 08:14:29 +0000 Subject: [PATCH 04/12] fix endorspy --- tests/modules/nf-core/endorspy/main.nf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/modules/nf-core/endorspy/main.nf b/tests/modules/nf-core/endorspy/main.nf index a324b1c87e1..685fcca660d 100644 --- a/tests/modules/nf-core/endorspy/main.nf +++ b/tests/modules/nf-core/endorspy/main.nf @@ -35,7 +35,7 @@ workflow test_endorspy_raw_qualityfilter { SAMTOOLS_FLAGSTAT1 ( input ) - SAMTOOLS_VIEW ( input, [], [], [] ) + SAMTOOLS_VIEW ( input, [[],[]], [], [] ) SAMTOOLS_INDEX ( SAMTOOLS_VIEW.out.bam ) input2 = SAMTOOLS_VIEW.out.bam .mix(SAMTOOLS_INDEX.out.bai) @@ -62,7 +62,7 @@ workflow test_endorspy_raw_qualityfilter_dedup { SAMTOOLS_FLAGSTAT1 ( input ) - SAMTOOLS_VIEW ( input, [], [], [] ) + SAMTOOLS_VIEW ( input, [[],[]], [], [] ) SAMTOOLS_INDEX ( SAMTOOLS_VIEW.out.bam ) input2 = SAMTOOLS_VIEW.out.bam .mix(SAMTOOLS_INDEX.out.bai) @@ -91,7 +91,7 @@ workflow test_endorspy_raw_dedup { SAMTOOLS_FLAGSTAT1 ( input ) - SAMTOOLS_VIEW ( input, [], [], [] ) + SAMTOOLS_VIEW ( input, [[],[]], [], [] ) SAMTOOLS_INDEX ( SAMTOOLS_VIEW.out.bam ) input2 = SAMTOOLS_VIEW.out.bam .mix(SAMTOOLS_INDEX.out.bai) @@ -117,7 +117,7 @@ workflow test_endorspy_qualityfilter_dedup { SAMTOOLS_FLAGSTAT1 ( input ) - SAMTOOLS_VIEW ( input, [], [], [] ) + SAMTOOLS_VIEW ( input, [[],[]], [], [] ) SAMTOOLS_INDEX ( SAMTOOLS_VIEW.out.bam ) input2 = SAMTOOLS_VIEW.out.bam .mix(SAMTOOLS_INDEX.out.bai) From e7a0e94e5a1a125d7513af45c7d6def4bfbd610b Mon Sep 17 00:00:00 2001 From: Felix Lenner Date: Fri, 14 Feb 2025 08:15:26 +0000 Subject: [PATCH 05/12] fix leehom --- tests/modules/nf-core/leehom/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/nf-core/leehom/main.nf b/tests/modules/nf-core/leehom/main.nf index de8e32d539a..f76970572bc 100644 --- a/tests/modules/nf-core/leehom/main.nf +++ b/tests/modules/nf-core/leehom/main.nf @@ -12,7 +12,7 @@ workflow test_leehom_bam { [] ] - SAMTOOLS_VIEW ( input, [] , [], []) + SAMTOOLS_VIEW ( input, [[],[]], [], []) LEEHOM ( SAMTOOLS_VIEW.out.bam ) } From 2c988a4950ad5da29901e7d710dbcf2ad0baac15 Mon Sep 17 00:00:00 2001 From: Felix Lenner Date: Fri, 14 Feb 2025 08:16:48 +0000 Subject: [PATCH 06/12] fix graphtyper --- tests/modules/nf-core/graphtyper/genotype/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/nf-core/graphtyper/genotype/main.nf b/tests/modules/nf-core/graphtyper/genotype/main.nf index 006ec405b81..90270f66b8b 100644 --- a/tests/modules/nf-core/graphtyper/genotype/main.nf +++ b/tests/modules/nf-core/graphtyper/genotype/main.nf @@ -35,7 +35,7 @@ workflow test_graphtyper_genotype_multi { file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam_bai'], checkIfExists: true) ] ] ) - reference = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + reference = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true).map { it -> [ [ 'id': it.simpleName], it ] } ref_with_meta = [ [ id: 'ref' ], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] ref_index = [ [ id: 'ref_index' ], file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true)] region = file(params.test_data['sarscov2']['genome']['regions_txt'], checkIfExists: true) From 0e3a3eca4ac82cdd7541109525d625a1852797ed Mon Sep 17 00:00:00 2001 From: Felix Lenner Date: Fri, 14 Feb 2025 08:19:17 +0000 Subject: [PATCH 07/12] fix metaphlan3 --- tests/modules/nf-core/metaphlan3/metaphlan3/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/nf-core/metaphlan3/metaphlan3/main.nf b/tests/modules/nf-core/metaphlan3/metaphlan3/main.nf index a1bb8607f2a..02b7c0a9b12 100644 --- a/tests/modules/nf-core/metaphlan3/metaphlan3/main.nf +++ b/tests/modules/nf-core/metaphlan3/metaphlan3/main.nf @@ -49,7 +49,7 @@ workflow test_metaphlan3_sam { db = [ [], file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/metaphlan_database.tar.gz', checkIfExists: true) ] UNTAR ( db ) - SAMTOOLS_VIEW ( input, [], [] ) + SAMTOOLS_VIEW ( input, [[],[]], [], [] ) METAPHLAN3_METAPHLAN3 ( SAMTOOLS_VIEW.out.bam, UNTAR.out.untar.map{ it[1] } ) } From 68b686d48181ae508c9f983faf23beadbc875fec Mon Sep 17 00:00:00 2001 From: Felix Lenner Date: Fri, 14 Feb 2025 08:27:45 +0000 Subject: [PATCH 08/12] fix --- .../nf-core/fastq_create_umi_consensus_fgbio/main.nf | 2 +- tests/modules/nf-core/graphtyper/genotype/main.nf | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf b/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf index 1138f3f3bd6..175a2bda9e6 100644 --- a/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf +++ b/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf @@ -79,7 +79,7 @@ workflow FASTQ_CREATE_UMI_CONSENSUS_FGBIO { // appropriately tagged interleaved FASTQ reads are mapped to the reference // the aligner should be set with the following parameters "-p -K 150000000 -Y" // to be configured in ext.args of your config - BWAMEM1_MEM_PRE ( BAM2FASTQ_PRE.out.fastq, bwaindex, false ) + BWAMEM1_MEM_PRE ( BAM2FASTQ_PRE.out.fastq, bwaindex, [[],[]], false ) ch_versions = ch_versions.mix(BWAMEM1_MEM_PRE.out.versions) aligned_bam = aligned_bam.mix(BWAMEM1_MEM_PRE.out.bam) } else { diff --git a/tests/modules/nf-core/graphtyper/genotype/main.nf b/tests/modules/nf-core/graphtyper/genotype/main.nf index 90270f66b8b..d93f8c06f41 100644 --- a/tests/modules/nf-core/graphtyper/genotype/main.nf +++ b/tests/modules/nf-core/graphtyper/genotype/main.nf @@ -35,7 +35,10 @@ workflow test_graphtyper_genotype_multi { file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam_bai'], checkIfExists: true) ] ] ) - reference = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true).map { it -> [ [ 'id': it.simpleName], it ] } + reference = Channel.of([ + [ id: 'test_genome'], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ]) ref_with_meta = [ [ id: 'ref' ], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] ref_index = [ [ id: 'ref_index' ], file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true)] region = file(params.test_data['sarscov2']['genome']['regions_txt'], checkIfExists: true) From c148d2078af49413dfaedaa7142a4e8e5c2886bc Mon Sep 17 00:00:00 2001 From: Felix Lenner Date: Fri, 14 Feb 2025 09:00:17 +0000 Subject: [PATCH 09/12] port bam split by region to nf-test --- .../bam_split_by_region/nextflow.config | 14 --- .../bam_split_by_region/tests/main.nf.test | 45 ++++++++ .../tests/main.nf.test.snap | 102 ++++++++++++++++++ .../bam_split_by_region/tests/nextflow.config | 6 ++ tests/config/pytest_modules.yml | 3 - .../nf-core/bam_split_by_region/main.nf | 30 ------ .../bam_split_by_region/nextflow.config | 15 --- .../nf-core/bam_split_by_region/test.yml | 35 ------ 8 files changed, 153 insertions(+), 97 deletions(-) delete mode 100644 subworkflows/nf-core/bam_split_by_region/nextflow.config create mode 100644 subworkflows/nf-core/bam_split_by_region/tests/main.nf.test create mode 100644 subworkflows/nf-core/bam_split_by_region/tests/main.nf.test.snap create mode 100644 subworkflows/nf-core/bam_split_by_region/tests/nextflow.config delete mode 100644 tests/subworkflows/nf-core/bam_split_by_region/main.nf delete mode 100644 tests/subworkflows/nf-core/bam_split_by_region/nextflow.config delete mode 100644 tests/subworkflows/nf-core/bam_split_by_region/test.yml diff --git a/subworkflows/nf-core/bam_split_by_region/nextflow.config b/subworkflows/nf-core/bam_split_by_region/nextflow.config deleted file mode 100644 index 92d3956fc3d..00000000000 --- a/subworkflows/nf-core/bam_split_by_region/nextflow.config +++ /dev/null @@ -1,14 +0,0 @@ -// IMPORTANT: Add this configuration to your modules.config - -process { - withName: ".*BAM_SPLIT_BY_REGION:SAMTOOLS_VIEW" { - ext.args2 = { - [ - "${meta.genomic_region}", // Specifies the chromosome name used for splitting the input bam file. - ].join(' ').trim() - } - - ext.prefix = { "${meta.id}_${meta.genomic_region}" } - } - -} diff --git a/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test b/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test new file mode 100644 index 00000000000..6272399c4fc --- /dev/null +++ b/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test @@ -0,0 +1,45 @@ +// TODO nf-core: Once you have added the required tests, please run the following command to build this file: +// nf-core subworkflows test bam_split_by_region +nextflow_workflow { + + name "Test Subworkflow BAM_SPLIT_BY_REGION" + script "../main.nf" + workflow "BAM_SPLIT_BY_REGION" + + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/bam_split_by_region" + tag "samtools" + tag "samtools/sort" + tag "samtools/index" + + config "./nextflow.config" + + test("homo_sapiens - test_paired_end_markduplicates_sorted_bam") { + + when { + workflow { + """ + input[0] = Channel.of([ + [ id: 'test', single_end: false ], + file(params.modules_testdata_base_path +'genomics/homo_sapiens/illumina/bam/test.paired_end.markduplicates.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path +'genomics/homo_sapiens/illumina/bam/test.paired_end.markduplicates.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path +'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true), + ]) + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + workflow.out.bam_bai.findAll { file(it.get(1)).name }.toSorted(), + workflow.out.bam_bai.findAll { bam(it.get(1)).getReadsMD5() }.toSorted(), + workflow.out.bam_bai.findAll { file(it.get(2)).name }.toSorted(), + workflow.out.versions + ).match() } + ) + } + } +} diff --git a/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test.snap b/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test.snap new file mode 100644 index 00000000000..a2a2e6c7bc0 --- /dev/null +++ b/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test.snap @@ -0,0 +1,102 @@ +{ + "homo_sapiens - test_paired_end_markduplicates_sorted_bam": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:24132499-24910998" + }, + "test_chr21:24132499-24910998.bam:md5,649908006f4333ef13e42313e0885d96", + "test_chr21:24132499-24910998.bam.bai:md5,0d76977b2e36046cc176112776c5fa4e" + ], + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:25689497-46709983" + }, + "test_chr21:25689497-46709983.bam:md5,c4bc65ad94bde9cc901d33e964a977c6", + "test_chr21:25689497-46709983.bam.bai:md5,834238b87a13404627fecaa1ed7ae4f4" + ], + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:1-23354000" + }, + "test_chr21:1-23354000.bam:md5,e17b22b80b4ba098232f12a3cb612c73", + "test_chr21:1-23354000.bam.bai:md5,adbf2a0b95a947c055c219f0d950add0" + ] + ], + [ + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:24132499-24910998" + }, + "test_chr21:24132499-24910998.bam:md5,649908006f4333ef13e42313e0885d96", + "test_chr21:24132499-24910998.bam.bai:md5,0d76977b2e36046cc176112776c5fa4e" + ], + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:25689497-46709983" + }, + "test_chr21:25689497-46709983.bam:md5,c4bc65ad94bde9cc901d33e964a977c6", + "test_chr21:25689497-46709983.bam.bai:md5,834238b87a13404627fecaa1ed7ae4f4" + ], + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:1-23354000" + }, + "test_chr21:1-23354000.bam:md5,e17b22b80b4ba098232f12a3cb612c73", + "test_chr21:1-23354000.bam.bai:md5,adbf2a0b95a947c055c219f0d950add0" + ] + ], + [ + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:24132499-24910998" + }, + "test_chr21:24132499-24910998.bam:md5,649908006f4333ef13e42313e0885d96", + "test_chr21:24132499-24910998.bam.bai:md5,0d76977b2e36046cc176112776c5fa4e" + ], + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:25689497-46709983" + }, + "test_chr21:25689497-46709983.bam:md5,c4bc65ad94bde9cc901d33e964a977c6", + "test_chr21:25689497-46709983.bam.bai:md5,834238b87a13404627fecaa1ed7ae4f4" + ], + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:1-23354000" + }, + "test_chr21:1-23354000.bam:md5,e17b22b80b4ba098232f12a3cb612c73", + "test_chr21:1-23354000.bam.bai:md5,adbf2a0b95a947c055c219f0d950add0" + ] + ], + [ + "versions.yml:md5,022ce36c7637b4c28f9e7a3b6d788543", + "versions.yml:md5,1430b8967dea6b0eb5a65313c8d81e81" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-02-14T08:59:50.32521715" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/bam_split_by_region/tests/nextflow.config b/subworkflows/nf-core/bam_split_by_region/tests/nextflow.config new file mode 100644 index 00000000000..7f5a8e20fe9 --- /dev/null +++ b/subworkflows/nf-core/bam_split_by_region/tests/nextflow.config @@ -0,0 +1,6 @@ +process { + withName: "BAM_SPLIT_BY_REGION:SAMTOOLS_VIEW" { + ext.args2 = { "${meta.genomic_region}" } // Specifies the chromosome name used for splitting the input bam file. + ext.prefix = { "${meta.id}_${meta.genomic_region}" } + } +} diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index a0a212f4bb7..304d3ae8b74 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -426,9 +426,6 @@ subworkflows/bam_markduplicates_samtools: subworkflows/bam_ngscheckmate: - subworkflows/nf-core/bam_ngscheckmate/** - tests/subworkflows/nf-core/bam_ngscheckmate/** -subworkflows/bam_split_by_region: - - subworkflows/nf-core/bam_split_by_region/** - - tests/subworkflows/nf-core/bam_split_by_region/** subworkflows/bam_tumor_normal_somatic_variant_calling_gatk: - subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/** - tests/subworkflows/nf-core/bam_tumor_normal_somatic_variant_calling_gatk/** diff --git a/tests/subworkflows/nf-core/bam_split_by_region/main.nf b/tests/subworkflows/nf-core/bam_split_by_region/main.nf deleted file mode 100644 index eca873ba5bc..00000000000 --- a/tests/subworkflows/nf-core/bam_split_by_region/main.nf +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { SAMTOOLS_INDEX } from '../../../../modules/nf-core/samtools/index/main.nf' -include { BAM_SPLIT_BY_REGION } from '../../../../subworkflows/nf-core/bam_split_by_region/main.nf' - -workflow test_bam_split_by_region { - - input = [ - [ [ id: 'test', single_end: false ], - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_markduplicates_sorted_bam'], checkIfExists: true), - ], - [ [ id: 'test2', single_end: false ], - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_markduplicates_sorted_bam'], checkIfExists: true), - ] - ] - - regions = [ - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) - ] - - SAMTOOLS_INDEX(Channel.fromList(input)) - - ch_bam_split_input=Channel.fromList(input) - .join(SAMTOOLS_INDEX.out.bai) - .combine(Channel.of(regions)) - - BAM_SPLIT_BY_REGION ( ch_bam_split_input ) -} diff --git a/tests/subworkflows/nf-core/bam_split_by_region/nextflow.config b/tests/subworkflows/nf-core/bam_split_by_region/nextflow.config deleted file mode 100644 index 308a615193c..00000000000 --- a/tests/subworkflows/nf-core/bam_split_by_region/nextflow.config +++ /dev/null @@ -1,15 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: ".*BAM_SPLIT_BY_REGION:SAMTOOLS_VIEW" { - ext.args2 = { - [ - "${meta.genomic_region}", // Specifies the chromosome name used for splitting the input bam file. - ].join(' ').trim() - } - - ext.prefix = { "${meta.id}_${meta.genomic_region}" } - } - -} diff --git a/tests/subworkflows/nf-core/bam_split_by_region/test.yml b/tests/subworkflows/nf-core/bam_split_by_region/test.yml deleted file mode 100644 index d0498742218..00000000000 --- a/tests/subworkflows/nf-core/bam_split_by_region/test.yml +++ /dev/null @@ -1,35 +0,0 @@ -- name: bam_split_by_region test_bam_split_by_region - command: nextflow run ./tests/subworkflows/nf-core/bam_split_by_region -entry test_bam_split_by_region -c ./tests/config/nextflow.config - tags: - - samtools - - samtools/index - - samtools/view - - subworkflows - - subworkflows/bam_split_by_region - files: - - path: output/samtools/test.paired_end.markduplicates.sorted.bam.bai - md5sum: 15f1723181368484a9c783323b6699e5 - - path: output/samtools/test2_chr21:1-23354000.bam - md5sum: 1286f2e37ead72c89a6d46dd3550b5cf - - path: output/samtools/test2_chr21:1-23354000.bam.bai - md5sum: b344287b0d56c56dacd819a388783af4 - - path: output/samtools/test2_chr21:24132499-24910998.bam - md5sum: d3f8e65b43b15f19813177206d5151df - - path: output/samtools/test2_chr21:24132499-24910998.bam.bai - md5sum: 0d76977b2e36046cc176112776c5fa4e - - path: output/samtools/test2_chr21:25689497-46709983.bam - md5sum: 3faa0c1d5219b9638af66bb89d27af6a - - path: output/samtools/test2_chr21:25689497-46709983.bam.bai - md5sum: d0dfe65baf9ebc857c95fe4bad1f5f9f - - path: output/samtools/test_chr21:1-23354000.bam - md5sum: c2392dc8e421b5a5bb6344a8aee3df01 - - path: output/samtools/test_chr21:1-23354000.bam.bai - md5sum: adbf2a0b95a947c055c219f0d950add0 - - path: output/samtools/test_chr21:24132499-24910998.bam - md5sum: 7e4f52bdc87c726369a962beb8153a4e - - path: output/samtools/test_chr21:24132499-24910998.bam.bai - md5sum: 0d76977b2e36046cc176112776c5fa4e - - path: output/samtools/test_chr21:25689497-46709983.bam - md5sum: c46656090a5a322ad68cc6b43cd6c84f - - path: output/samtools/test_chr21:25689497-46709983.bam.bai - md5sum: 50c7f05de7e4ea77d8400d5890466480 From 161a736e0da5b2e3e5bb50ab3b2621d72fe3892b Mon Sep 17 00:00:00 2001 From: Felix Lenner Date: Fri, 14 Feb 2025 09:02:58 +0000 Subject: [PATCH 10/12] fix --- modules/nf-core/samtools/view/main.nf | 6 +- .../nf-core/bam_split_by_region/README.md | 14 ++ .../bam_split_by_region/tests/main.nf.test | 31 +++- .../tests/main.nf.test.snap | 169 +++++++++--------- .../fastq_create_umi_consensus_fgbio/main.nf | 2 +- 5 files changed, 133 insertions(+), 89 deletions(-) create mode 100644 subworkflows/nf-core/bam_split_by_region/README.md diff --git a/modules/nf-core/samtools/view/main.nf b/modules/nf-core/samtools/view/main.nf index cb13452cb91..f43a4c6e72b 100644 --- a/modules/nf-core/samtools/view/main.nf +++ b/modules/nf-core/samtools/view/main.nf @@ -37,7 +37,7 @@ process SAMTOOLS_VIEW { args.contains("--output-fmt cram") ? "cram" : input.getExtension() - output_file = index_format ? "${prefix}.${file_type}##idx##${prefix}.${file_type}.${index_format}" : "${prefix}.${file_type}" + output_file = index_format ? "${prefix}.${file_type}##idx##${prefix}.${file_type}.${index_format} --write-index" : "${prefix}.${file_type}" // Can't choose index type of unselected file readnames = qname ? "--qname-file ${qname} --output-unselected ${prefix}.unselected.${file_type}": "" @@ -76,10 +76,10 @@ process SAMTOOLS_VIEW { default_index_format = file_type == "bam" ? "csi" : file_type == "cram" ? "crai" : "" - index = args.contains("--write-index") && index_format ? "touch ${prefix}.${file_type}.${index_format}" : args.contains("--write-index") ? "touch ${prefix}.${file_type}.${default_index_format}" : "" + index = index_format ? "touch ${prefix}.${file_type}.${index_format}" : args.contains("--write-index") ? "touch ${prefix}.${file_type}.${default_index_format}" : "" unselected = qname ? "touch ${prefix}.unselected.${file_type}" : "" // Can't choose index type of unselected file - unselected_index = qname && args.contains("--write-index") ? "touch ${prefix}.unselected.${file_type}.${default_index_format}" : "" + unselected_index = qname && (args.contains("--write-index") || index_format) ? "touch ${prefix}.unselected.${file_type}.${default_index_format}" : "" if ("$input" == "${prefix}.${file_type}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" if (index_format) { diff --git a/subworkflows/nf-core/bam_split_by_region/README.md b/subworkflows/nf-core/bam_split_by_region/README.md new file mode 100644 index 00000000000..92d3956fc3d --- /dev/null +++ b/subworkflows/nf-core/bam_split_by_region/README.md @@ -0,0 +1,14 @@ +// IMPORTANT: Add this configuration to your modules.config + +process { + withName: ".*BAM_SPLIT_BY_REGION:SAMTOOLS_VIEW" { + ext.args2 = { + [ + "${meta.genomic_region}", // Specifies the chromosome name used for splitting the input bam file. + ].join(' ').trim() + } + + ext.prefix = { "${meta.id}_${meta.genomic_region}" } + } + +} diff --git a/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test b/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test index 6272399c4fc..1cee46a8947 100644 --- a/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test +++ b/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test @@ -34,12 +34,37 @@ nextflow_workflow { assertAll( { assert workflow.success }, { assert snapshot( - workflow.out.bam_bai.findAll { file(it.get(1)).name }.toSorted(), - workflow.out.bam_bai.findAll { bam(it.get(1)).getReadsMD5() }.toSorted(), - workflow.out.bam_bai.findAll { file(it.get(2)).name }.toSorted(), + workflow.out.bam_bai.toSorted { a, b -> file(a.get(1)).name <=> file(b.get(1)).name }.collect { file(it.get(1)).name }, + workflow.out.bam_bai.toSorted { a, b -> file(a.get(1)).name <=> file(b.get(1)).name }.collect { bam(it.get(1)).getReadsMD5() }, + workflow.out.bam_bai.toSorted { a, b -> file(a.get(1)).name <=> file(b.get(1)).name }.collect { file(it.get(2)).name }, workflow.out.versions ).match() } ) } } + + test("homo_sapiens - test_paired_end_markduplicates_sorted_bam - stub") { + + options "-stub" + + when { + workflow { + """ + input[0] = Channel.of([ + [ id: 'test', single_end: false ], + file(params.modules_testdata_base_path +'genomics/homo_sapiens/illumina/bam/test.paired_end.markduplicates.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path +'genomics/homo_sapiens/illumina/bam/test.paired_end.markduplicates.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path +'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true), + ]) + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } } diff --git a/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test.snap b/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test.snap index a2a2e6c7bc0..5b8566fa0f8 100644 --- a/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test.snap +++ b/subworkflows/nf-core/bam_split_by_region/tests/main.nf.test.snap @@ -2,91 +2,19 @@ "homo_sapiens - test_paired_end_markduplicates_sorted_bam": { "content": [ [ - [ - { - "id": "test", - "single_end": false, - "genomic_region": "chr21:24132499-24910998" - }, - "test_chr21:24132499-24910998.bam:md5,649908006f4333ef13e42313e0885d96", - "test_chr21:24132499-24910998.bam.bai:md5,0d76977b2e36046cc176112776c5fa4e" - ], - [ - { - "id": "test", - "single_end": false, - "genomic_region": "chr21:25689497-46709983" - }, - "test_chr21:25689497-46709983.bam:md5,c4bc65ad94bde9cc901d33e964a977c6", - "test_chr21:25689497-46709983.bam.bai:md5,834238b87a13404627fecaa1ed7ae4f4" - ], - [ - { - "id": "test", - "single_end": false, - "genomic_region": "chr21:1-23354000" - }, - "test_chr21:1-23354000.bam:md5,e17b22b80b4ba098232f12a3cb612c73", - "test_chr21:1-23354000.bam.bai:md5,adbf2a0b95a947c055c219f0d950add0" - ] + "test_chr21:1-23354000.bam", + "test_chr21:24132499-24910998.bam", + "test_chr21:25689497-46709983.bam" ], [ - [ - { - "id": "test", - "single_end": false, - "genomic_region": "chr21:24132499-24910998" - }, - "test_chr21:24132499-24910998.bam:md5,649908006f4333ef13e42313e0885d96", - "test_chr21:24132499-24910998.bam.bai:md5,0d76977b2e36046cc176112776c5fa4e" - ], - [ - { - "id": "test", - "single_end": false, - "genomic_region": "chr21:25689497-46709983" - }, - "test_chr21:25689497-46709983.bam:md5,c4bc65ad94bde9cc901d33e964a977c6", - "test_chr21:25689497-46709983.bam.bai:md5,834238b87a13404627fecaa1ed7ae4f4" - ], - [ - { - "id": "test", - "single_end": false, - "genomic_region": "chr21:1-23354000" - }, - "test_chr21:1-23354000.bam:md5,e17b22b80b4ba098232f12a3cb612c73", - "test_chr21:1-23354000.bam.bai:md5,adbf2a0b95a947c055c219f0d950add0" - ] + "a2288aed3c12eb43e20164dc85787fad", + "d41d8cd98f00b204e9800998ecf8427e", + "831a9c955bc0fbfe24da0b16ffee4365" ], [ - [ - { - "id": "test", - "single_end": false, - "genomic_region": "chr21:24132499-24910998" - }, - "test_chr21:24132499-24910998.bam:md5,649908006f4333ef13e42313e0885d96", - "test_chr21:24132499-24910998.bam.bai:md5,0d76977b2e36046cc176112776c5fa4e" - ], - [ - { - "id": "test", - "single_end": false, - "genomic_region": "chr21:25689497-46709983" - }, - "test_chr21:25689497-46709983.bam:md5,c4bc65ad94bde9cc901d33e964a977c6", - "test_chr21:25689497-46709983.bam.bai:md5,834238b87a13404627fecaa1ed7ae4f4" - ], - [ - { - "id": "test", - "single_end": false, - "genomic_region": "chr21:1-23354000" - }, - "test_chr21:1-23354000.bam:md5,e17b22b80b4ba098232f12a3cb612c73", - "test_chr21:1-23354000.bam.bai:md5,adbf2a0b95a947c055c219f0d950add0" - ] + "test_chr21:1-23354000.bam.bai", + "test_chr21:24132499-24910998.bam.bai", + "test_chr21:25689497-46709983.bam.bai" ], [ "versions.yml:md5,022ce36c7637b4c28f9e7a3b6d788543", @@ -97,6 +25,83 @@ "nf-test": "0.9.2", "nextflow": "24.10.3" }, - "timestamp": "2025-02-14T08:59:50.32521715" + "timestamp": "2025-02-14T09:29:31.729957588" + }, + "homo_sapiens - test_paired_end_markduplicates_sorted_bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:1-23354000" + }, + "test_chr21:1-23354000.bam:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_chr21:1-23354000.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:24132499-24910998" + }, + "test_chr21:24132499-24910998.bam:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_chr21:24132499-24910998.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:25689497-46709983" + }, + "test_chr21:25689497-46709983.bam:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_chr21:25689497-46709983.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,022ce36c7637b4c28f9e7a3b6d788543", + "versions.yml:md5,1430b8967dea6b0eb5a65313c8d81e81" + ], + "bam_bai": [ + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:1-23354000" + }, + "test_chr21:1-23354000.bam:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_chr21:1-23354000.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:24132499-24910998" + }, + "test_chr21:24132499-24910998.bam:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_chr21:24132499-24910998.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "test", + "single_end": false, + "genomic_region": "chr21:25689497-46709983" + }, + "test_chr21:25689497-46709983.bam:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_chr21:25689497-46709983.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,022ce36c7637b4c28f9e7a3b6d788543", + "versions.yml:md5,1430b8967dea6b0eb5a65313c8d81e81" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-02-14T09:01:38.813440955" } } \ No newline at end of file diff --git a/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf b/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf index 175a2bda9e6..ab88ca1763a 100644 --- a/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf +++ b/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf @@ -157,7 +157,7 @@ workflow FASTQ_CREATE_UMI_CONSENSUS_FGBIO { // using the above created groups, a consensus across reads in the same group // can be called // this will emit a consensus BAM file - CALLUMICONSENSUS ( GROUPREADSBYUMI.out.bam ) + CALLUMICONSENSUS ( GROUPREADSBYUMI.out.bam, [], []) ch_versions = ch_versions.mix(CALLUMICONSENSUS.out.versions) consensus_bam = CALLUMICONSENSUS.out.bam } From 16f4dc272a9f6d85c5f9afebc4e6a0e361c192ce Mon Sep 17 00:00:00 2001 From: Felix Lenner Date: Fri, 14 Feb 2025 10:31:30 +0000 Subject: [PATCH 11/12] try to fix CI --- .github/workflows/lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fdc7c8f799b..2ff67a4fa39 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -85,10 +85,11 @@ jobs: script: | return [...new Set(${{ steps.filter.outputs.modules_files }} .map(path => path + .replace('tests/modules/nf-core/', '') .replace('modules/nf-core/', '') .split('/') .slice(0, 2) - .filter(x => !x.startsWith('main.nf') && x !== 'tests' && x !== 'templates' && x !== 'meta.yml' && x !== 'environment.yml' && !x.endsWith('.md')) + .filter(x => !x.startsWith('main.nf') && x !== 'tests' && x !== 'templates' && x !== 'meta.yml' && x !== 'environment.yml' && x !== 'nextflow.config' && x !== 'test.yml' && !x.endsWith('.md')) .join('/')) ) ]; From 0b87a4889e58b0fb4b2f85503fc7d13dadea9fb1 Mon Sep 17 00:00:00 2001 From: Felix Lenner Date: Wed, 19 Feb 2025 08:38:53 +0000 Subject: [PATCH 12/12] Don't check tests folder at all --- .github/workflows/lint.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2ff67a4fa39..d7e110d03bf 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -71,10 +71,8 @@ jobs: filters: | modules: - added|modified: 'modules/nf-core/**' - - added|modified: 'tests/modules/nf-core/**' subworkflows: - added|modified: 'subworkflows/nf-core/**' - - added|modified: 'tests/subworkflows/nf-core/**' token: "" list-files: "json" @@ -85,11 +83,10 @@ jobs: script: | return [...new Set(${{ steps.filter.outputs.modules_files }} .map(path => path - .replace('tests/modules/nf-core/', '') .replace('modules/nf-core/', '') .split('/') .slice(0, 2) - .filter(x => !x.startsWith('main.nf') && x !== 'tests' && x !== 'templates' && x !== 'meta.yml' && x !== 'environment.yml' && x !== 'nextflow.config' && x !== 'test.yml' && !x.endsWith('.md')) + .filter(x => !x.startsWith('main.nf') && x !== 'tests' && x !== 'templates' && x !== 'meta.yml' && x !== 'environment.yml' && !x.endsWith('.md')) .join('/')) ) ];