diff --git a/CHANGELOG.md b/CHANGELOG.md index c61444874..3da552eb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -97,6 +97,7 @@ Thank you to everyone else that has contributed by reporting bugs, enhancements - [PR #1329](https://github.com/nf-core/rnaseq/pull/1329) - Remove tags from all nf-test files - [PR #1330](https://github.com/nf-core/rnaseq/pull/1330) - Update all nf-core/modules and subworkflows - [PR #1331](https://github.com/nf-core/rnaseq/pull/1331) - Adding stubs for local modules +- [PR #1334](https://github.com/nf-core/rnaseq/pull/1334) - Update all nf-core/modules and subworkflows with stubs ### Parameters diff --git a/modules.json b/modules.json index 4ee9cf73f..506e788c2 100644 --- a/modules.json +++ b/modules.json @@ -113,52 +113,52 @@ }, "rsem/calculateexpression": { "branch": "master", - "git_sha": "7c82eda52cb493c4cf500e3fb7d1597a5d766165", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["modules"] }, "rsem/preparereference": { "branch": "master", - "git_sha": "301b088c7e9e00c4c80686411383f07173b54d69", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["modules"] }, "rseqc/bamstat": { "branch": "master", - "git_sha": "9eb22e4d3f28c274b7c498a1564581377349a242", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["bam_rseqc"] }, "rseqc/inferexperiment": { "branch": "master", - "git_sha": "6c7d8f1d6247655e4bc4d97f37b68b2461f645f6", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["bam_rseqc"] }, "rseqc/innerdistance": { "branch": "master", - "git_sha": "6c7d8f1d6247655e4bc4d97f37b68b2461f645f6", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["bam_rseqc"] }, "rseqc/junctionannotation": { "branch": "master", - "git_sha": "6c7d8f1d6247655e4bc4d97f37b68b2461f645f6", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["bam_rseqc"] }, "rseqc/junctionsaturation": { "branch": "master", - "git_sha": "6c7d8f1d6247655e4bc4d97f37b68b2461f645f6", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["bam_rseqc"] }, "rseqc/readdistribution": { "branch": "master", - "git_sha": "6c7d8f1d6247655e4bc4d97f37b68b2461f645f6", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["bam_rseqc"] }, "rseqc/readduplication": { "branch": "master", - "git_sha": "6c7d8f1d6247655e4bc4d97f37b68b2461f645f6", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["bam_rseqc"] }, "rseqc/tin": { "branch": "master", - "git_sha": "6c7d8f1d6247655e4bc4d97f37b68b2461f645f6", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["bam_rseqc"] }, "salmon/index": { @@ -222,7 +222,7 @@ }, "subread/featurecounts": { "branch": "master", - "git_sha": "e5265c217dcfbff7731c40623aaf07538fdd3e1c", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["modules"] }, "summarizedexperiment/summarizedexperiment": { @@ -232,7 +232,7 @@ }, "trimgalore": { "branch": "master", - "git_sha": "a98418419ae6c9df3cf6cf108d1e1aba71037d5a", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["fastq_fastqc_umitools_trimgalore"] }, "tximeta/tximport": { @@ -242,7 +242,7 @@ }, "ucsc/bedclip": { "branch": "master", - "git_sha": "7c75d01997236f61b9b77399d9933cb36041f2c3", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["bedgraph_bedclip_bedgraphtobigwig"] }, "ucsc/bedgraphtobigwig": { @@ -257,7 +257,7 @@ }, "umitools/extract": { "branch": "master", - "git_sha": "d2c5e76f291379f3dd403e48e46ed7e6ba5da744", + "git_sha": "b4919e9a2b4d8b71061e601633db4600a3858fa1", "installed_by": ["fastq_fastqc_umitools_fastp", "fastq_fastqc_umitools_trimgalore"] }, "umitools/prepareforrsem": { @@ -310,12 +310,12 @@ }, "fastq_align_hisat2": { "branch": "master", - "git_sha": "2c6b1144ed58b6184ad58fc4e6b6a90219b4bf4f", + "git_sha": "c60c14b285b89bdd0607e371417dadb80385ad6e", "installed_by": ["subworkflows"] }, "fastq_fastqc_umitools_fastp": { "branch": "master", - "git_sha": "b90b5cd93149a1b3be263d916c7234fe0708a71c", + "git_sha": "db35d26edeafacf9906a517827df621a29adc13d", "installed_by": ["subworkflows"] }, "fastq_fastqc_umitools_trimgalore": { diff --git a/modules/nf-core/rsem/calculateexpression/main.nf b/modules/nf-core/rsem/calculateexpression/main.nf index 8d88a56b2..40bddc5e5 100644 --- a/modules/nf-core/rsem/calculateexpression/main.nf +++ b/modules/nf-core/rsem/calculateexpression/main.nf @@ -54,4 +54,22 @@ process RSEM_CALCULATEEXPRESSION { star: \$(STAR --version | sed -e "s/STAR_//g") END_VERSIONS """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.genes.results + touch ${prefix}.isoforms.results + touch ${prefix}.stat + touch ${prefix}.log + touch ${prefix}.STAR.genome.bam + touch ${prefix}.genome.bam + touch ${prefix}.transcript.bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rsem: \$(rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g") + star: \$(STAR --version | sed -e "s/STAR_//g") + END_VERSIONS + """ } diff --git a/modules/nf-core/rsem/calculateexpression/tests/main.nf.test b/modules/nf-core/rsem/calculateexpression/tests/main.nf.test index 3ab43eb1a..7af876dd8 100644 --- a/modules/nf-core/rsem/calculateexpression/tests/main.nf.test +++ b/modules/nf-core/rsem/calculateexpression/tests/main.nf.test @@ -4,7 +4,7 @@ nextflow_process { script "../main.nf" process "RSEM_CALCULATEEXPRESSION" config "./nextflow.config" - + test("homo_sapiens") { setup { @@ -46,7 +46,43 @@ nextflow_process { { assert snapshot(process.out.versions).match("versions") } ) } - } + test("homo_sapiens - stub") { + + options "-stub" + + setup { + run("RSEM_PREPAREREFERENCE") { + script "../../../rsem/preparereference/main.nf" + process { + """ + input[0] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)) + input[1] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true)) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', strandedness: 'forward' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_rnaseq_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_rnaseq_2.fastq.gz', checkIfExists: true) + ] + ]) + input[1] = RSEM_PREPAREREFERENCE.out.index + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } diff --git a/modules/nf-core/rsem/calculateexpression/tests/main.nf.test.snap b/modules/nf-core/rsem/calculateexpression/tests/main.nf.test.snap index c8a535e19..61647071d 100644 --- a/modules/nf-core/rsem/calculateexpression/tests/main.nf.test.snap +++ b/modules/nf-core/rsem/calculateexpression/tests/main.nf.test.snap @@ -15,8 +15,155 @@ ] ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-22T13:14:18.68683" }, + "homo_sapiens - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.genes.results:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.isoforms.results:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.stat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,823e53afe1ff4f3930ae8392f9f8dd5c" + ], + "5": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.STAR.genome.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.genome.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.transcript.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bam_genome": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.genome.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bam_star": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.STAR.genome.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bam_transcript": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.transcript.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "counts_gene": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.genes.results:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "counts_transcript": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.isoforms.results:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "logs": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stat": [ + [ + { + "id": "test", + "strandedness": "forward" + }, + "test.stat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,823e53afe1ff4f3930ae8392f9f8dd5c" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T09:04:38.064594" + }, "counts_transcript": { "content": [ [ @@ -29,6 +176,10 @@ ] ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-22T13:14:18.682898" }, "versions": { @@ -37,6 +188,10 @@ "versions.yml:md5,823e53afe1ff4f3930ae8392f9f8dd5c" ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-22T13:14:18.700958" }, "counts_gene": { @@ -51,6 +206,10 @@ ] ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-22T13:14:18.670998" } } \ No newline at end of file diff --git a/modules/nf-core/rsem/preparereference/main.nf b/modules/nf-core/rsem/preparereference/main.nf index 44f76ebd6..1acfbdedb 100644 --- a/modules/nf-core/rsem/preparereference/main.nf +++ b/modules/nf-core/rsem/preparereference/main.nf @@ -69,4 +69,15 @@ process RSEM_PREPAREREFERENCE { END_VERSIONS """ } + + stub: + """ + touch genome.transcripts.fa + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rsem: \$(rsem-calculate-expression --version | sed -e "s/Current version: RSEM v//g") + star: \$(STAR --version | sed -e "s/STAR_//g") + END_VERSIONS + """ } diff --git a/modules/nf-core/rsem/preparereference/tests/main.nf.test b/modules/nf-core/rsem/preparereference/tests/main.nf.test index 4353d4d9b..210e03e87 100644 --- a/modules/nf-core/rsem/preparereference/tests/main.nf.test +++ b/modules/nf-core/rsem/preparereference/tests/main.nf.test @@ -26,7 +26,26 @@ nextflow_process { { assert snapshot(process.out.versions).match("versions") } ) } - } + test("homo_sapiens - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)) + input[1] = Channel.of(file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists: true)) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } diff --git a/modules/nf-core/rsem/preparereference/tests/main.nf.test.snap b/modules/nf-core/rsem/preparereference/tests/main.nf.test.snap index 02510659a..667416bff 100644 --- a/modules/nf-core/rsem/preparereference/tests/main.nf.test.snap +++ b/modules/nf-core/rsem/preparereference/tests/main.nf.test.snap @@ -1,10 +1,47 @@ { + "homo_sapiens - stub": { + "content": [ + { + "0": [ + [ + "genome.fasta:md5,f315020d899597c1b57e5fe9f60f4c3e" + ] + ], + "1": [ + "genome.transcripts.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "2": [ + "versions.yml:md5,517611c42f6354d3609db1b35fffa397" + ], + "index": [ + [ + "genome.fasta:md5,f315020d899597c1b57e5fe9f60f4c3e" + ] + ], + "transcript_fasta": [ + "genome.transcripts.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "versions": [ + "versions.yml:md5,517611c42f6354d3609db1b35fffa397" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T09:00:50.389847" + }, "versions": { "content": [ [ "versions.yml:md5,517611c42f6354d3609db1b35fffa397" ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-22T13:16:49.170587" }, "index": { @@ -22,6 +59,10 @@ ] ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-22T13:16:49.140398" }, "transcript_fasta": { @@ -30,6 +71,10 @@ "genome.transcripts.fa:md5,050c521a2719c2ae48267c1e65218f29" ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-22T13:16:49.159946" } } \ No newline at end of file diff --git a/modules/nf-core/rseqc/bamstat/main.nf b/modules/nf-core/rseqc/bamstat/main.nf index 7db4c69bd..167240c46 100644 --- a/modules/nf-core/rseqc/bamstat/main.nf +++ b/modules/nf-core/rseqc/bamstat/main.nf @@ -31,4 +31,15 @@ process RSEQC_BAMSTAT { rseqc: \$(bam_stat.py --version | sed -e "s/bam_stat.py //g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bam_stat.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rseqc: \$(bam_stat.py --version | sed -e "s/bam_stat.py //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/rseqc/bamstat/tests/main.nf.test b/modules/nf-core/rseqc/bamstat/tests/main.nf.test index 6a64b602b..fd6fc0811 100644 --- a/modules/nf-core/rseqc/bamstat/tests/main.nf.test +++ b/modules/nf-core/rseqc/bamstat/tests/main.nf.test @@ -3,19 +3,14 @@ nextflow_process { name "Test Process RSEQC_BAMSTAT" script "../main.nf" process "RSEQC_BAMSTAT" - config "./nextflow.config" test("sarscov2 - [meta] - bam") { when { - params { - // define parameters here. Example: - // outdir = "tests/results" - } process { """ - input[0] = [ + input[0] = [ [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam') ] @@ -27,7 +22,26 @@ nextflow_process { assert process.success assert snapshot(process.out).match() } - } + test("sarscov2 - [meta] - bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam') + ] + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + } } diff --git a/modules/nf-core/rseqc/bamstat/tests/main.nf.test.snap b/modules/nf-core/rseqc/bamstat/tests/main.nf.test.snap index 6e3f0364e..deae0e80d 100644 --- a/modules/nf-core/rseqc/bamstat/tests/main.nf.test.snap +++ b/modules/nf-core/rseqc/bamstat/tests/main.nf.test.snap @@ -1,4 +1,37 @@ { + "sarscov2 - [meta] - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bam_stat.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,58f74a7ff9d2966142c81a4a4735dbf3" + ], + "txt": [ + [ + { + "id": "test" + }, + "test.bam_stat.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,58f74a7ff9d2966142c81a4a4735dbf3" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T09:16:13.970299" + }, "sarscov2 - [meta] - bam": { "content": [ { diff --git a/modules/nf-core/rseqc/inferexperiment/main.nf b/modules/nf-core/rseqc/inferexperiment/main.nf index 39fe816d3..87c676ada 100644 --- a/modules/nf-core/rseqc/inferexperiment/main.nf +++ b/modules/nf-core/rseqc/inferexperiment/main.nf @@ -33,4 +33,15 @@ process RSEQC_INFEREXPERIMENT { rseqc: \$(infer_experiment.py --version | sed -e "s/infer_experiment.py //g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.infer_experiment.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rseqc: \$(infer_experiment.py --version | sed -e "s/infer_experiment.py //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test b/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test index 6218de6d8..375f65357 100644 --- a/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test +++ b/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test @@ -24,4 +24,26 @@ nextflow_process { assert snapshot(process.out).match() } } + + test("sarscov2 - [[meta] - bam] - bed - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam", checkIfExists: true) + ]) + input[1] = Channel.of(file(params.modules_testdata_base_path + "genomics/sarscov2/genome/bed/test.bed", checkIfExists: true)) + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + } } diff --git a/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test.snap b/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test.snap index 1283b47f1..e31c1129f 100644 --- a/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test.snap +++ b/modules/nf-core/rseqc/inferexperiment/tests/main.nf.test.snap @@ -1,4 +1,37 @@ { + "sarscov2 - [[meta] - bam] - bed - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.infer_experiment.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,f56ba5c6208ae720dd730f3a432e3ba7" + ], + "txt": [ + [ + { + "id": "test" + }, + "test.infer_experiment.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,f56ba5c6208ae720dd730f3a432e3ba7" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T09:34:31.050305" + }, "sarscov2 - [[meta] - bam] - bed": { "content": [ { diff --git a/modules/nf-core/rseqc/innerdistance/main.nf b/modules/nf-core/rseqc/innerdistance/main.nf index de7e302d7..207f5fb4d 100644 --- a/modules/nf-core/rseqc/innerdistance/main.nf +++ b/modules/nf-core/rseqc/innerdistance/main.nf @@ -48,4 +48,19 @@ process RSEQC_INNERDISTANCE { END_VERSIONS """ } + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.inner_distance.txt + touch ${prefix}.inner_distance_freq.txt + touch ${prefix}.inner_distance_mean.txt + touch ${prefix}.inner_distance_plot.pdf + touch ${prefix}.inner_distance_plot.r + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rseqc: \$(inner_distance.py --version | sed -e "s/inner_distance.py //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/rseqc/innerdistance/tests/main.nf.test b/modules/nf-core/rseqc/innerdistance/tests/main.nf.test index 2d4cc4fd6..e54036f8a 100644 --- a/modules/nf-core/rseqc/innerdistance/tests/main.nf.test +++ b/modules/nf-core/rseqc/innerdistance/tests/main.nf.test @@ -31,4 +31,28 @@ nextflow_process { ) } } + + test("sarscov2 - [[meta] - bam] - bed - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam", checkIfExists: true) + ]) + input[1] = Channel.of(file(params.modules_testdata_base_path + "genomics/sarscov2/genome/bed/test.bed12", checkIfExists: true)) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } diff --git a/modules/nf-core/rseqc/innerdistance/tests/main.nf.test.snap b/modules/nf-core/rseqc/innerdistance/tests/main.nf.test.snap index 267a9a3ba..83f33363a 100644 --- a/modules/nf-core/rseqc/innerdistance/tests/main.nf.test.snap +++ b/modules/nf-core/rseqc/innerdistance/tests/main.nf.test.snap @@ -72,6 +72,103 @@ }, "timestamp": "2024-02-26T14:33:42.470638" }, + "sarscov2 - [[meta] - bam] - bed - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.inner_distance.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.inner_distance_freq.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test.inner_distance_mean.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test" + }, + "test.inner_distance_plot.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test" + }, + "test.inner_distance_plot.r:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "5": [ + "versions.yml:md5,3ca19644c7f02a53db3ffe50c7706797" + ], + "distance": [ + [ + { + "id": "test" + }, + "test.inner_distance.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "freq": [ + [ + { + "id": "test" + }, + "test.inner_distance_freq.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "mean": [ + [ + { + "id": "test" + }, + "test.inner_distance_mean.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "pdf": [ + [ + { + "id": "test" + }, + "test.inner_distance_plot.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "rscript": [ + [ + { + "id": "test" + }, + "test.inner_distance_plot.r:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,3ca19644c7f02a53db3ffe50c7706797" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T09:22:20.844642" + }, "freq": { "content": [ [ diff --git a/modules/nf-core/rseqc/junctionannotation/main.nf b/modules/nf-core/rseqc/junctionannotation/main.nf index 4e1b03b61..9a8a4653a 100644 --- a/modules/nf-core/rseqc/junctionannotation/main.nf +++ b/modules/nf-core/rseqc/junctionannotation/main.nf @@ -40,4 +40,21 @@ process RSEQC_JUNCTIONANNOTATION { rseqc: \$(junction_annotation.py --version | sed -e "s/junction_annotation.py //g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.junction.xls + touch ${prefix}.junction_plot.r + touch ${prefix}.junction_annotation.log + touch ${prefix}.junction.bed + touch ${prefix}.Interact.bed + touch ${prefix}.junction.pdf + touch ${prefix}.events.pdf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rseqc: \$(junction_annotation.py --version | sed -e "s/junction_annotation.py //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test b/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test index 885d9a7b7..8a05bccab 100644 --- a/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test +++ b/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test @@ -28,4 +28,28 @@ nextflow_process { ) } } + + test("sarscov2 - paired end [bam] - stub") { + + options "-stub" + + 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] = Channel.of(file(params.modules_testdata_base_path + "genomics/sarscov2/genome/bed/test.bed", checkIfExists: true)) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } diff --git a/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test.snap b/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test.snap index f24a00776..e87594f0b 100644 --- a/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test.snap +++ b/modules/nf-core/rseqc/junctionannotation/tests/main.nf.test.snap @@ -28,5 +28,148 @@ "nextflow": "24.01.0" }, "timestamp": "2024-02-26T14:32:52.734515" + }, + "sarscov2 - paired end [bam] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junction.xls:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junction_plot.r:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junction_annotation.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junction.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.Interact.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junction.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.events.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + "versions.yml:md5,091865c0ebd6de262c9b0968b5771091" + ], + "bed": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junction.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "events_pdf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.events.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "interact_bed": [ + [ + { + "id": "test", + "single_end": false + }, + "test.Interact.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junction_annotation.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "pdf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junction.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "rscript": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junction_plot.r:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,091865c0ebd6de262c9b0968b5771091" + ], + "xls": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junction.xls:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T09:39:10.213511" } } \ No newline at end of file diff --git a/modules/nf-core/rseqc/junctionsaturation/main.nf b/modules/nf-core/rseqc/junctionsaturation/main.nf index 1b10ab744..18f063f38 100644 --- a/modules/nf-core/rseqc/junctionsaturation/main.nf +++ b/modules/nf-core/rseqc/junctionsaturation/main.nf @@ -34,4 +34,16 @@ process RSEQC_JUNCTIONSATURATION { rseqc: \$(junction_saturation.py --version | sed -e "s/junction_saturation.py //g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.junctionSaturation_plot.pdf + touch ${prefix}.junctionSaturation_plot.r + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rseqc: \$(junction_saturation.py --version | sed -e "s/junction_saturation.py //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test b/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test index b8b4381b4..69d7f0c5d 100644 --- a/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test +++ b/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test @@ -27,4 +27,28 @@ nextflow_process { ) } } + + test("sarscov2 paired-end [bam] - stub") { + + options "-stub" + + 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] = file(params.modules_testdata_base_path + "genomics/sarscov2/genome/bed/test.bed", checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } diff --git a/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test.snap b/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test.snap index 6d83eb5f2..8d702a4ef 100644 --- a/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test.snap +++ b/modules/nf-core/rseqc/junctionsaturation/tests/main.nf.test.snap @@ -38,5 +38,58 @@ "nextflow": "24.01.0" }, "timestamp": "2024-02-26T14:32:24.021984" + }, + "sarscov2 paired-end [bam] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junctionSaturation_plot.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junctionSaturation_plot.r:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,cd4638541a825dbd44e3cb65d2980aa1" + ], + "pdf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junctionSaturation_plot.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "rscript": [ + [ + { + "id": "test", + "single_end": false + }, + "test.junctionSaturation_plot.r:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,cd4638541a825dbd44e3cb65d2980aa1" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T09:43:55.853893" } } \ No newline at end of file diff --git a/modules/nf-core/rseqc/readdistribution/main.nf b/modules/nf-core/rseqc/readdistribution/main.nf index e0d8bfe9d..1d9406491 100644 --- a/modules/nf-core/rseqc/readdistribution/main.nf +++ b/modules/nf-core/rseqc/readdistribution/main.nf @@ -32,4 +32,15 @@ process RSEQC_READDISTRIBUTION { rseqc: \$(read_distribution.py --version | sed -e "s/read_distribution.py //g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.read_distribution.txt + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rseqc: \$(read_distribution.py --version | sed -e "s/read_distribution.py //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/rseqc/readdistribution/tests/main.nf.test b/modules/nf-core/rseqc/readdistribution/tests/main.nf.test index d479d9f12..c49c558de 100644 --- a/modules/nf-core/rseqc/readdistribution/tests/main.nf.test +++ b/modules/nf-core/rseqc/readdistribution/tests/main.nf.test @@ -25,4 +25,28 @@ nextflow_process { ) } } + + test("sarscov2 paired-end [bam] - stub") { + + options "-stub" + + 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] = Channel.of(file(params.modules_testdata_base_path + "genomics/sarscov2/genome/bed/test.bed12", checkIfExists: true)) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } diff --git a/modules/nf-core/rseqc/readdistribution/tests/main.nf.test.snap b/modules/nf-core/rseqc/readdistribution/tests/main.nf.test.snap index 7b3090567..02e5e6117 100644 --- a/modules/nf-core/rseqc/readdistribution/tests/main.nf.test.snap +++ b/modules/nf-core/rseqc/readdistribution/tests/main.nf.test.snap @@ -33,5 +33,40 @@ "nextflow": "24.01.0" }, "timestamp": "2024-02-26T15:38:36.441841" + }, + "sarscov2 paired-end [bam] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.read_distribution.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,fc68a268ab32a0d72a66f270d6c7925e" + ], + "txt": [ + [ + { + "id": "test", + "single_end": false + }, + "test.read_distribution.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,fc68a268ab32a0d72a66f270d6c7925e" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T09:50:29.345905" } } \ No newline at end of file diff --git a/modules/nf-core/rseqc/readduplication/main.nf b/modules/nf-core/rseqc/readduplication/main.nf index 7dc68cf8e..354338021 100644 --- a/modules/nf-core/rseqc/readduplication/main.nf +++ b/modules/nf-core/rseqc/readduplication/main.nf @@ -34,4 +34,18 @@ process RSEQC_READDUPLICATION { rseqc: \$(read_duplication.py --version | sed -e "s/read_duplication.py //g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.seq.DupRate.xls + touch ${prefix}.pos.DupRate.xls + touch ${prefix}.DupRate_plot.pdf + touch ${prefix}.DupRate_plot.r + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rseqc: \$(read_duplication.py --version | sed -e "s/read_duplication.py //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/rseqc/readduplication/tests/main.nf.test b/modules/nf-core/rseqc/readduplication/tests/main.nf.test index 9c5675874..a6ffced4c 100644 --- a/modules/nf-core/rseqc/readduplication/tests/main.nf.test +++ b/modules/nf-core/rseqc/readduplication/tests/main.nf.test @@ -28,4 +28,27 @@ nextflow_process { ) } } + + test("sarscov2 paired-end [bam] - stub") { + + options "-stub" + + 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) + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } diff --git a/modules/nf-core/rseqc/readduplication/tests/main.nf.test.snap b/modules/nf-core/rseqc/readduplication/tests/main.nf.test.snap index 5ff9f0b8b..143a29dc6 100644 --- a/modules/nf-core/rseqc/readduplication/tests/main.nf.test.snap +++ b/modules/nf-core/rseqc/readduplication/tests/main.nf.test.snap @@ -74,5 +74,94 @@ "nextflow": "24.01.0" }, "timestamp": "2024-02-26T14:33:06.877127" + }, + "sarscov2 paired-end [bam] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.seq.DupRate.xls:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pos.DupRate.xls:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.DupRate_plot.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.DupRate_plot.r:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,8a0721f3247f97135eadb8eecbe142a1" + ], + "pdf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.DupRate_plot.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "pos_xls": [ + [ + { + "id": "test", + "single_end": false + }, + "test.pos.DupRate.xls:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "rscript": [ + [ + { + "id": "test", + "single_end": false + }, + "test.DupRate_plot.r:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "seq_xls": [ + [ + { + "id": "test", + "single_end": false + }, + "test.seq.DupRate.xls:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,8a0721f3247f97135eadb8eecbe142a1" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T09:53:03.817194" } } \ No newline at end of file diff --git a/modules/nf-core/rseqc/tin/main.nf b/modules/nf-core/rseqc/tin/main.nf index 1faed91b8..397442f03 100644 --- a/modules/nf-core/rseqc/tin/main.nf +++ b/modules/nf-core/rseqc/tin/main.nf @@ -33,4 +33,16 @@ process RSEQC_TIN { rseqc: \$(tin.py --version | sed -e "s/tin.py //g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${bam.fileName}.summary.txt + touch ${bam.fileName}.tin.xls + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + rseqc: \$(tin.py --version | sed -e "s/tin.py //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/rseqc/tin/tests/main.nf.test b/modules/nf-core/rseqc/tin/tests/main.nf.test index 063d45674..a4b6f05d4 100644 --- a/modules/nf-core/rseqc/tin/tests/main.nf.test +++ b/modules/nf-core/rseqc/tin/tests/main.nf.test @@ -26,4 +26,29 @@ nextflow_process { ) } } + + test("sarscov2 paired-end [bam] - stub") { + + options "-stub" + + 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), + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai", checkIfExists: true) + ]) + input[1] = Channel.of(file(params.modules_testdata_base_path + "genomics/sarscov2/genome/bed/test.bed12", checkIfExists: true)) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } diff --git a/modules/nf-core/rseqc/tin/tests/main.nf.test.snap b/modules/nf-core/rseqc/tin/tests/main.nf.test.snap index d8db28a48..caab3a091 100644 --- a/modules/nf-core/rseqc/tin/tests/main.nf.test.snap +++ b/modules/nf-core/rseqc/tin/tests/main.nf.test.snap @@ -51,5 +51,58 @@ "nextflow": "24.01.0" }, "timestamp": "2024-02-26T14:32:42.823857" + }, + "sarscov2 paired-end [bam] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.summary.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.tin.xls:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,79670dedaa11a978951c16ead7f49c24" + ], + "txt": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.summary.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,79670dedaa11a978951c16ead7f49c24" + ], + "xls": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.tin.xls:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T09:55:57.905927" } } \ No newline at end of file diff --git a/modules/nf-core/subread/featurecounts/main.nf b/modules/nf-core/subread/featurecounts/main.nf index 209799622..471bd16fd 100644 --- a/modules/nf-core/subread/featurecounts/main.nf +++ b/modules/nf-core/subread/featurecounts/main.nf @@ -44,4 +44,16 @@ process SUBREAD_FEATURECOUNTS { subread: \$( echo \$(featureCounts -v 2>&1) | sed -e "s/featureCounts v//g") END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.featureCounts.txt + touch ${prefix}.featureCounts.txt.summary + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + subread: \$( echo \$(featureCounts -v 2>&1) | sed -e "s/featureCounts v//g") + END_VERSIONS + """ } diff --git a/modules/nf-core/subread/featurecounts/tests/main.nf.test b/modules/nf-core/subread/featurecounts/tests/main.nf.test index e8e0fa70e..3c0c829bf 100644 --- a/modules/nf-core/subread/featurecounts/tests/main.nf.test +++ b/modules/nf-core/subread/featurecounts/tests/main.nf.test @@ -10,7 +10,7 @@ nextflow_process { when { process { """ - input[0] = [ + input[0] = [ [ id:'test', single_end:true, strandedness:'forward' ], // meta map file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) @@ -29,12 +29,36 @@ nextflow_process { } } + test("sarscov2 [bam] - forward - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'forward' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + test("sarscov2 [bam] - reverse") { when { process { """ - input[0] = [ + input[0] = [ [ id:'test', single_end:true, strandedness:'reverse' ], // meta map file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) @@ -53,12 +77,36 @@ nextflow_process { } } + test("sarscov2 [bam] - reverse - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'reverse' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + test("sarscov2 [bam] - unstranded") { when { process { """ - input[0] = [ + input[0] = [ [ id:'test', single_end:true, strandedness:'unstranded' ], // meta map file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) @@ -76,4 +124,28 @@ nextflow_process { ) } } + + test("sarscov2 [bam] - unstranded - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true, strandedness:'unstranded' ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bam/test.single_end.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.gtf", checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } diff --git a/modules/nf-core/subread/featurecounts/tests/main.nf.test.snap b/modules/nf-core/subread/featurecounts/tests/main.nf.test.snap index ad5524f65..72e8dcddf 100644 --- a/modules/nf-core/subread/featurecounts/tests/main.nf.test.snap +++ b/modules/nf-core/subread/featurecounts/tests/main.nf.test.snap @@ -12,6 +12,10 @@ ] ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-23T15:50:10.685863663" }, "unstranded_counts": { @@ -27,6 +31,10 @@ ] ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-23T15:50:38.67903701" }, "reverse_summary": { @@ -42,8 +50,126 @@ ] ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-23T15:50:25.168206514" }, + "sarscov2 [bam] - forward - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.txt.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ], + "counts": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "forward" + }, + "test.featureCounts.txt.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T10:04:22.628032" + }, + "sarscov2 [bam] - reverse - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.txt.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ], + "counts": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "reverse" + }, + "test.featureCounts.txt.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T10:04:52.371212" + }, "reverse_counts": { "content": [ [ @@ -57,8 +183,69 @@ ] ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-23T15:50:25.160010804" }, + "sarscov2 [bam] - unstranded - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.txt.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ], + "counts": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summary": [ + [ + { + "id": "test", + "single_end": true, + "strandedness": "unstranded" + }, + "test.featureCounts.txt.summary:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T10:05:25.058902" + }, "forward_summary": { "content": [ [ @@ -72,6 +259,10 @@ ] ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-23T15:50:10.699024934" }, "forward_versions": { @@ -80,6 +271,10 @@ "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-23T15:50:10.704797013" }, "unstranded_summary": { @@ -95,6 +290,10 @@ ] ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-23T15:50:38.68776235" }, "reverse_versions": { @@ -103,6 +302,10 @@ "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-23T15:50:25.175265594" }, "unstranded_versions": { @@ -111,6 +314,10 @@ "versions.yml:md5,c2c0903b93c93d9afd2667052b9ee726" ] ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2023-11-23T15:50:38.69390501" } } \ No newline at end of file diff --git a/modules/nf-core/trimgalore/main.nf b/modules/nf-core/trimgalore/main.nf index 24ead8714..0e2f32902 100644 --- a/modules/nf-core/trimgalore/main.nf +++ b/modules/nf-core/trimgalore/main.nf @@ -72,4 +72,25 @@ process TRIMGALORE { END_VERSIONS """ } + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + if (meta.single_end) { + output_command = "echo '' | gzip > ${prefix}_trimmed.fq.gz ;" + output_command += "touch ${prefix}.fastq.gz_trimming_report.txt" + } else { + output_command = "echo '' | gzip > ${prefix}_1_trimmed.fq.gz ;" + output_command += "touch ${prefix}_1.fastq.gz_trimming_report.txt ;" + output_command += "echo '' | gzip > ${prefix}_2_trimmed.fq.gz ;" + output_command += "touch ${prefix}_2.fastq.gz_trimming_report.txt" + } + """ + ${output_command} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + trimgalore: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//') + cutadapt: \$(cutadapt --version) + END_VERSIONS + """ } diff --git a/modules/nf-core/trimgalore/tests/main.nf.test b/modules/nf-core/trimgalore/tests/main.nf.test index 93e30325a..4010af8f4 100644 --- a/modules/nf-core/trimgalore/tests/main.nf.test +++ b/modules/nf-core/trimgalore/tests/main.nf.test @@ -41,6 +41,28 @@ nextflow_process { } } + test("test_trimgalore_single_end - stub") { + + options "-stub" + + when { + 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) ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + test("test_trimgalore_paired_end") { when { @@ -97,4 +119,29 @@ nextflow_process { ) } } + + test("test_trimgalore_paired_end - stub") { + + options "-stub" + + when { + 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) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } diff --git a/modules/nf-core/trimgalore/tests/main.nf.test.snap b/modules/nf-core/trimgalore/tests/main.nf.test.snap index 082c55004..6cb31c9f9 100644 --- a/modules/nf-core/trimgalore/tests/main.nf.test.snap +++ b/modules/nf-core/trimgalore/tests/main.nf.test.snap @@ -11,6 +11,160 @@ }, "timestamp": "2024-02-29T16:33:20.401347" }, + "test_trimgalore_single_end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ], + "html": [ + + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "unpaired": [ + + ], + "versions": [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ], + "zip": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T10:27:44.964166" + }, + "test_trimgalore_paired_end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_2.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ], + "html": [ + + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_2.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "unpaired": [ + + ], + "versions": [ + "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + ], + "zip": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T10:28:07.611496" + }, "test_trimgalore_paired_end": { "content": [ [ diff --git a/modules/nf-core/ucsc/bedclip/main.nf b/modules/nf-core/ucsc/bedclip/main.nf index 28c85ad0e..d3e09dc11 100755 --- a/modules/nf-core/ucsc/bedclip/main.nf +++ b/modules/nf-core/ucsc/bedclip/main.nf @@ -34,4 +34,16 @@ process UCSC_BEDCLIP { ucsc: $VERSION END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '377' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + """ + touch ${prefix}.bedGraph + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ucsc: $VERSION + END_VERSIONS + """ } diff --git a/modules/nf-core/ucsc/bedclip/tests/main.nf.test b/modules/nf-core/ucsc/bedclip/tests/main.nf.test index f4fa61b5e..5cb8600c3 100644 --- a/modules/nf-core/ucsc/bedclip/tests/main.nf.test +++ b/modules/nf-core/ucsc/bedclip/tests/main.nf.test @@ -26,4 +26,28 @@ nextflow_process { ) } } + + test("sarscov2 - stub") { + config "./nextflow.config" + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/bedgraph/test.bedgraph", checkIfExists: true) + ]) + input[1] = Channel.of(file(params.modules_testdata_base_path + "genomics/sarscov2/genome/genome.sizes", checkIfExists: true)) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } \ No newline at end of file diff --git a/modules/nf-core/ucsc/bedclip/tests/main.nf.test.snap b/modules/nf-core/ucsc/bedclip/tests/main.nf.test.snap index 2f41b6a8d..77e893808 100644 --- a/modules/nf-core/ucsc/bedclip/tests/main.nf.test.snap +++ b/modules/nf-core/ucsc/bedclip/tests/main.nf.test.snap @@ -1,4 +1,39 @@ { + "sarscov2 - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.clip.bedGraph:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,b92248ce2a138ad4d146ac0d9e71fb34" + ], + "bedgraph": [ + [ + { + "id": "test", + "single_end": false + }, + "test.clip.bedGraph:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,b92248ce2a138ad4d146ac0d9e71fb34" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T10:31:42.86304" + }, "sarscov2": { "content": [ { diff --git a/modules/nf-core/umitools/extract/main.nf b/modules/nf-core/umitools/extract/main.nf index 8719e5f67..b97900e09 100644 --- a/modules/nf-core/umitools/extract/main.nf +++ b/modules/nf-core/umitools/extract/main.nf @@ -53,4 +53,22 @@ process UMITOOLS_EXTRACT { END_VERSIONS """ } + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + if (meta.single_end) { + output_command = "echo '' | gzip > ${prefix}.umi_extract.fastq.gz" + } else { + output_command = "echo '' | gzip > ${prefix}.umi_extract_1.fastq.gz ;" + output_command += "echo '' | gzip > ${prefix}.umi_extract_2.fastq.gz" + } + """ + touch ${prefix}.umi_extract.log + ${output_command} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + umitools: \$( umi_tools --version | sed '/version:/!d; s/.*: //' ) + END_VERSIONS + """ } diff --git a/modules/nf-core/umitools/extract/tests/main.nf.test b/modules/nf-core/umitools/extract/tests/main.nf.test index 4d9a01567..3eec566be 100644 --- a/modules/nf-core/umitools/extract/tests/main.nf.test +++ b/modules/nf-core/umitools/extract/tests/main.nf.test @@ -5,7 +5,7 @@ nextflow_process { process "UMITOOLS_EXTRACT" config "./nextflow.config" - test("Should run without failures") { + test("single end") { when { process { @@ -20,7 +20,82 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.versions).match("versions") } + { assert snapshot( + process.out.reads.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.log.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.versions + ).match() } + ) + } + } + + test("single end - stub") { + + options "-stub" + + when { + 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) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("pair end") { + + when { + 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) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.reads[0][1][0]).name, + file(process.out.reads[0][1][1]).name, + process.out.log.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.versions + ).match() } + ) + } + } + + test("pair end - stub") { + + options "-stub" + + when { + 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) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/umitools/extract/tests/main.nf.test.snap b/modules/nf-core/umitools/extract/tests/main.nf.test.snap index bf82701dd..b1159054b 100644 --- a/modules/nf-core/umitools/extract/tests/main.nf.test.snap +++ b/modules/nf-core/umitools/extract/tests/main.nf.test.snap @@ -1,14 +1,167 @@ { - "versions": { + "pair end - stub": { "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.umi_extract_1.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.umi_extract_2.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.umi_extract_1.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.umi_extract_2.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "versions": [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T15:05:20.008312" + }, + "single end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T15:04:12.145999" + }, + "pair end": { + "content": [ + "test.umi_extract_1.fastq.gz", + "test.umi_extract_2.fastq.gz", + [ + [ + { + "id": "test", + "single_end": false + }, + "test.umi_extract.log" + ] + ], + [ + "versions.yml:md5,568d243174c081a0301e74ed42e59b48" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T15:21:09.578031" + }, + "single end": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.fastq.gz" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.umi_extract.log" + ] + ], [ "versions.yml:md5,568d243174c081a0301e74ed42e59b48" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-16T10:01:33.326046137" + "timestamp": "2024-07-02T15:03:52.464606" } } \ No newline at end of file diff --git a/subworkflows/nf-core/fastq_align_hisat2/main.nf b/subworkflows/nf-core/fastq_align_hisat2/main.nf index a2ec1cf5e..511fe035c 100644 --- a/subworkflows/nf-core/fastq_align_hisat2/main.nf +++ b/subworkflows/nf-core/fastq_align_hisat2/main.nf @@ -41,4 +41,3 @@ workflow FASTQ_ALIGN_HISAT2 { versions = ch_versions // channel: [ versions.yml ] } - diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf index c472d7116..ab6cbb320 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf @@ -12,12 +12,18 @@ include { FASTP } from '../../../modules/nf-core/fastp/main' // import groovy.json.JsonSlurper -def getFastpReadsAfterFiltering(json_file) { +def getFastpReadsAfterFiltering(json_file, min_num_reads) { + + if ( workflow.stubRun ) { return min_num_reads } + def Map json = (Map) new JsonSlurper().parseText(json_file.text).get('summary') return json['after_filtering']['total_reads'].toLong() } def getFastpAdapterSequence(json_file){ + + if ( workflow.stubRun ) { return "" } + def Map json = (Map) new JsonSlurper().parseText(json_file.text) try{ adapter = json['adapter_cutting']['read1_adapter_sequence'] @@ -109,7 +115,7 @@ workflow FASTQ_FASTQC_UMITOOLS_FASTP { .out .reads .join(trim_json) - .map { meta, reads, json -> [ meta, reads, getFastpReadsAfterFiltering(json) ] } + .map { meta, reads, json -> [ meta, reads, getFastpReadsAfterFiltering(json, min_trimmed_reads.toLong()) ] } .set { ch_num_trimmed_reads } ch_num_trimmed_reads diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test index 165dc7675..7bcb4b052 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test @@ -550,4 +550,49 @@ nextflow_workflow { ) } } + + test("sarscov2 paired-end [fastq] - stub") { + + options '-stub' + + when { + workflow { + """ + skip_fastqc = false + with_umi = false + skip_umi_extract = false + umi_discard_read = 1 + skip_trimming = false + adapter_fasta = [] + save_trimmed_fail = false + save_merged = false + min_trimmed_reads = 1 + + input[0] = Channel.of([ + [ 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) + ] + ]) + input[1] = skip_fastqc + input[2] = with_umi + input[3] = skip_umi_extract + input[4] = umi_discard_read + input[5] = skip_trimming + input[6] = adapter_fasta + input[7] = save_trimmed_fail + input[8] = save_merged + input[9] = min_trimmed_reads + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } } diff --git a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test.snap index 4a6689f67..b591fab90 100644 --- a/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test.snap +++ b/subworkflows/nf-core/fastq_fastqc_umitools_fastp/tests/main.nf.test.snap @@ -545,5 +545,230 @@ "nextflow": "24.04.2" }, "timestamp": "2024-06-10T15:08:32.267769943" + }, + "sarscov2 paired-end [fastq] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "13": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + + ], + "9": [ + + ], + "adapter_seq": [ + [ + { + "id": "test", + "single_end": false + }, + "" + ] + ], + "fastqc_raw_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_raw_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fastqc_trim_zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.fastp.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "trim_html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_json": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fastp.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "trim_read_count": [ + [ + { + "id": "test", + "single_end": false + }, + 1 + ] + ], + "trim_reads_fail": [ + + ], + "trim_reads_merged": [ + + ], + "umi_log": [ + + ], + "versions": [ + "versions.yml:md5,85bd0117e5778fff18e3920972a296ad", + "versions.yml:md5,c50aa59475ab901bc6f9a2cf7b1a14e0", + "versions.yml:md5,f3dcaae948e8eed92b4a5557b4c6668e" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-21T14:46:58.329605" } } \ No newline at end of file