nf-core_modules/software/cutadapt/main.nf

42 lines
1.1 KiB
Text
Raw Normal View History

2020-03-05 15:56:11 +00:00
process cutadapt {
tag "${sample_id}"
container 'quay.io/biocontainers/cutadapt:1.16--py27_1'
input:
2020-03-06 13:23:12 +00:00
tuple val(sample_id), file(reads)
2020-03-05 15:56:11 +00:00
output:
2020-03-06 13:23:12 +00:00
tuple sample_id, file("trimmed_*.fastq")
2020-03-05 15:56:11 +00:00
script:
2020-03-06 13:23:12 +00:00
forward_fq = "trimmed_1.fastq"
reverse_fq = "trimmed_2.fastq"
2020-03-06 10:51:46 +00:00
2020-07-11 11:42:13 +00:00
2020-07-11 15:09:06 +00:00
if (params.single_end) {
2020-03-06 13:23:12 +00:00
processing = """
cutadapt \
2020-07-11 11:42:13 +00:00
-j ${task.cpus} \
-q $params.cutadapt_min_quality \
--minimum-length $params.cutadapt_min_length \
--output ${forward_fq} \
${reads}
2020-03-06 13:23:12 +00:00
"""
} else {
processing = """
cutadapt \
2020-07-11 11:42:13 +00:00
-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}
2020-03-06 13:23:12 +00:00
"""
}
2020-07-11 15:09:06 +00:00
version = "cutadapt --version &> v_cutadapt.txt"
2020-03-06 13:23:12 +00:00
return processing + version
2020-03-05 15:56:11 +00:00
}