diff --git a/modules/nf-core/umicollapse/tests/main.nf.test b/modules/nf-core/umicollapse/tests/main.nf.test index cc28359a667..db578775ee2 100644 --- a/modules/nf-core/umicollapse/tests/main.nf.test +++ b/modules/nf-core/umicollapse/tests/main.nf.test @@ -7,63 +7,18 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "umicollapse" - tag "umitools/extract" - tag "samtools/index" - tag "bwa/index" - tag "bwa/mem" test("umicollapse single end test") { - setup{ - run("UMITOOLS_EXTRACT"){ - script "../../umitools/extract/main.nf" - config "./nextflow_SE.config" - process{ - """ - input[0] = [ - [ id:'test', single_end:true ], // meta map - [ - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) - ] - ] - """ - } - } - - run("BWA_INDEX"){ - script "../../bwa/index/main.nf" - process{ - """ - input[0] = [[ id:'sarscov2'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] - """ - } - } - run("BWA_MEM"){ - script "../../bwa/mem/main.nf" - process{ - """ - input[0] = UMITOOLS_EXTRACT.out.reads - input[1] = BWA_INDEX.out.index - input[2] = [[ id:'sarscov2'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] - input[3] = true - """ - } - } - run("SAMTOOLS_INDEX"){ - script "../../samtools/index/main.nf" - process{ - """ - input[0] = BWA_MEM.out.bam - """ - } - } - } when { - config "./nextflow_SE.config" + config "./nextflow.config" process { """ - input[0] = BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]) + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.umi.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.umi.sorted.bam.bai', checkIfExists: true) + ]) input[1] = 'bam' """ } @@ -73,7 +28,7 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - process.out.bam, + bam(process.out.bam[0][1]).getSamLinesMD5(), process.out.versions).match() } ) } @@ -81,60 +36,16 @@ nextflow_process { } test("umicollapse paired tests") { - setup{ - run("UMITOOLS_EXTRACT"){ - script "../../umitools/extract/main.nf" - config "./nextflow_PE.config" - process{ - """ - input[0] = [ - [ id:'test', single_end:false ], // meta map - [ - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) - ] - ] - """ - } - } - - run("BWA_INDEX"){ - script "../../bwa/index/main.nf" - process{ - """ - input[0] = [ - [ id:'sarscov2'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - run("BWA_MEM"){ - script "../../bwa/mem/main.nf" - process{ - """ - input[0] = UMITOOLS_EXTRACT.out.reads - input[1] = BWA_INDEX.out.index - input[2] = [[ id:'sarscov2'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] - input[3] = true - """ - } - } - run("SAMTOOLS_INDEX"){ - script "../../samtools/index/main.nf" - process{ - """ - input[0] = BWA_MEM.out.bam - """ - } - } - } when { - config "./nextflow_PE.config" + config "./nextflow.config" process { """ - input[0] = BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]) + input[0] = Channel.of([ + [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam.bai', checkIfExists: true) + ]) input[1] = 'bam' """ } @@ -144,22 +55,22 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - process.out.bam, + bam(process.out.bam[0][1]).getSamLinesMD5(), process.out.versions).match() } ) } } - test("umicollapse fastq tests") { + test("umicollapse fastq test (single-end)") { when { - config "./nextflow_SE.config" + config "./nextflow.config" process { """ input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test.umi_extract_single.fastq.gz', checkIfExists: true), [] ] input[1] = 'fastq' @@ -177,61 +88,76 @@ nextflow_process { } } - test("umicollapse stub tests") { - options "-stub-run" - setup{ - run("UMITOOLS_EXTRACT"){ - script "../../umitools/extract/main.nf" - config "./nextflow_PE.config" - process{ + test("umicollapse fastq test (paired-end)") { + + when { + config "./nextflow.config" + process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map - [ - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) - ] + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test.umi_extract_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test.umi_extract_2.fastq.gz', checkIfExists: true) ] + input[1] = 'fastq' """ } } - run("BWA_INDEX"){ - script "../../bwa/index/main.nf" - process{ - """ - input[0] = [ - [ id:'sarscov2'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - run("BWA_MEM"){ - script "../../bwa/mem/main.nf" - process{ - """ - input[0] = UMITOOLS_EXTRACT.out.reads - input[1] = BWA_INDEX.out.index - input[2] = [[ id:'sarscov2'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] - input[3] = true - """ - } + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.fastq, + process.out.versions).match() } + ) } - run("SAMTOOLS_INDEX"){ - script "../../samtools/index/main.nf" - process{ - """ - input[0] = BWA_MEM.out.bam - """ - } + } + + // Stub tests + + test("umicollapse single end test - stub") { + + options "-stub" + + when { + config "./nextflow.config" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.umi.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.umi.sorted.bam.bai', checkIfExists: true) + ]) + input[1] = 'bam' + """ } } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.bam, + process.out.versions).match() } + ) + } + + } + + test("umicollapse paired tests - stub") { + + options "-stub" + when { - config "./nextflow_PE.config" + config "./nextflow.config" process { """ - input[0] = BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]) + input[0] = Channel.of([ + [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam.bai', checkIfExists: true) + ]) input[1] = 'bam' """ } @@ -240,7 +166,9 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.bam, + process.out.versions).match() } ) } diff --git a/modules/nf-core/umicollapse/tests/main.nf.test.snap b/modules/nf-core/umicollapse/tests/main.nf.test.snap index bf6d5f30cb4..e903c0ce054 100644 --- a/modules/nf-core/umicollapse/tests/main.nf.test.snap +++ b/modules/nf-core/umicollapse/tests/main.nf.test.snap @@ -1,13 +1,38 @@ { "umicollapse single end test": { + "content": [ + "9158ea6e7a0e54819e25cbac5fbc5cc0", + [ + "versions.yml:md5,03fdbcb1ba9bd40325ca42859d39deb1" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.10.1" + }, + "timestamp": "2024-11-25T17:31:45.024306" + }, + "umicollapse paired tests": { + "content": [ + "b7be15ac7aae194b04bdbb56f3534495", + [ + "versions.yml:md5,03fdbcb1ba9bd40325ca42859d39deb1" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.10.1" + }, + "timestamp": "2024-11-25T17:31:52.072799" + }, + "umicollapse fastq test (paired-end)": { "content": [ [ [ { - "id": "test", - "single_end": true + "id": "test" }, - "test.dedup.bam:md5,89e844724f73fae9e7100506d0be5775" + "test.dedup.fastq.gz:md5,721a84a2accac988d636e837c60e47bc" ] ], [ @@ -15,12 +40,12 @@ ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.8.4", + "nextflow": "24.10.1" }, - "timestamp": "2024-10-22T10:43:04.890267074" + "timestamp": "2024-11-24T13:57:36.968147" }, - "umicollapse fastq tests": { + "umicollapse fastq test (single-end)": { "content": [ [ [ @@ -28,7 +53,7 @@ "id": "test", "single_end": true }, - "test.dedup.fastq.gz:md5,c9bac08c7fd8df3e0203e3eeafc73155" + "test.dedup.fastq.gz:md5,2e602ed23eb87f434e4f0a9e491c0310" ] ], [ @@ -36,89 +61,50 @@ ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.8.4", + "nextflow": "24.10.1" }, - "timestamp": "2024-10-22T10:43:45.691571914" + "timestamp": "2024-11-24T13:57:28.328682" }, - "umicollapse stub tests": { + "umicollapse single end test - stub": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.dedup.dedup.bam:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - - ], - "2": [ - [ - { - "id": "test", - "single_end": false - }, - "test.dedup_UMICollapse.log:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "3": [ - "versions.yml:md5,c1e0275d81b1c97a9344d216f9154996" - ], - "bam": [ - [ - { - "id": "test", - "single_end": false - }, - "test.dedup.dedup.bam:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "fastq": [ - - ], - "log": [ - [ - { - "id": "test", - "single_end": false - }, - "test.dedup_UMICollapse.log:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "versions": [ - "versions.yml:md5,c1e0275d81b1c97a9344d216f9154996" + [ + [ + { + "id": "test", + "single_end": true + }, + "test.dedup.dedup.bam:md5,d41d8cd98f00b204e9800998ecf8427e" ] - } + ], + [ + "versions.yml:md5,c1e0275d81b1c97a9344d216f9154996" + ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.10.1" }, - "timestamp": "2024-01-30T10:46:12.482697713" + "timestamp": "2024-11-24T14:09:40.277318" }, - "umicollapse paired tests": { + "umicollapse paired tests - stub": { "content": [ [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test.dedup.bam:md5,3e2ae4701e3d2ca074ea878a314a3e4f" + "test.dedup.dedup.bam:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], [ - "versions.yml:md5,03fdbcb1ba9bd40325ca42859d39deb1" + "versions.yml:md5,c1e0275d81b1c97a9344d216f9154996" ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.8.4", + "nextflow": "24.10.1" }, - "timestamp": "2024-10-22T10:43:33.250587075" + "timestamp": "2024-11-24T14:09:44.224965" } } \ No newline at end of file diff --git a/modules/nf-core/umicollapse/tests/nextflow.config b/modules/nf-core/umicollapse/tests/nextflow.config index 844edbdc671..105d8e13261 100644 --- a/modules/nf-core/umicollapse/tests/nextflow.config +++ b/modules/nf-core/umicollapse/tests/nextflow.config @@ -1,8 +1,5 @@ process { - withName: UMITOOLS_EXTRACT { - ext.args = '--bc-pattern="NNNN"' - } withName: UMICOLLAPSE { ext.prefix = { "${meta.id}.dedup" } } -} \ No newline at end of file +} diff --git a/modules/nf-core/umicollapse/tests/nextflow_PE.config b/modules/nf-core/umicollapse/tests/nextflow_PE.config deleted file mode 100644 index ae4c96320e9..00000000000 --- a/modules/nf-core/umicollapse/tests/nextflow_PE.config +++ /dev/null @@ -1,10 +0,0 @@ -process { - - withName: UMITOOLS_EXTRACT { - ext.args = '--bc-pattern="NNNN" --bc-pattern2="NNNN"' - } - - withName: UMICOLLAPSE { - ext.prefix = { "${meta.id}.dedup" } - } -} diff --git a/modules/nf-core/umicollapse/tests/nextflow_SE.config b/modules/nf-core/umicollapse/tests/nextflow_SE.config deleted file mode 100644 index d4b9443652a..00000000000 --- a/modules/nf-core/umicollapse/tests/nextflow_SE.config +++ /dev/null @@ -1,10 +0,0 @@ -process { - - withName: UMITOOLS_EXTRACT { - ext.args = '--bc-pattern="NNNN"' - } - - withName: UMICOLLAPSE { - ext.prefix = { "${meta.id}.dedup" } - } -} diff --git a/modules/nf-core/umitools/dedup/tests/main.nf.test b/modules/nf-core/umitools/dedup/tests/main.nf.test index ab4455366e7..f00a8cbed7b 100644 --- a/modules/nf-core/umitools/dedup/tests/main.nf.test +++ b/modules/nf-core/umitools/dedup/tests/main.nf.test @@ -19,8 +19,8 @@ nextflow_process { input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.sorted.bam", checkIfExists: true), - file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai", checkIfExists: true) + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.umi.sorted.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.umi.sorted.bam.bai", checkIfExists: true) ] input[1] = get_output_stats """ @@ -48,8 +48,8 @@ nextflow_process { input[0] = [ [ id:'test', single_end:false ], // 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/illumina/bam/test.paired_end.sorted.bam.bai", checkIfExists: true) + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam.bai", checkIfExists: true) ] input[1] = get_output_stats """ @@ -61,7 +61,7 @@ nextflow_process { { assert process.success }, { assert path("${process.out.log[0][1]}").exists() }, { assert snapshot( - process.out.bam, + bam(process.out.bam[0][1]).getSamLinesMD5(), process.out.versions).match() } ) } @@ -77,8 +77,8 @@ nextflow_process { input[0] = [ [ id:'test', single_end:false ], // 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/illumina/bam/test.paired_end.sorted.bam.bai", checkIfExists: true) + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam.bai", checkIfExists: true) ] input[1] = get_output_stats """ @@ -90,7 +90,7 @@ nextflow_process { { assert process.success }, { assert path("${process.out.log[0][1]}").exists() }, { assert snapshot( - process.out.bam, + bam(process.out.bam[0][1]).getSamLinesMD5(), process.out.tsv_edit_distance, process.out.tsv_per_umi, process.out.tsv_umi_per_position, @@ -112,8 +112,8 @@ nextflow_process { input[0] = [ [ id:'test', single_end:true ], // meta map - file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.sorted.bam", checkIfExists: true), - file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai", checkIfExists: true) + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.umi.sorted.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.umi.sorted.bam.bai", checkIfExists: true) ] input[1] = get_output_stats """ @@ -141,8 +141,8 @@ nextflow_process { input[0] = [ [ id:'test', single_end:false ], // 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/illumina/bam/test.paired_end.sorted.bam.bai", checkIfExists: true) + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam.bai", checkIfExists: true) ] input[1] = get_output_stats """ @@ -170,8 +170,8 @@ nextflow_process { input[0] = [ [ id:'test', single_end:false ], // 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/illumina/bam/test.paired_end.sorted.bam.bai", checkIfExists: true) + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam.bai", checkIfExists: true) ] input[1] = get_output_stats """ diff --git a/modules/nf-core/umitools/dedup/tests/main.nf.test.snap b/modules/nf-core/umitools/dedup/tests/main.nf.test.snap index f7f4e94f196..04b81692a6d 100644 --- a/modules/nf-core/umitools/dedup/tests/main.nf.test.snap +++ b/modules/nf-core/umitools/dedup/tests/main.nf.test.snap @@ -37,13 +37,14 @@ }, "pe - with stats": { "content": [ + "b7be15ac7aae194b04bdbb56f3534495", [ [ { "id": "test", "single_end": false }, - "test.dedup.bam:md5,350e942a0d45e8356fa24bc8c47dc1ed" + "test.dedup_edit_distance.tsv:md5,c247a49b58768e6e2e86a6c08483e612" ] ], [ @@ -52,7 +53,7 @@ "id": "test", "single_end": false }, - "test.dedup_edit_distance.tsv:md5,65186b0964e2f8d970cc04d736d8b119" + "test.dedup_per_umi.tsv:md5,ced75f7bdbf38bf78f3137d5325a8773" ] ], [ @@ -61,16 +62,7 @@ "id": "test", "single_end": false }, - "test.dedup_per_umi.tsv:md5,8e6783a4a79437b095f095f2aefe7c01" - ] - ], - [ - [ - { - "id": "test", - "single_end": false - }, - "test.dedup_per_umi_per_position.tsv:md5,9386db4a104b8e4e32f3ca4a84efa4ac" + "test.dedup_per_umi_per_position.tsv:md5,2e1a12e6f720510880068deddeefe063" ] ], [ @@ -79,9 +71,9 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nextflow": "24.10.1" }, - "timestamp": "2024-07-03T11:27:24.231325" + "timestamp": "2024-11-25T17:25:28.939957" }, "se - no stats - stub": { "content": [ @@ -103,36 +95,28 @@ }, "se - no stats": { "content": [ - "a114abd9fccce6fe2869852b5cd18964", + "9158ea6e7a0e54819e25cbac5fbc5cc0", [ "versions.yml:md5,e2f5146464c09bf7ae98c85ea5410e50" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nextflow": "24.10.1" }, - "timestamp": "2024-07-03T13:45:48.553561" + "timestamp": "2024-11-23T09:06:54.373171" }, "pe - no stats": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.dedup.bam:md5,350e942a0d45e8356fa24bc8c47dc1ed" - ] - ], + "b7be15ac7aae194b04bdbb56f3534495", [ "versions.yml:md5,e2f5146464c09bf7ae98c85ea5410e50" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nextflow": "24.10.1" }, - "timestamp": "2024-07-03T11:27:06.957467" + "timestamp": "2024-11-25T17:24:51.423637" } } \ No newline at end of file diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umicollapse/tests/main.nf.test b/subworkflows/nf-core/bam_dedup_stats_samtools_umicollapse/tests/main.nf.test index dd7f2371869..f4f14c71b9c 100644 --- a/subworkflows/nf-core/bam_dedup_stats_samtools_umicollapse/tests/main.nf.test +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umicollapse/tests/main.nf.test @@ -22,55 +22,6 @@ nextflow_workflow { test("sarscov2_bam_bai") { - setup{ - run("UMITOOLS_EXTRACT"){ - script "../../../../modules/nf-core/umitools/extract/main.nf" - config "./paired-end-umis.config" - process{ - """ - input[0] = [ - [ id:'test', single_end:false ], // meta map - [ - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) - ] - ] - """ - } - } - - run("BWA_INDEX"){ - script "../../../../modules/nf-core/bwa/index/main.nf" - process{ - """ - input[0] = [ - [ id:'sarscov2'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - run("BWA_MEM"){ - script "../../../../modules/nf-core/bwa/mem/main.nf" - process{ - """ - input[0] = UMITOOLS_EXTRACT.out.reads - input[1] = BWA_INDEX.out.index - input[2] = [[ id:'sarscov2'],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)] - input[3] = true - """ - } - } - run("SAMTOOLS_INDEX"){ - script "../../../../modules/nf-core/samtools/index/main.nf" - process{ - """ - input[0] = BWA_MEM.out.bam - """ - } - } - } - when { config "./paired-end-umis.config" params { @@ -78,9 +29,11 @@ nextflow_workflow { } workflow { """ - - input[0] = BWA_MEM.out.bam.join(SAMTOOLS_INDEX.out.bai, by: [0]) - + input[0] = Channel.of([ + [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam.bai', checkIfExists: true) + ]) """ } } @@ -88,7 +41,8 @@ nextflow_workflow { then { assertAll( { assert workflow.success}, - { assert snapshot(workflow.out.bam, workflow.out.versions).match() }, + { assert snapshot(bam(workflow.out.bam[0][1]).getSamLinesMD5()).match("test_bam_dedup_stats_samtools_umicollapse_bam")}, // separate, because of linting error otherwise + { assert snapshot(workflow.out.versions).match("test_bam_dedup_stats_samtools_umicollapse_versions") }, { assert workflow.out.bam.get(0).get(1) ==~ ".*.bam"}, { assert workflow.out.bai.get(0).get(1) ==~ ".*.bai"}, { assert workflow.out.dedup_stats.get(0).get(1) ==~ ".*_UMICollapse.log"}, diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umicollapse/tests/main.nf.test.snap b/subworkflows/nf-core/bam_dedup_stats_samtools_umicollapse/tests/main.nf.test.snap index f2b1fb20d9a..9694c6d5f68 100644 --- a/subworkflows/nf-core/bam_dedup_stats_samtools_umicollapse/tests/main.nf.test.snap +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umicollapse/tests/main.nf.test.snap @@ -4,69 +4,57 @@ [ [ { - "id": "test", - "single_end": false + "id": "test" }, "test.stats:md5,498621f92e86d55e4f7ae93170e6e733" ] ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.8.4", + "nextflow": "24.10.1" }, - "timestamp": "2024-09-16T08:04:02.179870196" + "timestamp": "2024-11-24T13:57:02.323104" }, - "test_bam_dedup_stats_samtools_umicollapse_flagstats": { + "test_bam_dedup_stats_samtools_umicollapse_versions": { "content": [ [ - [ - { - "id": "test", - "single_end": false - }, - "test.flagstat:md5,18d602435a02a4d721b78d1812622159" - ] + "versions.yml:md5,20605eb79c410c0ed179ba660d82f75b", + "versions.yml:md5,23617661d2c899996bee2b05db027e25", + "versions.yml:md5,657bce03545b4c57f9c5fc4314bf85f7", + "versions.yml:md5,e02a62a393a833778e16542eeed0d148", + "versions.yml:md5,ef00762e264b99ac45713dc0dedf4060" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.10.1" }, - "timestamp": "2024-04-09T17:05:48.69612524" + "timestamp": "2024-11-25T18:39:15.637444" }, - "sarscov2_bam_bai": { + "test_bam_dedup_stats_samtools_umicollapse_flagstats": { "content": [ [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test.dedup.bam:md5,3e2ae4701e3d2ca074ea878a314a3e4f" + "test.flagstat:md5,18d602435a02a4d721b78d1812622159" ] - ], - [ - "versions.yml:md5,20605eb79c410c0ed179ba660d82f75b", - "versions.yml:md5,23617661d2c899996bee2b05db027e25", - "versions.yml:md5,657bce03545b4c57f9c5fc4314bf85f7", - "versions.yml:md5,e02a62a393a833778e16542eeed0d148", - "versions.yml:md5,ef00762e264b99ac45713dc0dedf4060" ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.8.4", + "nextflow": "24.10.1" }, - "timestamp": "2024-10-22T10:44:38.266860983" + "timestamp": "2024-11-24T13:57:02.366866" }, "test_bam_dedup_stats_samtools_umicollapse_idxstats": { "content": [ [ [ { - "id": "test", - "single_end": false + "id": "test" }, "test.idxstats:md5,85d20a901eef23ca50c323638a2eb602" ] @@ -74,8 +62,18 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.10.1" + }, + "timestamp": "2024-11-24T13:57:02.410712" + }, + "test_bam_dedup_stats_samtools_umicollapse_bam": { + "content": [ + "b7be15ac7aae194b04bdbb56f3534495" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.10.1" }, - "timestamp": "2024-04-09T17:05:48.740441747" + "timestamp": "2024-11-25T18:39:15.613319" } } \ No newline at end of file diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umicollapse/tests/paired-end-umis.config b/subworkflows/nf-core/bam_dedup_stats_samtools_umicollapse/tests/paired-end-umis.config index 602c026f058..8d58a861f4b 100644 --- a/subworkflows/nf-core/bam_dedup_stats_samtools_umicollapse/tests/paired-end-umis.config +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umicollapse/tests/paired-end-umis.config @@ -1,10 +1,6 @@ process { - withName: UMITOOLS_EXTRACT { - ext.args = '--bc-pattern="NNNN" --bc-pattern2="NNNN"' - } - withName: UMICOLLAPSE { ext.prefix = { "${meta.id}.dedup" } } -} \ No newline at end of file +} diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test index 9d38022b4bf..93e62485764 100644 --- a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test @@ -26,8 +26,8 @@ nextflow_workflow { 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/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam.bai', checkIfExists: true) ]) input[1] = val_get_dedup_stats """ @@ -41,6 +41,7 @@ nextflow_workflow { { assert workflow.out.bam.get(0).get(1) ==~ ".*.bam"}, { assert workflow.out.bai.get(0).get(1) ==~ ".*.bai"}, { assert snapshot( + bam(workflow.out.bam[0][1]).getSamLinesMD5(), workflow.out.stats, workflow.out.flagstat, workflow.out.idxstats, @@ -61,8 +62,8 @@ nextflow_workflow { 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/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.umi.sorted.bam.bai', checkIfExists: true) ]) input[1] = val_get_dedup_stats """ diff --git a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test.snap b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test.snap index d39f9129b9a..3b36135720b 100644 --- a/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test.snap +++ b/subworkflows/nf-core/bam_dedup_stats_samtools_umitools/tests/main.nf.test.snap @@ -1,12 +1,13 @@ { "sarscov2_bam_bai": { "content": [ + "b7be15ac7aae194b04bdbb56f3534495", [ [ { "id": "test" }, - "test.stats:md5,84891a894010aeb882c4092db9248d2c" + "test.stats:md5,41ba57a9b90b54587e7d154e5405ea5e" ] ], [ @@ -14,7 +15,7 @@ { "id": "test" }, - "test.flagstat:md5,0bb716e40fae381b97484b58e0b16efe" + "test.flagstat:md5,18d602435a02a4d721b78d1812622159" ] ], [ @@ -22,7 +23,7 @@ { "id": "test" }, - "test.idxstats:md5,1adb27b52d4d64b826f48b59d61dcd4d" + "test.idxstats:md5,85d20a901eef23ca50c323638a2eb602" ] ], [ @@ -34,10 +35,10 @@ ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.8.4", + "nextflow": "24.10.1" }, - "timestamp": "2024-09-16T08:04:23.444693448" + "timestamp": "2024-11-25T17:23:13.841219" }, "sarscov2_bam_bai - stub": { "content": [