Question: Splitting Odd and Even Reads from FastQ to Seperate Output Files
0
gravatar for landrjos
7 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 • 282 views
ADD COMMENTlink modified 7 months ago by 5heikki8.2k • written 7 months ago by landrjos10
0
gravatar for 5heikki
7 months ago by
5heikki8.2k
Finland
5heikki8.2k 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 months ago by 5heikki8.2k
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: 2499 users visited in the last hour