Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
30 changes: 13 additions & 17 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 @@ -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
"""
}
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,
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] = [
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,
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() }
)
}
}
Expand Down
Loading
Loading