Sort Fastq Files...
2
1
Entering edit mode
9.3 years ago
znra1 ▴ 10

Does anyone have a utility or pointers to sort fastq files based on the quality value?

TiA, Nash

fastq sort quality • 3.2k views
ADD COMMENT
2
Entering edit mode

Just to be sure, by sorting you mean, reads with best average quality should be on the top of the list? Rather, what is your criteria for sorting? And by sorting, do you mean no filtering?

ADD REPLY
5
Entering edit mode
9.3 years ago

I assume that you wish to sort the reads by average quality. This could be done easily with Heng Li's bioawk like so:

cat test.fq | awk -c fastx ' { print meanqual($seq),$name,$seq,$qual} ' | sort -k 1 -rn | awk ' { printf("@%s\n%s\n+\n%s\n",$2,$3,$4) } ' > sorted.fq
ADD COMMENT
0
Entering edit mode

(+1) got to read bioawk! :)

ADD REPLY
1
Entering edit mode

bioawk the awesomest tool that rocks the hardest

ADD REPLY
0
Entering edit mode

bioawk looks really good. Is there any manual for this? I found some description here

ADD REPLY
1
Entering edit mode
ADD REPLY
0
Entering edit mode

Thanks a lot. Good to know.

ADD REPLY
0
Entering edit mode
9.3 years ago
znra1 ▴ 10

Thanks Istvan...but it looks like there might be a typo somewhere? awk on my Ubuntu 12.04 LST doesn't seem to recognize the -c option??

Nash

ADD COMMENT
0
Entering edit mode

you should post this as a comment and you will need to install bioawk and run that!

ADD REPLY
0
Entering edit mode

Ok....thanks. I just tried make from your tar file, but it looks like this Ubuntu non-developer distribution really needs a lot of basic unix libs and tools (I had to get lex and yacc first!). Any idea where I can get zlib.h to compile addon.c please? Sorry for the inconvenience...

ADD REPLY

Login before adding your answer.

Traffic: 1844 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6