diff --git a/modules/nf-core/bcftools/concat/main.nf b/modules/nf-core/bcftools/concat/main.nf index a5830a251a4..d64640b32dd 100644 --- a/modules/nf-core/bcftools/concat/main.nf +++ b/modules/nf-core/bcftools/concat/main.nf @@ -36,7 +36,7 @@ process BCFTOOLS_CONCAT { stub: prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.vcf.gz + echo "" | gzip > ${prefix}.vcf.gz cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/concat/tests/main.nf.test b/modules/nf-core/bcftools/concat/tests/main.nf.test index bf1a5f3fae0..d5d9f787432 100644 --- a/modules/nf-core/bcftools/concat/tests/main.nf.test +++ b/modules/nf-core/bcftools/concat/tests/main.nf.test @@ -34,10 +34,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.vcf, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } @@ -63,10 +60,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.vcf, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } @@ -96,10 +90,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.vcf[0][1]).name, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/bcftools/concat/tests/main.nf.test.snap b/modules/nf-core/bcftools/concat/tests/main.nf.test.snap index 7344e6e38c9..90d3fc068ed 100644 --- a/modules/nf-core/bcftools/concat/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/concat/tests/main.nf.test.snap @@ -1,43 +1,101 @@ { "sarscov2 - [[vcf1, vcf2], []]": { "content": [ - [ - [ - { - "id": "test3" - }, - "test3.vcf.gz:md5,4bcd0afd89f56c5d433f6b6abc44d0a6" + { + "0": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "1": [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "versions": [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" ] - ], - [ - "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" - ] + } ], - "timestamp": "2023-11-29T13:52:27.03724666" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-03T13:22:49.766749302" }, "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]]": { "content": [ - [ - [ - { - "id": "test3" - }, - "test3.vcf.gz:md5,4bcd0afd89f56c5d433f6b6abc44d0a6" + { + "0": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "1": [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "versions": [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" ] - ], - [ - "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" - ] + } ], - "timestamp": "2023-11-29T13:52:21.468988293" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-03T13:22:41.119912312" }, "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - stub": { "content": [ - "test3.vcf.gz", - [ - "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" - ] + { + "0": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + ] + } ], - "timestamp": "2023-11-29T13:41:04.716017811" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-03T13:22:59.90466392" } } \ No newline at end of file diff --git a/modules/nf-core/bcftools/sort/main.nf b/modules/nf-core/bcftools/sort/main.nf index c982944c522..246148d6138 100644 --- a/modules/nf-core/bcftools/sort/main.nf +++ b/modules/nf-core/bcftools/sort/main.nf @@ -49,9 +49,9 @@ process BCFTOOLS_SORT { args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : "vcf" - + def create_cmd = extension.endsWith(".gz") ? "echo '' | gzip >" : "touch" """ - touch ${prefix}.${extension} + ${create_cmd} ${prefix}.${extension} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/sort/tests/main.nf.test b/modules/nf-core/bcftools/sort/tests/main.nf.test index fec59cfe573..8a496dda7d0 100644 --- a/modules/nf-core/bcftools/sort/tests/main.nf.test +++ b/modules/nf-core/bcftools/sort/tests/main.nf.test @@ -9,7 +9,29 @@ nextflow_process { tag "bcftools" tag "bcftools/sort" - test("SarsCov2 VCF") { + test("sarscov2 - vcf") { + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match("vcf") } + ) + } + + } + + test("sarscov2 - vcf - stub") { + options "-stub" when { process { """ diff --git a/modules/nf-core/bcftools/sort/tests/main.nf.test.snap b/modules/nf-core/bcftools/sort/tests/main.nf.test.snap index 7f599559fca..6200cc42e02 100644 --- a/modules/nf-core/bcftools/sort/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/sort/tests/main.nf.test.snap @@ -1,5 +1,5 @@ { - "SarsCov2 VCF": { + "vcf": { "content": [ { "0": [ @@ -28,8 +28,41 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.04.2" + "nextflow": "24.03.0" }, - "timestamp": "2024-03-18T12:50:10.340362246" + "timestamp": "2024-05-02T16:55:21.237927554" + }, + "sarscov2 - vcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "versions.yml:md5,622bd32d4ff0fac3360cd534ae0f0168" + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,622bd32d4ff0fac3360cd534ae0f0168" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-03T12:32:50.506309198" } } \ No newline at end of file diff --git a/modules/nf-core/ensemblvep/vep/main.nf b/modules/nf-core/ensemblvep/vep/main.nf index 885efcedb6e..e82471aa1da 100644 --- a/modules/nf-core/ensemblvep/vep/main.nf +++ b/modules/nf-core/ensemblvep/vep/main.nf @@ -57,9 +57,9 @@ process ENSEMBLVEP_VEP { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.vcf.gz - touch ${prefix}.tab.gz - touch ${prefix}.json.gz + echo "" | gzip > ${prefix}.vcf.gz + echo "" | gzip > ${prefix}.tab.gz + echo "" | gzip > ${prefix}.json.gz touch ${prefix}.summary.html cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/expansionhunter/environment.yml b/modules/nf-core/expansionhunter/environment.yml index 76edd1efb98..90a3bfff220 100644 --- a/modules/nf-core/expansionhunter/environment.yml +++ b/modules/nf-core/expansionhunter/environment.yml @@ -1,7 +1,10 @@ name: expansionhunter + channels: - conda-forge - bioconda - defaults + dependencies: - bioconda::expansionhunter=5.0.0 + - bioconda::htslib=1.18 diff --git a/modules/nf-core/expansionhunter/main.nf b/modules/nf-core/expansionhunter/main.nf index bea5916aab4..dbcb175fcc4 100644 --- a/modules/nf-core/expansionhunter/main.nf +++ b/modules/nf-core/expansionhunter/main.nf @@ -40,7 +40,7 @@ process EXPANSIONHUNTER { cat <<-END_VERSIONS > versions.yml "${task.process}": - expansionhunter: \$( echo \$(ExpansionHunter --version 2>&1) | sed 's/^.*ExpansionHunter v//') + expansionhunter: \$( echo \$(ExpansionHunter --version 2>&1) | head -1 | sed 's/^.*ExpansionHunter v//') bgzip: \$(echo \$(bgzip -h 2>&1) | sed 's/^.*Version: //;s/Usage:.*//') END_VERSIONS """ @@ -48,13 +48,13 @@ process EXPANSIONHUNTER { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.vcf.gz - touch ${prefix}.json.gz + echo "" | gzip > ${prefix}.vcf.gz + echo "" | gzip > ${prefix}.json.gz touch ${prefix}_realigned.bam cat <<-END_VERSIONS > versions.yml "${task.process}": - expansionhunter: \$( echo \$(ExpansionHunter --version 2>&1) | sed 's/^.*ExpansionHunter v//') + expansionhunter: \$( echo \$(ExpansionHunter --version 2>&1) | head -1 | sed 's/^.*ExpansionHunter v//') bgzip: \$(echo \$(bgzip -h 2>&1) | sed 's/^.*Version: //;s/Usage:.*//') END_VERSIONS """ diff --git a/modules/nf-core/expansionhunter/tests/main.nf.test b/modules/nf-core/expansionhunter/tests/main.nf.test index 6204460abab..ef15e133e19 100644 --- a/modules/nf-core/expansionhunter/tests/main.nf.test +++ b/modules/nf-core/expansionhunter/tests/main.nf.test @@ -7,7 +7,7 @@ nextflow_process { tag "modules_nfcore" tag "expansionhunter" - test("expansionhunter") { + test("homo_sapiens - [bam,bai], fasta, fai, cat") { when { process { @@ -25,10 +25,35 @@ nextflow_process { then { assertAll( - {assert process.success}, - {assert path(process.out.vcf.get(0).get(1)).linesGzip.size() == 8}, - {assert path(process.out.json.get(0).get(1)).linesGzip.size() == 27}, - {assert snapshot(process.out.bam).match()} + {assert process.success}, + {assert snapshot(process.out).match("expansionhunter")} + ) + } + + } + + test("homo_sapiens - [bam,bai], fasta, fai, cat - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), + ] + input[1] = [[id:'fasta'],file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] + input[2] = [[id:'fasta_fai'],file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)] + input[3] = [[id:'catalogue'],file(params.test_data['homo_sapiens']['genome']['repeat_expansions'], checkIfExists: true)] + """ + } + } + + then { + assertAll( + {assert process.success}, + {assert snapshot(process.out).match("stub")} ) } diff --git a/modules/nf-core/expansionhunter/tests/main.nf.test.snap b/modules/nf-core/expansionhunter/tests/main.nf.test.snap index a98fb599e26..a4e09f4c3e2 100644 --- a/modules/nf-core/expansionhunter/tests/main.nf.test.snap +++ b/modules/nf-core/expansionhunter/tests/main.nf.test.snap @@ -1,15 +1,132 @@ { "expansionhunter": { "content": [ - [ - [ - { - "id": "test" - }, - "test_realigned.bam:md5,b37a72c0b97b45e63636a9758f3144d7" + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,cfd4a1d35c0e469b99eb6aaa6d22de76" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.json.gz:md5,60d7dc4662c837bba2715d54b64a9bfe" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test_realigned.bam:md5,b37a72c0b97b45e63636a9758f3144d7" + ] + ], + "3": [ + "versions.yml:md5,056b525f67ba23c361f0c65f47256dca" + ], + "bam": [ + [ + { + "id": "test" + }, + "test_realigned.bam:md5,b37a72c0b97b45e63636a9758f3144d7" + ] + ], + "json": [ + [ + { + "id": "test" + }, + "test.json.gz:md5,60d7dc4662c837bba2715d54b64a9bfe" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,cfd4a1d35c0e469b99eb6aaa6d22de76" + ] + ], + "versions": [ + "versions.yml:md5,056b525f67ba23c361f0c65f47256dca" ] - ] + } ], - "timestamp": "2024-01-26T17:35:10.45442497" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-03T12:20:15.18545069" + }, + "stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.json.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test_realigned.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,056b525f67ba23c361f0c65f47256dca" + ], + "bam": [ + [ + { + "id": "test" + }, + "test_realigned.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "json": [ + [ + { + "id": "test" + }, + "test.json.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,056b525f67ba23c361f0c65f47256dca" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-03T12:20:28.430115" } } \ No newline at end of file diff --git a/modules/nf-core/gawk/main.nf b/modules/nf-core/gawk/main.nf index 449b9686fca..578b448c4f6 100644 --- a/modules/nf-core/gawk/main.nf +++ b/modules/nf-core/gawk/main.nf @@ -42,9 +42,10 @@ process GAWK { stub: prefix = task.ext.prefix ?: "${meta.id}" suffix = task.ext.suffix ?: "${input.getExtension()}" + def create_cmd = suffix.endsWith("gz") ? "echo '' | gzip >" : "touch" """ - touch ${prefix}.${suffix} + ${create_cmd} ${prefix}.${suffix} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/samtools/convert/main.nf b/modules/nf-core/samtools/convert/main.nf index 3c539e484d9..d61fbe2e3ad 100644 --- a/modules/nf-core/samtools/convert/main.nf +++ b/modules/nf-core/samtools/convert/main.nf @@ -42,4 +42,19 @@ process SAMTOOLS_CONVERT { samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + def output_extension = input.getExtension() == "bam" ? "cram" : "bam" + def index_extension = output_extension == "bam" ? "bai" : "crai" + + """ + touch ${prefix}.${output_extension} + touch ${prefix}.${index_extension} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/samtools/convert/tests/main.nf.test b/modules/nf-core/samtools/convert/tests/main.nf.test index d2ab5839018..91a0c69ea1d 100644 --- a/modules/nf-core/samtools/convert/tests/main.nf.test +++ b/modules/nf-core/samtools/convert/tests/main.nf.test @@ -72,4 +72,36 @@ nextflow_process { ) } } + + test("sarscov2 - [bam, bai], fasta, fai - 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([ + [ id:'fasta' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = Channel.of([ + [ id:'fai' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match("stub") } + ) + } + } } diff --git a/modules/nf-core/samtools/convert/tests/main.nf.test.snap b/modules/nf-core/samtools/convert/tests/main.nf.test.snap index 9d56a4ec6c8..3d6f88c4ddc 100644 --- a/modules/nf-core/samtools/convert/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/convert/tests/main.nf.test.snap @@ -43,6 +43,71 @@ }, "timestamp": "2024-03-06T11:14:36.643960504" }, + "stub": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,dd0aaf61f39c9ce91c74090f3c7ce1d0" + ], + "bai": [ + + ], + "bam": [ + + ], + "crai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "cram": [ + [ + { + "id": "test", + "single_end": false + }, + "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,dd0aaf61f39c9ce91c74090f3c7ce1d0" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-03T12:01:40.896170698" + }, "bam_to_cram_index": { "content": [ "test.cram.crai"