minimap2 icon indicating copy to clipboard operation
minimap2 copied to clipboard

selection of best mapping hit in SAM format

Open rderelle opened this issue 3 years ago • 0 comments

this isn't an issue, rather a strange observation.

I have mapped a set of genes on a genome assembly of the same species (but another lineage) using the option -ax asm5, and I'm now trying to select, for each gene, the best mapping hit.

But I'm not sure which field of the SAM output file I should base my selection on. I was thinking to consider as best mapping hits those with BIT flag equal to 0 or 16. However, I came across some examples in which the hit with BIT flag 0 or 16 has a lower mapping quality than secondary/alternative alignments

For instance, I obtained these following results: gene_123 16 NODE_372_length_61133_cov_16.245887 1 2 gene_123 256 NODE_798_length_4795_cov_17.329211 2335 0 gene_123 2064 NODE_7056_length_323_cov_33.206422 1 60 gene_123 2048 NODE_465_length_38408_cov_16.319792 1 60

If I'm not mistaken, the main alignment is the first one (flag '16'). However it has a mapping quality of only 2, below the mapping quality of some of the alternative alignments. Therefore, in order to select the best mapping hit, would you recommend me to base my selection on the BIT flag or the mapping quality ?

many thanks.

rderelle avatar Oct 21 '20 09:10 rderelle