Last active
August 29, 2015 13:56
-
-
Save l-modolo/8860090 to your computer and use it in GitHub Desktop.
split paired-end fastq file in the case where reads from the two ends are concatened (not interlaced)
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
#!/bin/sh | |
# split fastq file in two file for cases where paired-end are concatened (not interlaced) | |
(gzip -dc intput.fastq.gz) | awk -F"=" 'BEGIN {OFS = "\n"} {name = $0; getline seq; getline name2; getline phred; print name, substr(seq,0,int(length(seq)/2)), name2, substr(phred,0,int(length(seq)/2)) >> "intput-1.fastq"; print name, substr(seq,int(length(seq)/2)+1,length(seq)), name2, substr(phred,int(length(seq)/2)+1,length(seq)) >> "intput-2.fastq"}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment