mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-10 20:23:10 +00:00
70daf8be30
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
41 lines
1.1 KiB
Text
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
|
|
}
|