-
-
Save fwip/5cb28c350e8f3d9e2e2a1f7fc5762eda to your computer and use it in GitHub Desktop.
Optional process practices?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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