Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/nf-core/cutadapt/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::cutadapt=5.0
- bioconda::cutadapt=5.2
29 changes: 13 additions & 16 deletions modules/nf-core/cutadapt/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ 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)

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
Expand All @@ -30,22 +30,19 @@ process CUTADAPT {
$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
"""
}
57 changes: 41 additions & 16 deletions modules/nf-core/cutadapt/meta.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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"
58 changes: 41 additions & 17 deletions modules/nf-core/cutadapt/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -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] = [
Expand All @@ -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,
process.out.log,
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] = [
Expand All @@ -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,
process.out.log,
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() }
)
}
}
Expand Down
121 changes: 94 additions & 27 deletions modules/nf-core/cutadapt/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,46 +1,113 @@
{
"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"
]
]
],
[
[
{
"id": "test",
"single_end": false
},
"test.cutadapt.log:md5,32c7e6e3b8a6741541519c71eb0aae48"
]
],
{
"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-11T12:49:21.554600817"
},
"versions_single_end": {
"sarscov2 - fastq - single-end": {
"content": [
[
"versions.yml:md5,8428231c6f665759beec10b0aba11075"
]
[
{
"id": "test",
"single_end": true
},
"test.trim.fastq.gz:md5,4161df271f9bfcd25d5845a1e220dbec"
]
],
[
[
{
"id": "test",
"single_end": true
},
"test.cutadapt.log:md5,97ee1da59d19d31679cc487b672ffc34"
]
],
{
"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-11T12:47:06.276800363"
}
}
Loading