Question: Re-evaluating SAM/BAM bitflags after modifying the file
gravatar for elsoja
6 weeks ago by
elsoja120 wrote:

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 • 96 views
ADD COMMENTlink written 6 weeks ago by elsoja120
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1540 users visited in the last hour