diff --git a/modules/nf-core/cutadapt/environment.yml b/modules/nf-core/cutadapt/environment.yml index b1ebb92747c5..cf84fbfa0069 100644 --- a/modules/nf-core/cutadapt/environment.yml +++ b/modules/nf-core/cutadapt/environment.yml @@ -4,4 +4,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::cutadapt=5.0 + - bioconda::cutadapt=5.2 diff --git a/modules/nf-core/cutadapt/main.nf b/modules/nf-core/cutadapt/main.nf index 84d97d4de868..c1f8a9a4ee68 100644 --- a/modules/nf-core/cutadapt/main.nf +++ b/modules/nf-core/cutadapt/main.nf @@ -3,9 +3,9 @@ process CUTADAPT { label 'process_medium' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/17/1758869538eb8e658077cc14cd7a4e76fd9b6d73d3a68f85a70bf292e39e27c5/data' : - 'community.wave.seqera.io/library/cutadapt:5.0--991bbd2e184b7014' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cutadapt:5.2--py311haab0aaa_0' : + 'biocontainers/cutadapt:5.2--py311haab0aaa_0'}" input: tuple val(meta), path(reads) @@ -13,7 +13,7 @@ process CUTADAPT { output: tuple val(meta), path('*.trim.fastq.gz'), emit: reads tuple val(meta), path('*.log') , emit: log - path "versions.yml" , emit: versions + tuple val("${task.process}"), val("cutadapt"), eval('cutadapt --version'), topic: versions, emit: versions_cutadapt when: task.ext.when == null || task.ext.when @@ -24,28 +24,24 @@ process CUTADAPT { def trimmed = meta.single_end ? "-o ${prefix}.trim.fastq.gz" : "-o ${prefix}_1.trim.fastq.gz -p ${prefix}_2.trim.fastq.gz" """ cutadapt \\ - -Z \\ --cores $task.cpus \\ $args \\ $trimmed \\ $reads \\ > ${prefix}.cutadapt.log - cat <<-END_VERSIONS > versions.yml - "${task.process}": - cutadapt: \$(cutadapt --version) - END_VERSIONS """ stub: - def prefix = task.ext.prefix ?: "${meta.id}" - def trimmed = meta.single_end ? "${prefix}.trim.fastq.gz" : "${prefix}_1.trim.fastq.gz ${prefix}_2.trim.fastq.gz" + def prefix = task.ext.prefix ?: "${meta.id}" + if (meta.single_end) { + output_command = "echo '' | gzip > ${prefix}.trim.fastq.gz ;" + } + else { + output_command = "echo '' | gzip > ${prefix}_1.trim.fastq.gz ;" + output_command += "echo '' | gzip > ${prefix}_2.trim.fastq.gz ;" + } """ + ${output_command} touch ${prefix}.cutadapt.log - touch ${trimmed} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - cutadapt: \$(cutadapt --version) - END_VERSIONS """ } diff --git a/modules/nf-core/cutadapt/meta.yml b/modules/nf-core/cutadapt/meta.yml index 86179a570c34..a4717b56a2c1 100644 --- a/modules/nf-core/cutadapt/meta.yml +++ b/modules/nf-core/cutadapt/meta.yml @@ -1,18 +1,22 @@ name: cutadapt -description: Perform adapter/quality trimming on sequencing reads +description: Removes adapter sequences from sequencing reads keywords: + - adapter + - primers + - poly-A tails - trimming - - adapter trimming - - adapters - - quality trimming + - fastq tools: - - cuatadapt: + - cutadapt: description: | - Cutadapt finds and removes adapter sequences, primers, poly-A tails and other types of unwanted sequence from your high-throughput sequencing reads. - documentation: https://cutadapt.readthedocs.io/en/stable/index.html + Cutadapt finds and removes adapter sequences, primers, poly-A tails + and other types of unwanted sequence from your high-throughput sequencing reads. + homepage: https://cutadapt.readthedocs.io/en/stable/index.html + documentation: https://github.com/marcelm/cutadapt doi: 10.14806/ej.17.1.200 licence: ["MIT"] identifier: biotools:cutadapt + input: - - meta: type: map @@ -24,7 +28,9 @@ input: description: | List of input FastQ files of size 1 and 2 for single-end and paired-end data, respectively. - ontologies: [] + pattern: "*.{fq,fastq,fq.gz,fastq.gz}" + ontologies: + - edam: "http://edamontology.org/format_1930" # FASTQ output: reads: - - meta: @@ -37,6 +43,7 @@ output: description: The trimmed/modified fastq reads pattern: "*fastq.gz" ontologies: + - edam: "http://edamontology.org/format_1930" # FASTQ - edam: http://edamontology.org/format_3989 # GZIP format log: - - meta: @@ -46,19 +53,37 @@ output: e.g. [ id:'test', single_end:false ] - "*.log": type: file - description: cuatadapt log file + description: cutadapt log file pattern: "*cutadapt.log" - ontologies: [] + ontologies: + - edam: "http://edamontology.org/format_2330" # Textual format + versions_cutadapt: + - - ${task.process}: + type: string + description: The name of the process + - cutadapt: + type: string + description: The name of the tool + - cutadapt --version: + type: eval + description: The expression to obtain the version of the tool + +topics: versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" - ontologies: - - edam: http://edamontology.org/format_3750 # YAML + - - ${task.process}: + type: string + description: The name of the process + - cutadapt: + type: string + description: The name of the tool + - cutadapt --version: + type: eval + description: The expression to obtain the version of the tool + authors: - "@drpatelh" - "@kevinmenden" maintainers: - "@drpatelh" - "@kevinmenden" + - "@vagkaratzas" diff --git a/modules/nf-core/cutadapt/tests/main.nf.test b/modules/nf-core/cutadapt/tests/main.nf.test index 36927bd7fbec..0e3f7fefc88d 100644 --- a/modules/nf-core/cutadapt/tests/main.nf.test +++ b/modules/nf-core/cutadapt/tests/main.nf.test @@ -3,16 +3,14 @@ nextflow_process { name "Test Process CUTADAPT" script "../main.nf" process "CUTADAPT" + tag "modules" tag "modules_nfcore" tag "cutadapt" - test("sarscov2 Illumina single end [fastq]") { + test("sarscov2 - fastq - single-end") { when { - params { - outdir = "$outputDir" - } process { """ input[0] = [ @@ -28,20 +26,18 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert process.out.reads != null }, - { assert process.out.reads.get(0).get(1) ==~ ".*.trim.fastq.gz" }, - { assert snapshot(process.out.versions).match("versions_single_end") }, - { assert snapshot(path(process.out.reads.get(0).get(1)).linesGzip[0]).match() } + { assert snapshot( + process.out.reads, + file(process.out.log[0][1]).readLines()[1..10], // python versions differ in the default conda env and container + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } ) } } - test("sarscov2 Illumina paired-end [fastq]") { + test("sarscov2 - fastq - paired-end") { when { - params { - outdir = "$outputDir" - } process { """ input[0] = [ @@ -58,11 +54,39 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert process.out.reads != null }, - { assert process.out.reads.get(0).get(1).get(0) ==~ ".*.1.trim.fastq.gz" }, - { assert process.out.reads.get(0).get(1).get(1) ==~ ".*.2.trim.fastq.gz" }, - { assert snapshot(path(process.out.reads.get(0).get(1).get(1)).linesGzip[0]).match() }, - { assert snapshot(process.out.versions).match("versions_paired_end") } + { assert snapshot( + process.out.reads, + file(process.out.log[0][1]).readLines()[1..14], // python versions differ in the default conda env and container + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } + ) + } + } + + test("sarscov2 - fastq - single-end - stub") { + + options "-stub" + + 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) + ] + ] + """ + } + } + + then { + assertAll ( + { assert snapshot( + process.out.reads, + process.out.log, + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } ) } } diff --git a/modules/nf-core/cutadapt/tests/main.nf.test.snap b/modules/nf-core/cutadapt/tests/main.nf.test.snap index 6817ac229ba2..baf5c4a2ab12 100644 --- a/modules/nf-core/cutadapt/tests/main.nf.test.snap +++ b/modules/nf-core/cutadapt/tests/main.nf.test.snap @@ -1,46 +1,123 @@ { - "sarscov2 Illumina single end [fastq]": { + "sarscov2 - fastq - single-end - stub": { "content": [ - "@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/1" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-06T10:27:15.235936866" - }, - "sarscov2 Illumina paired-end [fastq]": { - "content": [ - "@ERR5069949.2151832 NS500628:121:HK3MMAFX2:2:21208:10793:15304/2" + [ + [ + { + "id": "test", + "single_end": true + }, + "test.trim.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.cutadapt.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + { + "versions_cutadapt": [ + [ + "CUTADAPT", + "cutadapt", + "5.2" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2024-03-06T10:27:24.38468252" + "timestamp": "2025-12-11T12:48:07.964157954" }, - "versions_paired_end": { + "sarscov2 - fastq - paired-end": { "content": [ [ - "versions.yml:md5,8428231c6f665759beec10b0aba11075" - ] + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.trim.fastq.gz:md5,4161df271f9bfcd25d5845a1e220dbec", + "test_2.trim.fastq.gz:md5,2ebae722295ea66d84075a3b042e2b42" + ] + ] + ], + [ + "Command line parameters: --cores 2 -o test_1.trim.fastq.gz -p test_2.trim.fastq.gz test_1.fastq.gz test_2.fastq.gz", + "Processing paired-end reads on 2 cores ...", + "", + "=== Summary ===", + "", + "Total read pairs processed: 100", + "Pairs written (passing filters): 100 (100.0%)", + "", + "Total basepairs processed: 27,645 bp", + " Read 1: 13,897 bp", + " Read 2: 13,748 bp", + "Total written (filtered): 27,645 bp (100.0%)", + " Read 1: 13,897 bp", + " Read 2: 13,748 bp" + ], + { + "versions_cutadapt": [ + [ + "CUTADAPT", + "cutadapt", + "5.2" + ] + ] + } ], "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.5" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2025-04-01T10:51:18.715277676" + "timestamp": "2025-12-11T14:12:08.287985982" }, - "versions_single_end": { + "sarscov2 - fastq - single-end": { "content": [ [ - "versions.yml:md5,8428231c6f665759beec10b0aba11075" - ] + [ + { + "id": "test", + "single_end": true + }, + "test.trim.fastq.gz:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + [ + "Command line parameters: --cores 2 -o test.trim.fastq.gz test_1.fastq.gz", + "Processing single-end reads on 2 cores ...", + "", + "=== Summary ===", + "", + "Total reads processed: 100", + "Reads written (passing filters): 100 (100.0%)", + "", + "Total basepairs processed: 13,897 bp", + "Total written (filtered): 13,897 bp (100.0%)" + ], + { + "versions_cutadapt": [ + [ + "CUTADAPT", + "cutadapt", + "5.2" + ] + ] + } ], "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.5" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2025-04-01T10:51:14.492236529" + "timestamp": "2025-12-11T14:06:44.706447277" } } \ No newline at end of file