wdecoster / chopper

MIT License
135 stars 11 forks source link

Q score interpretation same or slightly different compared to guppy #3

Closed gwl2 closed 1 year ago

gwl2 commented 1 year ago

I remember quite a while ago there was a discussion that there were discrepancies in q score interpretation/filtering by albacore and nanofilt depending whether the reads or the sequencing summary was used. Discussed here: https://gigabaseorgigabyte.wordpress.com/2017/07/15/nanofilt-using-albacore-sequencing_summary-for-quality-filtering/

Is that still the case? If I use chopper to filter the fastqs based on a certain q score, will I obtain the same reads like using guppy_basecaller with the same q score filter?

Thanks!

wdecoster commented 1 year ago

Let me unpack a few things here. Since a fastq record has a quality score per base, tools like NanoFilt and chopper can calculate the mean q score. There are two ways to calculate that score: with (correct) or without (wrong) first change the phred scores to probabilities. See also https://gigabaseorgigabyte.wordpress.com/2017/06/26/averaging-basecall-quality-scores-the-right-way/ NanoFilt and chopper do those things in exactly the same way.

There could be changes to guppy that I am unaware of, but to my knowledge, or at least how it used to be: the difference between the wrong way to calculate and the sequencing_summary is rather big. The difference between the correct calculation and the summary is much smaller, yet it is not identical. This means that there is some aspect of the quality of a read that guppy is aware of and outputs in the sequencing summary file that is not correctly represented in the FASTQ record. So chopper too will not give the same result in that case, but close enough.