philres / ngmlr

NGMLR is a long-read mapper designed to align PacBio or Oxford Nanopore (standard and ultra-long) to a reference genome with a focus on reads that span structural variations
MIT License
293 stars 40 forks source link

mapping quality #79

Open Wuxy96 opened 4 years ago

Wuxy96 commented 4 years ago

Hi, May I know the formula of mapping quality in sam. I wonder how to calculate this value, and the threshold of high mapping quality. Thanks.

fritzsedlazeck commented 4 years ago

Every mapper does it slightly differently. It is basically representing the edit distance between the first and 2nd best alignment of a read. There is greater detail in the SAM documentation I think.

https://genome.sph.umich.edu/wiki/Mapping_Quality_Scores

Typical thresholds are either 10+ or 20+ depending on how much you want to filter. For NGM MQ=0 is saying that its not a unique mapping read. MQ1-5 says its unique mapping but there might be a 2nd alignment that is just different by 1-2 bp.

Hope that helps Fritz