Question: Splitting Odd and Even Reads from FastQ to Seperate Output Files
0
gravatar for landrjos
10 weeks 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 • 175 views
ADD COMMENTlink modified 10 weeks ago by 5heikki7.8k • written 10 weeks ago by landrjos10
0
gravatar for 5heikki
10 weeks ago by
5heikki7.8k
Finland
5heikki7.8k wrote:
awk '{if(NR<5){print $0 > "file1.fq"}else{print $0 > "file2.fq";if(NR>7){NR=0}}}' input.fq
ADD COMMENTlink written 10 weeks ago by 5heikki7.8k
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: 754 users visited in the last hour