This is a test version of Biostars. For the public version, visit https://www.biostars.org.
wc -l or wc -c which linux command is best to find total read count in fastq file?

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 answer

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.

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

In very first section of fastqc report
In Basic statistics section

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

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

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

Log in to answer this question.