wc -l or wc -c which linux command is best to find total read count in fastq file?
1
0
Entering edit mode
2.5 years ago
Fizzah ▴ 30

Hello there,

I am working on RNA seq data and while counting read counts I came across two type of commands using either wc -l and wc -c command. The out put of both commands turns out different when run for read count numbers. If both commands use for total read count then why different output?

I am confused which command is best to use for counting total read count in fastq file. Please guide about it

linux • 1.6k views
ADD COMMENT
3
Entering edit mode
2.5 years ago
Michael 54k

None is totally reliable. If you are absolutely sure that there are no empty lines and no multi-line sequences you can use wc -l and divide by 4, it's good enough for a quick check if nothing else is installed on a node. -l counts the lines, while -c counts bytes or -m for characters (not useful for getting read counts).

I would rather use a sequence toolkit, e.g. seqkit, with its stats command I found it to be very useful and fast to get some basic statistics. If you do QC of sequencing data as one should, fastQC will also tell you the number of reads anyway. I haven't checked how this works out with multi-line fastq but it should be fine and they are not common at all.

ADD COMMENT
0
Entering edit mode

OP has asked variations of this question in multiple threads. They got a good answer here: Difference between total number of reads in fastq file and no of bases/nt sequences in fastq file?

ADD REPLY
0
Entering edit mode

yes I am using fastqc can you please explain how can I found no of reads via fastqc..Thanks

ADD REPLY
1
Entering edit mode

In very first section of fastqc report
In Basic statistics section

ADD REPLY
0
Entering edit mode

oh yes here it was.. Thank you so much for clearing my confusion

ADD REPLY
0
Entering edit mode

I wonder whether multi-line fastq files have ever been observed in the wild...

ADD REPLY
2
Entering edit mode

I am sure they have, the same way Sasquatch, Bigfoot and Yeti have been observed.

ADD REPLY

Login before adding your answer.

Traffic: 1532 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