nf-core_modules/tools/trim_galore/main.nf

36 lines
1.1 KiB
Text
Raw Normal View History

2019-12-06 10:24:07 +00:00
process trim_galore {
2019-12-05 14:53:38 +00:00
tag "$sample_id"
publishDir "${params.outdir}/trim_galore", mode: 'copy',
saveAs: {filename ->
if (filename.indexOf("_fastqc") > 0) "FastQC/$filename"
else if (filename.indexOf("trimming_report.txt") > 0) "logs/$filename"
else filename
}
2019-12-05 21:11:12 +00:00
container 'quay.io/biocontainers/trim-galore:0.6.5--0'
2019-12-05 14:53:38 +00:00
input:
2019-12-05 21:11:12 +00:00
tuple sample_id, path(reads)
2019-12-05 14:53:38 +00:00
output:
2019-12-05 21:11:12 +00:00
tuple name, path("*fq.gz")
path "*trimming_report.txt"
path "*_fastqc.{zip,html}"
2019-12-05 14:53:38 +00:00
script:
c_r1 = clip_r1 > 0 ? "--clip_r1 ${clip_r1}" : ''
c_r2 = clip_r2 > 0 ? "--clip_r2 ${clip_r2}" : ''
tpc_r1 = three_prime_clip_r1 > 0 ? "--three_prime_clip_r1 ${three_prime_clip_r1}" : ''
tpc_r2 = three_prime_clip_r2 > 0 ? "--three_prime_clip_r2 ${three_prime_clip_r2}" : ''
nextseq = params.trim_nextseq > 0 ? "--nextseq ${params.trim_nextseq}" : ''
if (params.singleEnd) {
"""
trim_galore --fastqc --gzip $c_r1 $tpc_r1 $nextseq $reads
"""
} else {
"""
trim_galore --paired --fastqc --gzip $c_r1 $c_r2 $tpc_r1 $tpc_r2 $nextseq $reads
"""
}
}