diff --git a/CHANGELOG.md b/CHANGELOG.md index 411b3316..5bad199b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Initial release of nf-core/metatdenovo, created with the [nf-core](https://nf-co ### `Changed` +- [#311](<[https://github.com/nf-core/metatdenovo/pull/311](https://github.com/nf-core/metatdenovo/pull/311)>) - update modules and subworkflows - [#295](<[https://github.com/nf-core/metatdenovo/pull/295](https://github.com/nf-core/metatdenovo/pull/295)>) - Update documentation - [#292](<[https://github.com/nf-core/metatdenovo/pull/292](https://github.com/nf-core/metatdenovo/pull/292)>) - Specify memory to Megahit process - [#290](<[https://github.com/nf-core/metatdenovo/pull/290](https://github.com/nf-core/metatdenovo/pull/290)>) - Template update to v2.14.1 diff --git a/conf/test.config b/conf/test.config index 2defcb3e..fc95cdb1 100644 --- a/conf/test.config +++ b/conf/test.config @@ -21,10 +21,6 @@ process { params { config_profile_name = 'Test profile' config_profile_description = 'Minimal test dataset to check pipeline function' - // Limit resources so that this can run on GitHub Actions - max_cpus = 2 - max_memory = '6.GB' - max_time = '6.h' // Input data input = params.pipelines_testdata_base_path + 'metatdenovo/samplesheet/samplesheet.csv' diff --git a/conf/test_eggnog.config b/conf/test_eggnog.config index 036a7fea..1aa83968 100644 --- a/conf/test_eggnog.config +++ b/conf/test_eggnog.config @@ -13,10 +13,6 @@ params { config_profile_name = 'Test eggnog profile' config_profile_description = 'Minimal test dataset to check pipeline with eggnog function added' - // Limit resources so that this can run on GitHub Actions - max_cpus = 8 - max_memory = '24.GB' - max_time = '6.h' // Input data input = 'https://raw.githubusercontent.com/nf-core/test-datasets/metatdenovo/samplesheet/samplesheet.csv' diff --git a/conf/test_eukulele.config b/conf/test_eukulele.config index ab61ac51..79ba2b9b 100644 --- a/conf/test_eukulele.config +++ b/conf/test_eukulele.config @@ -14,11 +14,6 @@ params { config_profile_name = 'Test profile for eukulele taxonomic annotation' config_profile_description = 'Minimal test dataset to check pipeline function' - // Limit resources so that this can run on GitHub Actions - max_cpus = 8 - max_memory = '24.GB' - max_time = '6.h' - // Input data input = 'https://raw.githubusercontent.com/nf-core/test-datasets/metatdenovo/samplesheet/samplesheet.csv' diff --git a/conf/test_filter.config b/conf/test_filter.config index 597862a8..80692083 100644 --- a/conf/test_filter.config +++ b/conf/test_filter.config @@ -14,11 +14,6 @@ params { config_profile_name = 'Test profile' config_profile_description = 'Minimal test dataset to check pipeline function, including removal of contaminating sequences (e.g. rRNA)' - // Limit resources so that this can run on GitHub Actions - max_cpus = 2 - max_memory = 6.GB - max_time = 6.h - // Input data input = 'https://raw.githubusercontent.com/nf-core/test-datasets/metatdenovo/samplesheet/samplesheet.csv' diff --git a/conf/test_full.config b/conf/test_full.config index 0bcc2552..db7438b9 100644 --- a/conf/test_full.config +++ b/conf/test_full.config @@ -17,9 +17,6 @@ params { // Input data for full size test input = params.pipelines_testdata_base_path + 'metatdenovo/samplesheet/samplesheet_full_test.csv' - // Genome references - genome = 'R64-1-1' - // parameters skip_eukulele = false skip_eggnog = false diff --git a/conf/test_kofamscan.config b/conf/test_kofamscan.config index 9584e0f9..6e321d71 100644 --- a/conf/test_kofamscan.config +++ b/conf/test_kofamscan.config @@ -14,11 +14,6 @@ params { config_profile_name = 'Test kofamscan profile' config_profile_description = 'Minimal test dataset to check pipeline with kofamscan function added' - // Limit resources so that this can run on GitHub Actions - max_cpus = 8 - max_memory = '24.GB' - max_time = '6.h' - // Input data input = 'https://raw.githubusercontent.com/nf-core/test-datasets/metatdenovo/samplesheet/samplesheet.csv' diff --git a/conf/test_prokka.config b/conf/test_prokka.config index 49783626..4d96aef3 100644 --- a/conf/test_prokka.config +++ b/conf/test_prokka.config @@ -14,11 +14,6 @@ params { config_profile_name = 'Test profile for prokka orf caller' config_profile_description = 'Minimal test dataset to check pipeline function' - // Limit resources so that this can run on GitHub Actions - max_cpus = 2 - max_memory = 6.GB - max_time = 6.h - // Input data input = 'https://raw.githubusercontent.com/nf-core/test-datasets/metatdenovo/samplesheet/samplesheet.csv' diff --git a/conf/test_spades.config b/conf/test_spades.config index b9140894..ceb8579d 100644 --- a/conf/test_spades.config +++ b/conf/test_spades.config @@ -13,10 +13,6 @@ params { config_profile_name = 'Test spades assembler profile' config_profile_description = 'Minimal test dataset to check pipeline function' - // Limit resources so that this can run on GitHub Actions - max_cpus = 2 - max_memory = '6.GB' - max_time = '6.h' // Input data input = 'https://raw.githubusercontent.com/nf-core/test-datasets/metatdenovo/samplesheet/samplesheet.csv' diff --git a/conf/test_transdecoder.config b/conf/test_transdecoder.config index 7766a2d1..9be2ccfe 100644 --- a/conf/test_transdecoder.config +++ b/conf/test_transdecoder.config @@ -14,11 +14,6 @@ params { config_profile_name = 'Test profile for transdecoder orf caller' config_profile_description = 'Minimal test dataset to check pipeline function' - // Limit resources so that this can run on GitHub Actions - max_cpus = 2 - max_memory = 6.GB - max_time = 6.h - // Input data input = 'https://raw.githubusercontent.com/nf-core/test-datasets/metatdenovo/samplesheet/samplesheet.csv' diff --git a/modules.json b/modules.json index 26fdc9c9..d36b7a1a 100644 --- a/modules.json +++ b/modules.json @@ -7,27 +7,27 @@ "nf-core": { "bbmap/align": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "49780ab7ba87906103c8810044008a042748fd4f", "installed_by": ["modules"] }, "bbmap/bbduk": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "a1abf90966a2a4016d3c3e41e228bfcbd4811ccc", "installed_by": ["modules"] }, "bbmap/bbnorm": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, "bbmap/index": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "49780ab7ba87906103c8810044008a042748fd4f", "installed_by": ["modules"] }, "cat/cat": { "branch": "master", - "git_sha": "9437e6053dccf4aafa022bfd6e7e9de67e625af8", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, "cat/fastq": { @@ -37,37 +37,37 @@ }, "fastqc": { "branch": "master", - "git_sha": "dc94b6ee04a05ddb9f7ae050712ff30a13149164", + "git_sha": "08108058ea36a63f141c25c4e75f9f872a5b2296", "installed_by": ["modules"] }, "hmmer/hmmsearch": { "branch": "master", - "git_sha": "b046a286c8240ebe3412ddf8ae901d47008d1ca7", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, "multiqc": { "branch": "master", - "git_sha": "cf17ca47590cc578dfb47db1c2a44ef86f89976d", + "git_sha": "f80914f78fb7fa1c00b14cfeb29575ee12240d9c", "installed_by": ["modules"] }, "pigz/compress": { "branch": "master", - "git_sha": "0eab94fc1e48703c1b0a8704bd665f554905c39d", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, "prodigal": { "branch": "master", - "git_sha": "2a196d6bfea8b6b5f49fc1885e39fae5f50bc2a0", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", "installed_by": ["modules"] }, "prokka": { "branch": "master", - "git_sha": "49ebda931c36c2b282f7958d00e1236b751f1031", + "git_sha": "bcfb2f7efd4444ab442ffc8a248afbd62bca5ae7", "installed_by": ["modules"] }, "samtools/flagstat": { "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", + "git_sha": "2d20463181b1c38981a02e90d3084b5f9fa8d540", "installed_by": ["bam_stats_samtools"] }, "samtools/idxstats": { diff --git a/modules/nf-core/bbmap/align/environment.yml b/modules/nf-core/bbmap/align/environment.yml index 96c4c32c..7ff25c7a 100644 --- a/modules/nf-core/bbmap/align/environment.yml +++ b/modules/nf-core/bbmap/align/environment.yml @@ -1,8 +1,6 @@ -name: bbmap_align channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bbmap=39.01 - bioconda::samtools=1.16.1 diff --git a/modules/nf-core/bbmap/align/main.nf b/modules/nf-core/bbmap/align/main.nf index e3fee17d..c4e7acf7 100644 --- a/modules/nf-core/bbmap/align/main.nf +++ b/modules/nf-core/bbmap/align/main.nf @@ -26,7 +26,7 @@ process BBMAP_ALIGN { input = meta.single_end ? "in=${fastq}" : "in=${fastq[0]} in2=${fastq[1]}" // Set the db variable to reflect the three possible types of reference input: 1) directory - // named 'ref', 2) directory named something else (containg a 'ref' subdir) or 3) a sequence + // named 'ref', 2) directory named something else (containing a 'ref' subdir) or 3) a sequence // file in fasta format if ( ref.isDirectory() ) { if ( ref ==~ /(.\/)?ref\/?/ ) { @@ -48,6 +48,19 @@ process BBMAP_ALIGN { -Xmx${task.memory.toGiga()}g \\ &> ${prefix}.bbmap.log + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bbmap: \$(bbversion.sh | grep -v "Duplicate cpuset") + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) + END_VERSIONS + """ + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bam + touch ${prefix}.bbmap.log + cat <<-END_VERSIONS > versions.yml "${task.process}": bbmap: \$(bbversion.sh | grep -v "Duplicate cpuset") diff --git a/modules/nf-core/bbmap/align/meta.yml b/modules/nf-core/bbmap/align/meta.yml index a0bddba4..f842a490 100644 --- a/modules/nf-core/bbmap/align/meta.yml +++ b/modules/nf-core/bbmap/align/meta.yml @@ -9,41 +9,55 @@ keywords: - reference tools: - bbmap: - description: BBMap is a short read aligner, as well as various other bioinformatic tools. + description: BBMap is a short read aligner, as well as various other bioinformatic + tools. homepage: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/ documentation: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/ licence: ["UC-LBL license (see package)"] + identifier: biotools:bbmap input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - fastq: - type: file - description: | - List of input FastQ files of size 1 and 2 for single-end and paired-end data, - respectively. - - ref: - type: file - description: | - Either "ref" a directory containing an index, the name of another directory - with a "ref" subdirectory containing an index or the name of a fasta formatted - nucleotide file containg the reference to map to. + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fastq: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. + - - ref: + type: file + description: | + Either "ref" a directory containing an index, the name of another directory + with a "ref" subdirectory containing an index or the name of a fasta formatted + nucleotide file containing the reference to map to. output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - bam: - type: file - description: BAM file - pattern: "*.{bam}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.bam": + type: file + description: BAM file + pattern: "*.{bam}" + - log: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.log": + type: file + description: Log file + pattern: "*.{log}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@erikrikarddaniel" maintainers: diff --git a/modules/nf-core/bbmap/align/tests/main.nf.test b/modules/nf-core/bbmap/align/tests/main.nf.test new file mode 100644 index 00000000..5763a584 --- /dev/null +++ b/modules/nf-core/bbmap/align/tests/main.nf.test @@ -0,0 +1,171 @@ +nextflow_process { + + name "Test Process BBMAP_ALIGN" + script "../main.nf" + process "BBMAP_ALIGN" + + tag "modules" + tag "modules_nfcore" + tag "bbmap" + tag "bbmap/align" + tag "bbmap/index" + + setup { + run("BBMAP_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + """ + } + } + } + + test("paired_end - fasta") { + + 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) + ] + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + file(process.out.log[0][1]).name, + process.out.bam.collect { meta, bamfile -> bam(bamfile).getReadsMD5()}, + process.out.versions + ).match() } + ) + } + + } + + test("paired_end - index") { + + 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) + ] + ] + input[1] = BBMAP_INDEX.out.index + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + file(process.out.log[0][1]).name, + process.out.bam.collect { meta, bamfile -> bam(bamfile).getReadsMD5()}, + process.out.versions + ).match() } + ) + } + + } + + test("single_end - index") { + + 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) + ] + ] + input[1] = BBMAP_INDEX.out.index + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + file(process.out.log[0][1]).name, + process.out.bam.collect { meta, bamfile -> bam(bamfile).getReadsMD5()}, + process.out.versions + ).match() } + ) + } + + } + + test("paired_end - index - pigz") { + config "./nextflow.config" + when { + params { + module_args = 'unpigz=t' + } + 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) + ] + ] + input[1] = BBMAP_INDEX.out.index + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + file(process.out.log[0][1]).name, + process.out.bam.collect { meta, bamfile -> bam(bamfile).getReadsMD5()}, + process.out.versions + ).match() } + ) + } + + } + + test("paired_end - index - 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) + ] + ] + input[1] = BBMAP_INDEX.out.index + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + file(process.out.log[0][1]).name, + process.out.bam.collect { meta, bamfile -> bam(bamfile).getReadsMD5()}, + process.out.versions + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/bbmap/align/tests/main.nf.test.snap b/modules/nf-core/bbmap/align/tests/main.nf.test.snap new file mode 100644 index 00000000..2423ad44 --- /dev/null +++ b/modules/nf-core/bbmap/align/tests/main.nf.test.snap @@ -0,0 +1,82 @@ +{ + "single_end - index": { + "content": [ + "test.bbmap.log", + [ + "c17efa4ccc4e9018090792c71af92660" + ], + [ + "versions.yml:md5,7c9a1c72ae9ea9c54b7518e96f8f89bb" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-08T21:06:20.348251263" + }, + "paired_end - index": { + "content": [ + "test.bbmap.log", + [ + "88d78879c34214288644aec7ec3cb270" + ], + [ + "versions.yml:md5,7c9a1c72ae9ea9c54b7518e96f8f89bb" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-08T21:06:05.162378558" + }, + "paired_end - fasta": { + "content": [ + "test.bbmap.log", + [ + "88d78879c34214288644aec7ec3cb270" + ], + [ + "versions.yml:md5,7c9a1c72ae9ea9c54b7518e96f8f89bb" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-08T21:05:49.658797332" + }, + "paired_end - index - pigz": { + "content": [ + "test.bbmap.log", + [ + "88d78879c34214288644aec7ec3cb270" + ], + [ + "versions.yml:md5,7c9a1c72ae9ea9c54b7518e96f8f89bb" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-08T21:06:36.326962674" + }, + "paired_end - index - stub": { + "content": [ + "test.bbmap.log", + [ + "d41d8cd98f00b204e9800998ecf8427e" + ], + [ + "versions.yml:md5,7c9a1c72ae9ea9c54b7518e96f8f89bb" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-08T21:06:47.377762689" + } +} \ No newline at end of file diff --git a/modules/nf-core/bbmap/align/tests/nextflow.config b/modules/nf-core/bbmap/align/tests/nextflow.config new file mode 100644 index 00000000..10088880 --- /dev/null +++ b/modules/nf-core/bbmap/align/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: BBMAP_ALIGN { + ext.args = params.module_args + } +} diff --git a/modules/nf-core/bbmap/bbduk/environment.yml b/modules/nf-core/bbmap/bbduk/environment.yml index 1221474c..a2f65506 100644 --- a/modules/nf-core/bbmap/bbduk/environment.yml +++ b/modules/nf-core/bbmap/bbduk/environment.yml @@ -1,7 +1,5 @@ -name: bbmap_bbduk channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bbmap=39.01 + - bioconda::bbmap=39.10 diff --git a/modules/nf-core/bbmap/bbduk/main.nf b/modules/nf-core/bbmap/bbduk/main.nf index 6453afc6..00bbdeda 100644 --- a/modules/nf-core/bbmap/bbduk/main.nf +++ b/modules/nf-core/bbmap/bbduk/main.nf @@ -4,8 +4,8 @@ process BBMAP_BBDUK { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bbmap:39.01--h5c4e2a8_0': - 'biocontainers/bbmap:39.01--h5c4e2a8_0' }" + 'https://depot.galaxyproject.org/singularity/bbmap:39.10--h92535d8_0': + 'biocontainers/bbmap:39.10--h92535d8_0' }" input: tuple val(meta), path(reads) @@ -40,4 +40,18 @@ process BBMAP_BBDUK { bbmap: \$(bbversion.sh | grep -v "Duplicate cpuset") END_VERSIONS """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def output_command = meta.single_end ? "echo '' | gzip > ${prefix}.fastq.gz" : "echo '' | gzip > ${prefix}_1.fastq.gz ; echo '' | gzip > ${prefix}_2.fastq.gz" + """ + touch ${prefix}.bbduk.log + $output_command + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bbmap: \$(bbversion.sh | grep -v "Duplicate cpuset") + END_VERSIONS + """ } diff --git a/modules/nf-core/bbmap/bbduk/meta.yml b/modules/nf-core/bbmap/bbduk/meta.yml index 9a1f0562..5665a268 100644 --- a/modules/nf-core/bbmap/bbduk/meta.yml +++ b/modules/nf-core/bbmap/bbduk/meta.yml @@ -7,43 +7,53 @@ keywords: - fastq tools: - bbmap: - description: BBMap is a short read aligner, as well as various other bioinformatic tools. + description: BBMap is a short read aligner, as well as various other bioinformatic + tools. homepage: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/ documentation: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/ licence: ["UC-LBL license (see package)"] + identifier: biotools:bbmap input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - reads: - type: file - description: | - List of input FastQ files of size 1 and 2 for single-end and paired-end data, - respectively. - - contaminants: - type: file - description: | - Reference files containing adapter and/or contaminant sequences for sequence kmer matching + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. + - - contaminants: + type: file + description: | + Reference files containing adapter and/or contaminant sequences for sequence kmer matching output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - reads: - type: file - description: The trimmed/modified fastq reads - pattern: "*fastq.gz" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.fastq.gz": + type: file + description: The trimmed/modified fastq reads + pattern: "*fastq.gz" - log: - type: file - description: Bbduk log file - pattern: "*bbduk.log" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.log": + type: file + description: Bbduk log file + pattern: "*bbduk.log" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@MGordon09" maintainers: diff --git a/modules/nf-core/bbmap/bbduk/tests/main.nf.test b/modules/nf-core/bbmap/bbduk/tests/main.nf.test new file mode 100644 index 00000000..0f3e8187 --- /dev/null +++ b/modules/nf-core/bbmap/bbduk/tests/main.nf.test @@ -0,0 +1,169 @@ +nextflow_process { + + name "Test Process BBMAP_BBDUK" + script "../main.nf" + process "BBMAP_BBDUK" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "bbmap" + tag "bbmap/bbduk" + + test("sarscov2 - single end fastq - fastq") { + + 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) ] + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.log.get(0).get(1)).getText().contains("Input is being processed as unpaired")}, + { assert snapshot(process.out.reads, + process.out.versions).match() } + ) + } + + } + + test("sarscov2 - paired end fastq - fastq") { + + 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) ] + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.log.get(0).get(1)).getText().contains("Input is being processed as paired")}, + { assert snapshot(process.out.reads, + process.out.versions).match() } + + ) + } + } + + test("sarscov2 - single end w/ contams [fastq,fasta] - fastq") { + + 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) ] + ] + input[1] = [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/transcriptome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.reads.get(0).get(1).endsWith("test.trim.fastq.gz") }, + { assert path(process.out.log.get(0).get(1)).getText().contains("Input is being processed as unpaired")}, + { assert snapshot(process.out.versions).match() } + + ) + } + } + + test("sarscov2 - paired end w/ contams [fastq,fasta] - fastq") { + + 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) ] + ] + input[1] = [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/transcriptome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.reads.get(0).get(1).get(0).endsWith("test.trim_1.fastq.gz") }, + { assert process.out.reads.get(0).get(1).get(1).endsWith("test.trim_2.fastq.gz") }, + { assert path(process.out.log.get(0).get(1)).getText().contains("Input is being processed as paired")}, + { assert snapshot(process.out.versions).match() } + + ) + } + } + + test("sarscov2 - single end fastq - fastq - 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) ] + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + + ) + } + + } + + test("sarscov2 - paired end fastq - fastq - 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) ] + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/bbmap/bbduk/tests/main.nf.test.snap b/modules/nf-core/bbmap/bbduk/tests/main.nf.test.snap new file mode 100644 index 00000000..258593ee --- /dev/null +++ b/modules/nf-core/bbmap/bbduk/tests/main.nf.test.snap @@ -0,0 +1,183 @@ +{ + "sarscov2 - paired end fastq - fastq": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.trim_1.fastq.gz:md5,4161df271f9bfcd25d5845a1e220dbec", + "test.trim_2.fastq.gz:md5,2ebae722295ea66d84075a3b042e2b42" + ] + ] + ], + [ + "versions.yml:md5,6d196411d38a3c3011a38e1a87c9203c" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T15:58:21.643811233" + }, + "sarscov2 - single end w/ contams [fastq,fasta] - fastq": { + "content": [ + [ + "versions.yml:md5,6d196411d38a3c3011a38e1a87c9203c" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T15:58:37.601191377" + }, + "sarscov2 - paired end w/ contams [fastq,fasta] - fastq": { + "content": [ + [ + "versions.yml:md5,6d196411d38a3c3011a38e1a87c9203c" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T15:59:00.943639834" + }, + "sarscov2 - paired end fastq - fastq - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.trim_1.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.trim_2.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.trim.bbduk.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,6d196411d38a3c3011a38e1a87c9203c" + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.trim.bbduk.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test.trim_1.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.trim_2.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "versions": [ + "versions.yml:md5,6d196411d38a3c3011a38e1a87c9203c" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T15:59:42.05304912" + }, + "sarscov2 - single end fastq - fastq - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.trim.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.trim.bbduk.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,6d196411d38a3c3011a38e1a87c9203c" + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.trim.bbduk.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.trim.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,6d196411d38a3c3011a38e1a87c9203c" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T15:59:25.580963139" + }, + "sarscov2 - single end fastq - fastq": { + "content": [ + [ + [ + { + "id": "test", + "single_end": true + }, + "test.trim.fastq.gz:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + [ + "versions.yml:md5,6d196411d38a3c3011a38e1a87c9203c" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T15:58:00.420305019" + } +} \ No newline at end of file diff --git a/modules/nf-core/bbmap/bbduk/tests/nextflow.config b/modules/nf-core/bbmap/bbduk/tests/nextflow.config new file mode 100644 index 00000000..44c775dc --- /dev/null +++ b/modules/nf-core/bbmap/bbduk/tests/nextflow.config @@ -0,0 +1,8 @@ +process { + + withName: BBMAP_BBDUK { + ext.args = 'trimq=10 qtrim=r' + ext.prefix = { "${meta.id}.trim" } + } + +} diff --git a/modules/nf-core/bbmap/bbduk/tests/tags.yml b/modules/nf-core/bbmap/bbduk/tests/tags.yml new file mode 100644 index 00000000..16d6171a --- /dev/null +++ b/modules/nf-core/bbmap/bbduk/tests/tags.yml @@ -0,0 +1,2 @@ +bbmap/bbduk: + - "modules/nf-core/bbmap/bbduk/**" diff --git a/modules/nf-core/bbmap/bbnorm/environment.yml b/modules/nf-core/bbmap/bbnorm/environment.yml index 8b97ffda..fa8209c0 100644 --- a/modules/nf-core/bbmap/bbnorm/environment.yml +++ b/modules/nf-core/bbmap/bbnorm/environment.yml @@ -1,8 +1,6 @@ -name: bbmap_bbnorm channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bbmap=39.01 - pigz=2.6 diff --git a/modules/nf-core/bbmap/bbnorm/meta.yml b/modules/nf-core/bbmap/bbnorm/meta.yml index 6c8426f8..e21f262a 100644 --- a/modules/nf-core/bbmap/bbnorm/meta.yml +++ b/modules/nf-core/bbmap/bbnorm/meta.yml @@ -1,40 +1,55 @@ name: bbmap_bbnorm -description: BBNorm is designed to normalize coverage by down-sampling reads over high-depth areas of a genome, to result in a flat coverage distribution. +description: BBNorm is designed to normalize coverage by down-sampling reads over + high-depth areas of a genome, to result in a flat coverage distribution. keywords: - normalization - assembly - coverage tools: - bbmap: - description: "BBMap is a short read aligner, as well as various other bioinformatic tools." + description: "BBMap is a short read aligner, as well as various other bioinformatic + tools." homepage: "https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/" documentation: "https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/" tool_dev_url: "https://jgi.doe.gov/data-and-tools/software-tools/bbtools/bb-tools-user-guide/bbnorm-guide/" - licence: "BBMap - Bushnell B. - sourceforge.net/projects/bbmap/" + licence: ["BBMap - Bushnell B. - sourceforge.net/projects/bbmap/"] + identifier: biotools:bbmap input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - fastq: - type: file - description: fastq file - pattern: "*.{fastq,fq}(.gz)?" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fastq: + type: file + description: fastq file + pattern: "*.{fastq,fq}(.gz)?" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - fastq: - type: file - description: fastq file - pattern: "*.{fastq, fq}.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.fastq.gz": + type: file + description: fastq file + pattern: "*.{fastq, fq}.gz" + - log: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.log": + type: file + description: log file + pattern: "*.log" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@danilodileo" maintainers: diff --git a/modules/nf-core/bbmap/bbnorm/tests/main.nf.test b/modules/nf-core/bbmap/bbnorm/tests/main.nf.test new file mode 100644 index 00000000..fc17dc1c --- /dev/null +++ b/modules/nf-core/bbmap/bbnorm/tests/main.nf.test @@ -0,0 +1,128 @@ + +nextflow_process { + + name "Test Process BBMAP_BBNORM" + script "../main.nf" + process "BBMAP_BBNORM" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "bbmap" + tag "bbmap/bbnorm" + + test("test-bbmap-bbnorm-se") { + + 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( + path(process.out.fastq[0][1]).linesGzip, + file(process.out.log[0][1]).name, + process.out.versions + ).match() + } + ) + } + } + + test("test-bbmap-bbnorm-pe") { + + 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.fastq[0][1].collect { path(it).linesGzip[0..1] }, + file(process.out.log[0][1]).name, + process.out.versions + ).match() + } + ) + } + } + + test("test-bbmap-bbnorm-interleaved") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:true ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_interleaved.fastq.gz', checkIfExists: true) ] + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.fastq[0][1]).linesGzip[3..7], + file(process.out.log[0][1]).name, + process.out.versions + ).match() + } + ) + } + } + + test("test-bbmap-bbnorm-multiple-input") { + + when { + process { + """ + input[0] = [ + [id:'test', single_end:true ], + [ + 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( + path(process.out.fastq[0][1]).linesGzip[3..7], + file(process.out.log[0][1]).name, + process.out.versions + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/bbmap/bbnorm/tests/main.nf.test.snap b/modules/nf-core/bbmap/bbnorm/tests/main.nf.test.snap new file mode 100644 index 00000000..1d7b2438 --- /dev/null +++ b/modules/nf-core/bbmap/bbnorm/tests/main.nf.test.snap @@ -0,0 +1,81 @@ +{ + "test-bbmap-bbnorm-interleaved": { + "content": [ + [ + "A/AA//EEAEA/E/AEEEE6EE/EEEA/6AEEEEEEEEE6EEEAEAEE//A/EEEEEE//E/E/A//E/E/< versions.yml + "${task.process}": + bbmap: \$(bbversion.sh | grep -v "Duplicate cpuset") + END_VERSIONS + """ + stub: + """ + mkdir -p ref + touch ref/info.txt + touch ref/summary.txt + cat <<-END_VERSIONS > versions.yml "${task.process}": bbmap: \$(bbversion.sh | grep -v "Duplicate cpuset") diff --git a/modules/nf-core/bbmap/index/meta.yml b/modules/nf-core/bbmap/index/meta.yml index 7e1cbc9f..ab852b41 100644 --- a/modules/nf-core/bbmap/index/meta.yml +++ b/modules/nf-core/bbmap/index/meta.yml @@ -1,29 +1,33 @@ name: bbmap_index -description: Creates an index from a fasta file, ready to be used by bbmap.sh in mapping mode. +description: Creates an index from a fasta file, ready to be used by bbmap.sh in mapping + mode. keywords: - map - index - fasta tools: - bbmap: - description: BBMap is a short read aligner, as well as various other bioinformatic tools. + description: BBMap is a short read aligner, as well as various other bioinformatic + tools. homepage: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/ documentation: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/ licence: ["UC-LBL license (see package)"] + identifier: biotools:bbmap input: - - fasta: - type: fasta - description: fasta formatted file with nucleotide sequences - pattern: "*.{fna,fa,fasta}" + - - fasta: + type: file + description: fasta formatted file with nucleotide sequences + pattern: "*.{fna,fa,fasta}" output: + - index: + - ref: + type: directory + description: Directory containing the index files - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - - db: - type: directory - description: Directory with index files - pattern: "ref" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@daniellundin" maintainers: diff --git a/modules/nf-core/bbmap/index/tests/main.nf.test b/modules/nf-core/bbmap/index/tests/main.nf.test new file mode 100644 index 00000000..7fe4cede --- /dev/null +++ b/modules/nf-core/bbmap/index/tests/main.nf.test @@ -0,0 +1,53 @@ +import groovy.io.FileType + +nextflow_process { + + name "Test Process BBMAP_INDEX" + script "../main.nf" + process "BBMAP_INDEX" + + tag "modules" + tag "modules_nfcore" + tag "bbmap" + tag "bbmap/index" + + test("test-bbmap-index") { + + when { + process { + """ + input[0] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { + def all_files = [] + + file(process.out.index[0]).eachFileRecurse (FileType.FILES) { file -> + all_files << file + } + + def all_file_names = all_files.collect { it.name }.toSorted() + + def stable_file_names = [ + 'chr1_index_k13_c15_b1.block' + ] + + def stable_files = all_files.findAll { it.name in stable_file_names }.toSorted() + + assert snapshot( + all_file_names, + stable_files, + process.out.versions[0] + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/bbmap/index/tests/main.nf.test.snap b/modules/nf-core/bbmap/index/tests/main.nf.test.snap new file mode 100644 index 00000000..3edd5b39 --- /dev/null +++ b/modules/nf-core/bbmap/index/tests/main.nf.test.snap @@ -0,0 +1,23 @@ +{ + "test-bbmap-index": { + "content": [ + [ + "chr1.chrom.gz", + "chr1_index_k13_c15_b1.block", + "chr1_index_k13_c15_b1.block2.gz", + "info.txt", + "scaffolds.txt.gz", + "summary.txt" + ], + [ + "chr1_index_k13_c15_b1.block:md5,9f0d9a7413c1d2c16cc24555b2381163" + ], + "versions.yml:md5,27981a0e7a64f63d28c9d7e27f5fde1b" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T16:10:24.122799573" + } +} \ No newline at end of file diff --git a/modules/nf-core/cat/cat/environment.yml b/modules/nf-core/cat/cat/environment.yml index 17a04ef2..9b01c865 100644 --- a/modules/nf-core/cat/cat/environment.yml +++ b/modules/nf-core/cat/cat/environment.yml @@ -1,7 +1,5 @@ -name: cat_cat channels: - conda-forge - bioconda - - defaults dependencies: - conda-forge::pigz=2.3.4 diff --git a/modules/nf-core/cat/cat/main.nf b/modules/nf-core/cat/cat/main.nf index adbdbd7b..2862c64c 100644 --- a/modules/nf-core/cat/cat/main.nf +++ b/modules/nf-core/cat/cat/main.nf @@ -76,4 +76,3 @@ def getFileSuffix(filename) { def match = filename =~ /^.*?((\.\w{1,5})?(\.\w{1,5}\.gz$))/ return match ? match[0][1] : filename.substring(filename.lastIndexOf('.')) } - diff --git a/modules/nf-core/cat/cat/meta.yml b/modules/nf-core/cat/cat/meta.yml index 00a8db0b..81778a06 100644 --- a/modules/nf-core/cat/cat/meta.yml +++ b/modules/nf-core/cat/cat/meta.yml @@ -9,25 +9,32 @@ tools: description: Just concatenation documentation: https://man7.org/linux/man-pages/man1/cat.1.html licence: ["GPL-3.0-or-later"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - files_in: - type: file - description: List of compressed / uncompressed files - pattern: "*" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - files_in: + type: file + description: List of compressed / uncompressed files + pattern: "*" output: - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - file_out: - type: file - description: Concatenated file. Will be gzipped if file_out ends with ".gz" - pattern: "${file_out}" + - meta: + type: file + description: Concatenated file. Will be gzipped if file_out ends with ".gz" + pattern: "${file_out}" + - ${prefix}: + type: file + description: Concatenated file. Will be gzipped if file_out ends with ".gz" + pattern: "${file_out}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@erikrikarddaniel" - "@FriederikeHanssen" diff --git a/modules/nf-core/cat/cat/tests/main.nf.test b/modules/nf-core/cat/cat/tests/main.nf.test index fcee2d19..9cb16178 100644 --- a/modules/nf-core/cat/cat/tests/main.nf.test +++ b/modules/nf-core/cat/cat/tests/main.nf.test @@ -29,7 +29,8 @@ nextflow_process { then { assertAll( { assert !process.success }, - { assert process.stdout.toString().contains("The name of the input file can't be the same as for the output prefix") } + { assert process.stdout.toString().contains("The name of the input file can't be the same as for the output prefix") }, + { assert snapshot(process.out.versions).match() } ) } } @@ -83,8 +84,12 @@ nextflow_process { def lines = path(process.out.file_out.get(0).get(1)).linesGzip assertAll( { assert process.success }, - { assert snapshot(lines[0..5]).match("test_cat_zipped_zipped_lines") }, - { assert snapshot(lines.size()).match("test_cat_zipped_zipped_size")} + { assert snapshot( + lines[0..5], + lines.size(), + process.out.versions + ).match() + } ) } } @@ -142,8 +147,12 @@ nextflow_process { def lines = path(process.out.file_out.get(0).get(1)).linesGzip assertAll( { assert process.success }, - { assert snapshot(lines[0..5]).match("test_cat_unzipped_zipped_lines") }, - { assert snapshot(lines.size()).match("test_cat_unzipped_zipped_size")} + { assert snapshot( + lines[0..5], + lines.size(), + process.out.versions + ).match() + } ) } } @@ -170,8 +179,12 @@ nextflow_process { def lines = path(process.out.file_out.get(0).get(1)).linesGzip assertAll( { assert process.success }, - { assert snapshot(lines[0..5]).match("test_cat_one_file_unzipped_zipped_lines") }, - { assert snapshot(lines.size()).match("test_cat_one_file_unzipped_zipped_size")} + { assert snapshot( + lines[0..5], + lines.size(), + process.out.versions + ).match() + } ) } } diff --git a/modules/nf-core/cat/cat/tests/main.nf.test.snap b/modules/nf-core/cat/cat/tests/main.nf.test.snap index 423571ba..b7623ee6 100644 --- a/modules/nf-core/cat/cat/tests/main.nf.test.snap +++ b/modules/nf-core/cat/cat/tests/main.nf.test.snap @@ -1,10 +1,4 @@ { - "test_cat_unzipped_zipped_size": { - "content": [ - 375 - ], - "timestamp": "2023-10-16T14:33:08.049445686" - }, "test_cat_unzipped_unzipped": { "content": [ { @@ -34,6 +28,10 @@ ] } ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, "timestamp": "2023-10-16T14:32:18.500464399" }, "test_cat_zipped_unzipped": { @@ -65,9 +63,13 @@ ] } ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, "timestamp": "2023-10-16T14:32:49.642741302" }, - "test_cat_zipped_zipped_lines": { + "test_cat_zipped_zipped": { "content": [ [ "MT192765.1\tGenbank\ttranscript\t259\t29667\t.\t+\t.\tID=unknown_transcript_1;geneID=orf1ab;gene_name=orf1ab", @@ -76,11 +78,31 @@ "MT192765.1\tGenbank\tCDS\t13461\t21548\t.\t+\t0\tParent=unknown_transcript_1;exception=\"ribosomal slippage\";gbkey=CDS;gene=orf1ab;note=\"pp1ab;translated=by -1 ribosomal frameshift\";product=\"orf1ab polyprotein\";protein_id=QIK50426.1", "MT192765.1\tGenbank\tCDS\t21556\t25377\t.\t+\t0\tParent=unknown_transcript_1;gbkey=CDS;gene=S;note=\"structural protein\";product=\"surface glycoprotein\";protein_id=QIK50427.1", "MT192765.1\tGenbank\tgene\t21556\t25377\t.\t+\t.\tParent=unknown_transcript_1" + ], + 78, + [ + "versions.yml:md5,115ed6177ebcff24eb99d503fa5ef894" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:51:46.802978" + }, + "test_cat_name_conflict": { + "content": [ + [ + ] ], - "timestamp": "2023-10-16T14:32:33.629048645" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:51:29.45394" }, - "test_cat_unzipped_zipped_lines": { + "test_cat_one_file_unzipped_zipped": { "content": [ [ ">MT192765.1 Severe acute respiratory syndrome coronavirus 2 isolate SARS-CoV-2/human/USA/PC00101P/2020, complete genome", @@ -89,11 +111,19 @@ "TAACTCGTCTATCTTCTGCAGGCTGCTTACGGTTTCGTCCGTGTTGCAGCCGATCATCAGCACATCTAGGTTTTGTCCGG", "GTGTGACCGAAAGGTAAGATGGAGAGCCTTGTCCCTGGTTTCAACGAGAAAACACACGTCCAACTCAGTTTGCCTGTTTT", "ACAGGTTCGCGACGTGCTCGTACGTGGCTTTGGAGACTCCGTGGAGGAGGTCTTATCAGAGGCACGTCAACATCTTAAAG" + ], + 374, + [ + "versions.yml:md5,115ed6177ebcff24eb99d503fa5ef894" ] ], - "timestamp": "2023-10-16T14:33:08.038830506" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:52:02.774016" }, - "test_cat_one_file_unzipped_zipped_lines": { + "test_cat_unzipped_zipped": { "content": [ [ ">MT192765.1 Severe acute respiratory syndrome coronavirus 2 isolate SARS-CoV-2/human/USA/PC00101P/2020, complete genome", @@ -102,20 +132,16 @@ "TAACTCGTCTATCTTCTGCAGGCTGCTTACGGTTTCGTCCGTGTTGCAGCCGATCATCAGCACATCTAGGTTTTGTCCGG", "GTGTGACCGAAAGGTAAGATGGAGAGCCTTGTCCCTGGTTTCAACGAGAAAACACACGTCCAACTCAGTTTGCCTGTTTT", "ACAGGTTCGCGACGTGCTCGTACGTGGCTTTGGAGACTCCGTGGAGGAGGTCTTATCAGAGGCACGTCAACATCTTAAAG" + ], + 375, + [ + "versions.yml:md5,115ed6177ebcff24eb99d503fa5ef894" ] ], - "timestamp": "2023-10-16T14:33:21.39642399" - }, - "test_cat_zipped_zipped_size": { - "content": [ - 78 - ], - "timestamp": "2023-10-16T14:32:33.641869244" - }, - "test_cat_one_file_unzipped_zipped_size": { - "content": [ - 374 - ], - "timestamp": "2023-10-16T14:33:21.4094373" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:51:57.581523" } } \ No newline at end of file diff --git a/modules/nf-core/fastqc/main.nf b/modules/nf-core/fastqc/main.nf index 752c3a10..033f4154 100644 --- a/modules/nf-core/fastqc/main.nf +++ b/modules/nf-core/fastqc/main.nf @@ -1,5 +1,5 @@ process FASTQC { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' conda "${moduleDir}/environment.yml" @@ -19,30 +19,30 @@ process FASTQC { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" // Make list of old name and new name pairs to use for renaming in the bash while loop def old_new_pairs = reads instanceof Path || reads.size() == 1 ? [[ reads, "${prefix}.${reads.extension}" ]] : reads.withIndex().collect { entry, index -> [ entry, "${prefix}_${index + 1}.${entry.extension}" ] } - def rename_to = old_new_pairs*.join(' ').join(' ') + def rename_to = old_new_pairs*.join(' ').join(' ') def renamed_files = old_new_pairs.collect{ _old_name, new_name -> new_name }.join(' ') // The total amount of allocated RAM by FastQC is equal to the number of threads defined (--threads) time the amount of RAM defined (--memory) // https://github.com/s-andrews/FastQC/blob/1faeea0412093224d7f6a07f777fad60a5650795/fastqc#L211-L222 // Dividing the task.memory by task.cpu allows to stick to requested amount of RAM in the label - def memory_in_mb = MemoryUnit.of("${task.memory}").toUnit('MB') / task.cpus + def memory_in_mb = task.memory ? task.memory.toUnit('MB').toFloat() / task.cpus : null // FastQC memory value allowed range (100 - 10000) def fastqc_memory = memory_in_mb > 10000 ? 10000 : (memory_in_mb < 100 ? 100 : memory_in_mb) """ - printf "%s %s\\n" $rename_to | while read old_name new_name; do + printf "%s %s\\n" ${rename_to} | while read old_name new_name; do [ -f "\${new_name}" ] || ln -s \$old_name \$new_name done fastqc \\ - $args \\ - --threads $task.cpus \\ - --memory $fastqc_memory \\ - $renamed_files + ${args} \\ + --threads ${task.cpus} \\ + --memory ${fastqc_memory} \\ + ${renamed_files} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/fastqc/tests/tags.yml b/modules/nf-core/fastqc/tests/tags.yml deleted file mode 100644 index 7834294b..00000000 --- a/modules/nf-core/fastqc/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -fastqc: - - modules/nf-core/fastqc/** diff --git a/modules/nf-core/hmmer/hmmsearch/environment.yml b/modules/nf-core/hmmer/hmmsearch/environment.yml index d672c2b3..c5ddec5d 100644 --- a/modules/nf-core/hmmer/hmmsearch/environment.yml +++ b/modules/nf-core/hmmer/hmmsearch/environment.yml @@ -1,7 +1,5 @@ -name: hmmer_hmmsearch channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::hmmer=3.4 diff --git a/modules/nf-core/hmmer/hmmsearch/meta.yml b/modules/nf-core/hmmer/hmmsearch/meta.yml index 39893c3b..0e078659 100644 --- a/modules/nf-core/hmmer/hmmsearch/meta.yml +++ b/modules/nf-core/hmmer/hmmsearch/meta.yml @@ -13,55 +13,79 @@ tools: tool_dev_url: https://github.com/EddyRivasLab/hmmer doi: "10.1371/journal.pcbi.1002195" licence: ["BSD"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - hmmfile: - type: file - description: One or more HMM profiles created with hmmbuild - pattern: "*.{hmm,hmm.gz}" - - seqdb: - type: file - description: Database of sequences in FASTA format - pattern: "*.{fasta,fna,faa,fa,fasta.gz,fna.gz,faa.gz,fa.gz}" - - write_align: - type: boolean - description: Flag to save optional alignment output. Specify with 'true' to save. - - write_target: - type: boolean - description: Flag to save optional per target summary. Specify with 'true' to save. - - write_domain: - type: boolean - description: Flag to save optional per domain summary. Specify with 'true' to save. + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - hmmfile: + type: file + description: One or more HMM profiles created with hmmbuild + pattern: "*.{hmm,hmm.gz}" + - seqdb: + type: file + description: Database of sequences in FASTA format + pattern: "*.{fasta,fna,faa,fa,fasta.gz,fna.gz,faa.gz,fa.gz}" + - write_align: + type: boolean + description: Flag to save optional alignment output. Specify with 'true' to + save. + - write_target: + type: boolean + description: Flag to save optional per target summary. Specify with 'true' to + save. + - write_domain: + type: boolean + description: Flag to save optional per domain summary. Specify with 'true' to + save. output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - output: - type: file - description: Human readable output summarizing hmmsearch results - pattern: "*.{txt.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.txt.gz": + type: file + description: Human readable output summarizing hmmsearch results + pattern: "*.{txt.gz}" - alignments: - type: file - description: Optional multiple sequence alignment (MSA) in Stockholm format - pattern: "*.{sto.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.sto.gz": + type: file + description: Optional multiple sequence alignment (MSA) in Stockholm format + pattern: "*.{sto.gz}" - target_summary: - type: file - description: Optional tabular (space-delimited) summary of per-target output - pattern: "*.{tbl.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tbl.gz": + type: file + description: Optional tabular (space-delimited) summary of per-target output + pattern: "*.{tbl.gz}" - domain_summary: - type: file - description: Optional tabular (space-delimited) summary of per-domain output - pattern: "*.{domtbl.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.domtbl.gz": + type: file + description: Optional tabular (space-delimited) summary of per-domain output + pattern: "*.{domtbl.gz}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@Midnighter" maintainers: diff --git a/modules/nf-core/multiqc/environment.yml b/modules/nf-core/multiqc/environment.yml index 6f5b867b..439a7c22 100644 --- a/modules/nf-core/multiqc/environment.yml +++ b/modules/nf-core/multiqc/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::multiqc=1.25.1 + - bioconda::multiqc=1.26 diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index cc0643e1..775b3ffd 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -3,8 +3,8 @@ process MULTIQC { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.25.1--pyhdfd78af_0' : - 'biocontainers/multiqc:1.25.1--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/multiqc:1.26--pyhdfd78af_0' : + 'biocontainers/multiqc:1.26--pyhdfd78af_0' }" input: path multiqc_files, stageAs: "?/*" diff --git a/modules/nf-core/multiqc/tests/main.nf.test.snap b/modules/nf-core/multiqc/tests/main.nf.test.snap index 2fcbb5ff..ee01208e 100644 --- a/modules/nf-core/multiqc/tests/main.nf.test.snap +++ b/modules/nf-core/multiqc/tests/main.nf.test.snap @@ -2,7 +2,7 @@ "multiqc_versions_single": { "content": [ [ - "versions.yml:md5,41f391dcedce7f93ca188f3a3ffa0916" + "versions.yml:md5,4cab99fb04e679fd2d72e29eda1b9646" ] ], "meta": { @@ -17,7 +17,7 @@ "multiqc_report.html", "multiqc_data", "multiqc_plots", - "versions.yml:md5,41f391dcedce7f93ca188f3a3ffa0916" + "versions.yml:md5,4cab99fb04e679fd2d72e29eda1b9646" ] ], "meta": { @@ -29,7 +29,7 @@ "multiqc_versions_config": { "content": [ [ - "versions.yml:md5,41f391dcedce7f93ca188f3a3ffa0916" + "versions.yml:md5,4cab99fb04e679fd2d72e29eda1b9646" ] ], "meta": { diff --git a/modules/nf-core/pigz/compress/environment.yml b/modules/nf-core/pigz/compress/environment.yml index 7551d187..5016d226 100644 --- a/modules/nf-core/pigz/compress/environment.yml +++ b/modules/nf-core/pigz/compress/environment.yml @@ -1,9 +1,7 @@ --- # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json -name: "pigz_compress" channels: - conda-forge - bioconda - - defaults dependencies: - "pigz=2.8" diff --git a/modules/nf-core/pigz/compress/meta.yml b/modules/nf-core/pigz/compress/meta.yml index 42efd735..0966e651 100644 --- a/modules/nf-core/pigz/compress/meta.yml +++ b/modules/nf-core/pigz/compress/meta.yml @@ -1,4 +1,3 @@ ---- # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json name: "pigz_compress" description: Compresses files with pigz. @@ -12,35 +11,33 @@ tools: homepage: "https://zlib.net/pigz/" documentation: "https://zlib.net/pigz/pigz.pdf" + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1', single_end:false ]` - - - raw_file: - type: file - description: File to be compressed - pattern: "*.*" - + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - raw_file: + type: file + description: File to be compressed + pattern: "*.*" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1', single_end:false ]` - - archive: - type: file - description: The compressed file - pattern: "*.gz" - + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - $archive: + type: file + description: The compressed file + pattern: "*.gz" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@leoisl" maintainers: diff --git a/modules/nf-core/pigz/compress/tests/main.nf.test b/modules/nf-core/pigz/compress/tests/main.nf.test index 248d40fb..b3cb25e3 100644 --- a/modules/nf-core/pigz/compress/tests/main.nf.test +++ b/modules/nf-core/pigz/compress/tests/main.nf.test @@ -14,7 +14,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -34,7 +34,7 @@ nextflow_process { """ input[0] = [ [ id:'test'], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -42,7 +42,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.archive[0][1]).name).match() } + { assert snapshot( + file(process.out.archive[0][1]).name, + process.out.versions + ).match() + } ) } } diff --git a/modules/nf-core/pigz/compress/tests/main.nf.test.snap b/modules/nf-core/pigz/compress/tests/main.nf.test.snap index 6e50456f..4d8df9f1 100644 --- a/modules/nf-core/pigz/compress/tests/main.nf.test.snap +++ b/modules/nf-core/pigz/compress/tests/main.nf.test.snap @@ -26,12 +26,23 @@ ] } ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, "timestamp": "2023-12-11T22:39:53.350546" }, "sarscov2 - genome - fasta - stub": { "content": [ - "genome.fasta.gz" + "genome.fasta.gz", + [ + "versions.yml:md5,ca30e9e1ffa1394ba7eefdac8cf3a3ad" + ] ], - "timestamp": "2023-12-11T22:52:24.309192" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-30T12:18:32.339508" } } \ No newline at end of file diff --git a/modules/nf-core/prodigal/environment.yml b/modules/nf-core/prodigal/environment.yml index 85746534..7609bf3b 100644 --- a/modules/nf-core/prodigal/environment.yml +++ b/modules/nf-core/prodigal/environment.yml @@ -1,8 +1,6 @@ -name: prodigal channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::prodigal=2.6.3 - conda-forge::pigz=2.6 diff --git a/modules/nf-core/prodigal/meta.yml b/modules/nf-core/prodigal/meta.yml index a5d15d58..7d3d459e 100644 --- a/modules/nf-core/prodigal/meta.yml +++ b/modules/nf-core/prodigal/meta.yml @@ -1,55 +1,78 @@ name: prodigal -description: Prodigal (Prokaryotic Dynamic Programming Genefinding Algorithm) is a microbial (bacterial and archaeal) gene finding program +description: Prodigal (Prokaryotic Dynamic Programming Genefinding Algorithm) is a + microbial (bacterial and archaeal) gene finding program keywords: - prokaryotes - gene finding - microbial tools: - prodigal: - description: Prodigal (Prokaryotic Dynamic Programming Genefinding Algorithm) is a microbial (bacterial and archaeal) gene finding program + description: Prodigal (Prokaryotic Dynamic Programming Genefinding Algorithm) + is a microbial (bacterial and archaeal) gene finding program homepage: https://github.com/hyattpd/Prodigal documentation: https://github.com/hyattpd/prodigal/wiki tool_dev_url: https://github.com/hyattpd/Prodigal doi: "10.1186/1471-2105-11-119" licence: ["GPL v3"] + identifier: biotools:prodigal input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - genome: - type: file - description: fasta/fasta.gz file - - output_format: - type: string - description: Output format ("gbk"/"gff"/"sqn"/"sco") + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - genome: + type: file + description: fasta/fasta.gz file + - - output_format: + type: string + description: Output format ("gbk"/"gff"/"sqn"/"sco") output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - gene_annotations: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.${output_format}.gz: + type: file + description: gene annotations in output_format given as input + pattern: "*.{output_format}" - nucleotide_fasta: - type: file - description: nucleotide sequences file - pattern: "*.{fna}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.fna.gz: + type: file + description: nucleotide sequences file + pattern: "*.{fna}" - amino_acid_fasta: - type: file - description: protein translations file - pattern: "*.{faa}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}.faa.gz: + type: file + description: protein translations file + pattern: "*.{faa}" - all_gene_annotations: - type: file - description: complete starts file - pattern: "*.{_all.txt}" - - gene_annotations: - type: file - description: gene annotations in output_format given as input - pattern: "*.{output_format}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}_all.txt.gz: + type: file + description: complete starts file + pattern: "*.{_all.txt}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@grst" maintainers: diff --git a/modules/nf-core/prodigal/tests/main.nf.test b/modules/nf-core/prodigal/tests/main.nf.test index 5bcb67d5..446bd0d1 100644 --- a/modules/nf-core/prodigal/tests/main.nf.test +++ b/modules/nf-core/prodigal/tests/main.nf.test @@ -14,7 +14,7 @@ nextflow_process { """ input[0] = [ [id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = 'gff' """ @@ -35,7 +35,7 @@ nextflow_process { """ input[0] = [ [id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = 'gbk' """ @@ -59,7 +59,7 @@ nextflow_process { """ input[0] = [ [id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = 'gff' """ @@ -83,7 +83,7 @@ nextflow_process { """ input[0] = [ [id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = 'gbk' """ diff --git a/modules/nf-core/prokka/environment.yml b/modules/nf-core/prokka/environment.yml index d7c44d5a..1d1a019f 100644 --- a/modules/nf-core/prokka/environment.yml +++ b/modules/nf-core/prokka/environment.yml @@ -1,7 +1,6 @@ -name: prokka channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::prokka=1.14.6 + - conda-forge::openjdk=8.0.412 diff --git a/modules/nf-core/prokka/main.nf b/modules/nf-core/prokka/main.nf index adfda037..bf5e64fc 100644 --- a/modules/nf-core/prokka/main.nf +++ b/modules/nf-core/prokka/main.nf @@ -1,11 +1,11 @@ process PROKKA { - tag "$meta.id" + tag "${meta.id}" label 'process_low' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/prokka:1.14.6--pl5321hdfd78af_4' : - 'biocontainers/prokka:1.14.6--pl5321hdfd78af_4' }" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/3a/3af46b047c8fe84112adeaecf300878217c629b97f111f923ecf327656ddd141/data' : + 'community.wave.seqera.io/library/prokka_openjdk:10546cadeef11472' }" input: tuple val(meta), path(fasta) @@ -31,18 +31,49 @@ process PROKKA { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "${meta.id}" - def proteins_opt = proteins ? "--proteins ${proteins[0]}" : "" - def prodigal_tf = prodigal_tf ? "--prodigaltf ${prodigal_tf[0]}" : "" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def input = fasta.toString() - ~/\.gz$/ + def decompress = fasta.getExtension() == "gz" ? "gunzip -c ${fasta} > ${input}" : "" + def cleanup = fasta.getExtension() == "gz" ? "rm ${input}" : "" + def proteins_opt = proteins ? "--proteins ${proteins}" : "" + def prodigal_tf_in = prodigal_tf ? "--prodigaltf ${prodigal_tf}" : "" """ + ${decompress} + prokka \\ - $args \\ - --cpus $task.cpus \\ - --prefix $prefix \\ - $proteins_opt \\ - $prodigal_tf \\ - $fasta + ${args} \\ + --cpus ${task.cpus} \\ + --prefix ${prefix} \\ + ${proteins_opt} \\ + ${prodigal_tf_in} \\ + ${input} + + ${cleanup} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + prokka: \$(echo \$(prokka --version 2>&1) | sed 's/^.*prokka //') + END_VERSIONS + """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + """ + mkdir ${prefix} + touch ${prefix}/${prefix}.gff + touch ${prefix}/${prefix}.gbk + touch ${prefix}/${prefix}.fna + touch ${prefix}/${prefix}.faa + touch ${prefix}/${prefix}.ffn + touch ${prefix}/${prefix}.sqn + touch ${prefix}/${prefix}.fsa + touch ${prefix}/${prefix}.tbl + touch ${prefix}/${prefix}.err + touch ${prefix}/${prefix}.log + touch ${prefix}/${prefix}.txt + touch ${prefix}/${prefix}.tsv + touch ${prefix}/${prefix}.gff cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/prokka/meta.yml b/modules/nf-core/prokka/meta.yml index 9d82ffac..90745735 100644 --- a/modules/nf-core/prokka/meta.yml +++ b/modules/nf-core/prokka/meta.yml @@ -10,80 +10,151 @@ tools: homepage: https://github.com/tseemann/prokka doi: "10.1093/bioinformatics/btu153" licence: ["GPL v2"] + identifier: biotools:prokka input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - fasta: - type: file - description: | - FASTA file to be annotated. Has to contain at least a non-empty string dummy value. - - proteins: - type: file - description: FASTA file of trusted proteins to first annotate from (optional) - - prodigal_tf: - type: file - description: Training file to use for Prodigal (optional) + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: | + FASTA file to be annotated. Has to contain at least a non-empty string dummy value. + - - proteins: + type: file + description: FASTA file of trusted proteins to first annotate from (optional) + - - prodigal_tf: + type: file + description: Training file to use for Prodigal (optional) output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - gff: - type: file - description: annotation in GFF3 format, containing both sequences and annotations - pattern: "*.{gff}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}/*.gff: + type: file + description: annotation in GFF3 format, containing both sequences and annotations + pattern: "*.{gff}" - gbk: - type: file - description: annotation in GenBank format, containing both sequences and annotations - pattern: "*.{gbk}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}/*.gbk: + type: file + description: annotation in GenBank format, containing both sequences and annotations + pattern: "*.{gbk}" - fna: - type: file - description: nucleotide FASTA file of the input contig sequences - pattern: "*.{fna}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}/*.fna: + type: file + description: nucleotide FASTA file of the input contig sequences + pattern: "*.{fna}" - faa: - type: file - description: protein FASTA file of the translated CDS sequences - pattern: "*.{faa}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}/*.faa: + type: file + description: protein FASTA file of the translated CDS sequences + pattern: "*.{faa}" - ffn: - type: file - description: nucleotide FASTA file of all the prediction transcripts (CDS, rRNA, tRNA, tmRNA, misc_RNA) - pattern: "*.{ffn}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}/*.ffn: + type: file + description: nucleotide FASTA file of all the prediction transcripts (CDS, rRNA, + tRNA, tmRNA, misc_RNA) + pattern: "*.{ffn}" - sqn: - type: file - description: an ASN1 format "Sequin" file for submission to Genbank - pattern: "*.{sqn}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}/*.sqn: + type: file + description: an ASN1 format "Sequin" file for submission to Genbank + pattern: "*.{sqn}" - fsa: - type: file - description: nucleotide FASTA file of the input contig sequences, used by "tbl2asn" to create the .sqn file - pattern: "*.{fsa}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}/*.fsa: + type: file + description: nucleotide FASTA file of the input contig sequences, used by "tbl2asn" + to create the .sqn file + pattern: "*.{fsa}" - tbl: - type: file - description: feature Table file, used by "tbl2asn" to create the .sqn file - pattern: "*.{tbl}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}/*.tbl: + type: file + description: feature Table file, used by "tbl2asn" to create the .sqn file + pattern: "*.{tbl}" - err: - type: file - description: unacceptable annotations - the NCBI discrepancy report. - pattern: "*.{err}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}/*.err: + type: file + description: unacceptable annotations - the NCBI discrepancy report. + pattern: "*.{err}" - log: - type: file - description: contains all the output that Prokka produced during its run - pattern: "*.{log}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}/*.log: + type: file + description: contains all the output that Prokka produced during its run + pattern: "*.{log}" - txt: - type: file - description: statistics relating to the annotated features found - pattern: "*.{txt}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}/*.txt: + type: file + description: statistics relating to the annotated features found + pattern: "*.{txt}" - tsv: - type: file - description: tab-separated file of all features (locus_tag,ftype,len_bp,gene,EC_number,COG,product) - pattern: "*.{tsv}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${prefix}/*.tsv: + type: file + description: tab-separated file of all features (locus_tag,ftype,len_bp,gene,EC_number,COG,product) + pattern: "*.{tsv}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@rpetit3" maintainers: diff --git a/modules/nf-core/prokka/tests/main.nf.test b/modules/nf-core/prokka/tests/main.nf.test index 3b59ef3a..68150b33 100644 --- a/modules/nf-core/prokka/tests/main.nf.test +++ b/modules/nf-core/prokka/tests/main.nf.test @@ -15,7 +15,7 @@ nextflow_process { """ input[0] = Channel.fromList([ tuple([ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)) + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)) ]) input[1] = [] input[2] = [] @@ -26,18 +26,87 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.gff).match("gff") }, - { assert snapshot(process.out.fna).match("fna") }, - { assert snapshot(process.out.faa).match("faa") }, - { assert snapshot(process.out.ffn).match("ffn") }, - { assert snapshot(process.out.fsa).match("fsa") }, - { assert snapshot(process.out.tbl).match("tbl") }, - { assert snapshot(process.out.err).match("err") }, - { assert snapshot(process.out.txt).match("txt") }, - { assert snapshot(process.out.tsv).match("tsv") }, { assert path(process.out.gbk.get(0).get(1)).exists() }, { assert path(process.out.log.get(0).get(1)).exists() }, - { assert path(process.out.sqn.get(0).get(1)).exists() } + { assert path(process.out.sqn.get(0).get(1)).exists() }, + { assert snapshot( + process.out.gff, + process.out.fna, + process.out.faa, + process.out.ffn, + process.out.fsa, + process.out.tbl, + process.out.err, + process.out.txt, + process.out.tsv, + process.out.versions + ).match() + } + ) + } + + } + + test("Prokka - sarscov2 - genome.fasta.gz") { + + when { + process { + """ + input[0] = Channel.fromList([ + tuple([ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true)) + ]) + input[1] = [] + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.gbk.get(0).get(1)).exists() }, + { assert path(process.out.log.get(0).get(1)).exists() }, + { assert path(process.out.sqn.get(0).get(1)).exists() }, + { assert snapshot( + process.out.gff, + process.out.fna, + process.out.faa, + process.out.ffn, + process.out.fsa, + process.out.tbl, + process.out.err, + process.out.txt, + process.out.tsv, + process.out.versions + ).match() + } + ) + } + + } + + test("Prokka - sarscov2 - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.fromList([ + tuple([ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true)) + ]) + input[1] = [] + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/prokka/tests/main.nf.test.snap b/modules/nf-core/prokka/tests/main.nf.test.snap index 859e8df8..35713a8f 100644 --- a/modules/nf-core/prokka/tests/main.nf.test.snap +++ b/modules/nf-core/prokka/tests/main.nf.test.snap @@ -1,5 +1,5 @@ { - "txt": { + "Prokka - sarscov2 - genome.fasta": { "content": [ [ [ @@ -7,28 +7,36 @@ "id": "test", "single_end": false }, - "test.txt:md5,b40e485ffc8eaf1feacf8d79d9751a33" + "test.gff:md5,5dbfb8fcf2db020564c16045976a0933" ] - ] - ], - "timestamp": "2023-12-14T15:19:54.84139118" - }, - "err": { - "content": [ + ], [ [ { "id": "test", "single_end": false }, - "test.err:md5,b3daedc646fddd422824e2b3e5e9229d" + "test.fna:md5,787307f29a263e5657cc276ebbf7e2b3" ] - ] - ], - "timestamp": "2023-12-14T15:19:54.837204155" - }, - "fsa": { - "content": [ + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.faa:md5,a4ceda83262b3c222a6b1f508fb9e24b" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.ffn:md5,80f474b5367b7ea5ed23791935f65e34" + ] + ], [ [ { @@ -37,26 +45,34 @@ }, "test.fsa:md5,71bbefcb7f12046bcd3263f58cfd5404" ] - ] - ], - "timestamp": "2023-12-14T15:19:54.803513721" - }, - "gff": { - "content": [ + ], [ [ { "id": "test", "single_end": false }, - "test.gff:md5,5dbfb8fcf2db020564c16045976a0933" + "test.tbl:md5,d8f816a066ced94b62d9618b13fb8add" ] - ] - ], - "timestamp": "2023-12-14T15:19:54.710100529" - }, - "tsv": { - "content": [ + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.err:md5,b3daedc646fddd422824e2b3e5e9229d" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,b40e485ffc8eaf1feacf8d79d9751a33" + ] + ], [ [ { @@ -65,11 +81,18 @@ }, "test.tsv:md5,da7c720c3018c5081d6a70b517b7d450" ] + ], + [ + "versions.yml:md5,e83a22fe02167e290d90853b45650db9" ] ], - "timestamp": "2023-12-14T15:19:54.846026731" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-30T12:34:20.447734" }, - "faa": { + "Prokka - sarscov2 - genome.fasta.gz": { "content": [ [ [ @@ -77,14 +100,9 @@ "id": "test", "single_end": false }, - "test.faa:md5,a4ceda83262b3c222a6b1f508fb9e24b" + "test.gff:md5,5dbfb8fcf2db020564c16045976a0933" ] - ] - ], - "timestamp": "2023-12-14T15:19:54.722112433" - }, - "fna": { - "content": [ + ], [ [ { @@ -93,12 +111,16 @@ }, "test.fna:md5,787307f29a263e5657cc276ebbf7e2b3" ] - ] - ], - "timestamp": "2023-12-14T15:19:54.717325796" - }, - "ffn": { - "content": [ + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.faa:md5,a4ceda83262b3c222a6b1f508fb9e24b" + ] + ], [ [ { @@ -107,12 +129,16 @@ }, "test.ffn:md5,80f474b5367b7ea5ed23791935f65e34" ] - ] - ], - "timestamp": "2023-12-14T15:19:54.727149899" - }, - "tbl": { - "content": [ + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.fsa:md5,71bbefcb7f12046bcd3263f58cfd5404" + ] + ], [ [ { @@ -121,8 +147,275 @@ }, "test.tbl:md5,d8f816a066ced94b62d9618b13fb8add" ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.err:md5,b3daedc646fddd422824e2b3e5e9229d" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,b40e485ffc8eaf1feacf8d79d9751a33" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,da7c720c3018c5081d6a70b517b7d450" + ] + ], + [ + "versions.yml:md5,e83a22fe02167e290d90853b45650db9" ] ], - "timestamp": "2023-12-14T15:19:54.831206944" + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2024-12-19T09:48:05.110188714" + }, + "Prokka - sarscov2 - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.gff:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + "versions.yml:md5,e83a22fe02167e290d90853b45650db9" + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fna:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.faa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ffn:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sqn:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fsa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tbl:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": false + }, + "test.err:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "9": [ + [ + { + "id": "test", + "single_end": false + }, + "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "err": [ + [ + { + "id": "test", + "single_end": false + }, + "test.err:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "faa": [ + [ + { + "id": "test", + "single_end": false + }, + "test.faa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "ffn": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ffn:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fna": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fna:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fsa": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fsa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gbk": [ + [ + { + "id": "test", + "single_end": false + }, + "test.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gff": [ + [ + { + "id": "test", + "single_end": false + }, + "test.gff:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "sqn": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sqn:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbl": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tbl:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "txt": [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e83a22fe02167e290d90853b45650db9" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-06T10:51:57.362187225" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/flagstat/environment.yml b/modules/nf-core/samtools/flagstat/environment.yml index bd57cb54..62054fc9 100644 --- a/modules/nf-core/samtools/flagstat/environment.yml +++ b/modules/nf-core/samtools/flagstat/environment.yml @@ -1,8 +1,8 @@ -name: samtools_flagstat +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.19.2 - - bioconda::htslib=1.19.1 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/flagstat/main.nf b/modules/nf-core/samtools/flagstat/main.nf index eb5f5252..c23f3a5c 100644 --- a/modules/nf-core/samtools/flagstat/main.nf +++ b/modules/nf-core/samtools/flagstat/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_FLAGSTAT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : - 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta), path(bam), path(bai) @@ -18,7 +18,6 @@ process SAMTOOLS_FLAGSTAT { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ samtools \\ diff --git a/modules/nf-core/samtools/flagstat/meta.yml b/modules/nf-core/samtools/flagstat/meta.yml index 97991358..cdc4c254 100644 --- a/modules/nf-core/samtools/flagstat/meta.yml +++ b/modules/nf-core/samtools/flagstat/meta.yml @@ -1,5 +1,6 @@ name: samtools_flagstat -description: Counts the number of alignments in a BAM/CRAM/SAM file for each FLAG type +description: Counts the number of alignments in a BAM/CRAM/SAM file for each FLAG + type keywords: - stats - mapping @@ -17,34 +18,37 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - - bai: - type: file - description: Index for BAM/CRAM/SAM file - pattern: "*.{bai,crai,sai}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - bai: + type: file + description: Index for BAM/CRAM/SAM file + pattern: "*.{bai,crai,sai}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - flagstat: - type: file - description: File containing samtools flagstat output - pattern: "*.{flagstat}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.flagstat": + type: file + description: File containing samtools flagstat output + pattern: "*.{flagstat}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" maintainers: diff --git a/modules/nf-core/samtools/flagstat/tests/main.nf.test b/modules/nf-core/samtools/flagstat/tests/main.nf.test index 24c3c04b..3b648a37 100644 --- a/modules/nf-core/samtools/flagstat/tests/main.nf.test +++ b/modules/nf-core/samtools/flagstat/tests/main.nf.test @@ -11,9 +11,30 @@ nextflow_process { test("BAM") { when { - params { - outdir = "$outputDir" + 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) + ]) + """ } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("BAM - stub") { + + options "-stub" + + when { process { """ input[0] = Channel.of([ @@ -28,8 +49,7 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.flagstat).match("flagstat") }, - { assert snapshot(process.out.versions).match("versions") } + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap b/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap index a76fc27e..04c3852b 100644 --- a/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap @@ -1,32 +1,72 @@ { - "flagstat": { + "BAM - stub": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,108a155f2d4a99f50bf3176904208d27" + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,108a155f2d4a99f50bf3176904208d27" ] - ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-12T18:31:37.783927" + "timestamp": "2024-09-16T08:02:58.866491759" }, - "versions": { + "BAM": { "content": [ - [ - "versions.yml:md5,fd0030ce49ab3a92091ad80260226452" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + ] + ], + "1": [ + "versions.yml:md5,108a155f2d4a99f50bf3176904208d27" + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + ] + ], + "versions": [ + "versions.yml:md5,108a155f2d4a99f50bf3176904208d27" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-13T16:11:44.299617452" + "timestamp": "2024-09-16T08:02:47.383332837" } } \ No newline at end of file