nf-core_modules/software/cutadapt/main.nf
Paolo Di Tommaso 70daf8be30
Minor style improvents
This commit provides a minor refactoring with som
Nextflow code style improvments:
- Replaces `.toGiga()` with `.giga`
- Replaces `tag { foo }` with `tag "$foo"`
- Move publishDir before input declarations. Directives should be
  before the first input. Tho this is not enforced, it may be in
  future versions.
- Replaces input `file` with `path`
- Remove unnecessary parentheses
2020-07-27 12:11:42 +02:00

41 lines
1.1 KiB
Text

process cutadapt {
tag "${sample_id}"
container 'quay.io/biocontainers/cutadapt:1.16--py27_1'
input:
tuple val(sample_id), path(reads)
output:
tuple sample_id, path("trimmed_*.fastq")
script:
forward_fq = "trimmed_1.fastq"
reverse_fq = "trimmed_2.fastq"
if (params.single_end) {
processing = """
cutadapt \
-j ${task.cpus} \
-q $params.cutadapt_min_quality \
--minimum-length $params.cutadapt_min_length \
--output ${forward_fq} \
${reads}
"""
} else {
processing = """
cutadapt \
-j ${task.cpus} \
-q $params.cutadapt_min_quality \
--minimum-length $params.cutadapt_min_length \
--pair-filter=any \
--output ${forward_fq} \
--paired-output ${reverse_fq} ${reads}
"""
}
version = "cutadapt --version &> v_cutadapt.txt"
return processing + version
}