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