Re-evaluating SAM/BAM bitflags after modifying the file
Entering edit mode
3.6 years ago

Hey all,

I'm using pysam to filter a BAM file based on alignment identity (which I'm calculating from the NM tag). Because the filtering is performed on individual reads, and not reads pairs, this can lead to misleading flags in the resulting BAM file.

For example, lets suppose that both reads from a pair were mapped before filtering, but one of them was removed due to low identity to the reference. Ideally, the read that was kept should have the "mate unmapped" (0x8) bitflag, but because the filtering of paired reads is performed independently, there's no way of knowing beforehand that this flag should be kept.

Is there a way to re-evaluate the SAM/BAM file after it was modified to update the bitflags?

alignment • 586 views

Login before adding your answer.

Traffic: 1980 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6