Question: Splitting Odd and Even Reads from FastQ to Seperate Output Files
0
gravatar for landrjos
4 months ago by
landrjos10
landrjos10 wrote:

Hi All,

I have a bioinformatics question. I would like to partition a fastq file into 2 separate output files with odd reads (lines 1-4, 9-12, etc....) into a odd output file (file1) and even reads (lines 5-8, 13-16) into a even output file (file2). Does anyone know a Split command which would do this? I am a newbie to terminal commands this complex.

Best,

Jos

sequence • 202 views
ADD COMMENTlink modified 4 months ago by 5heikki7.9k • written 4 months ago by landrjos10
0
gravatar for 5heikki
4 months ago by
5heikki7.9k
Finland
5heikki7.9k wrote:
awk '{if(NR<5){print $0 > "file1.fq"}else{print $0 > "file2.fq";if(NR>7){NR=0}}}' input.fq
ADD COMMENTlink written 4 months ago by 5heikki7.9k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1163 users visited in the last hour