Skip to content

Instantly share code, notes, and snippets.

@fwip fwip/1.nf Secret
Created Jun 18, 2018

Embed
What would you like to do?
Optional process practices?
process trim_to_length {
input:
file(r1) from fastq
output:
file('r1.trim.fastq.gz') into trimmed_fastq
when:
params.trim_to != 0
script:
"""
zcat $r1 | awk 'NR%2==0 {print substr(\$0, 1, $params.trim_to)} NR%2!=0' | gzip -c -1 > r1.trim.fastq.gz
"""
}
if params.trim_to == 0
fastq.into(trimmed_fastq)
process trim_to_length {
input:
file(r1) from fastq
output:
file('r1.trim.fastq.gz') into trimmed_fastq
script:
if (params.trim_to != 0)
"""
zcat $r1 | awk 'NR%2==0 {print substr(\$0, 1, $params.trim_to)} NR%2!=0' | gzip -c -1 > r1.trim.fastq.gz
"""
else
"""
ln -s $r1 r1.trim.fastq.gz
"""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.