Understanding the SA tag, Samtools FLAG, and Chimeric Alignments
0
0
Entering edit mode
5.2 years ago
nzs208 • 0

Hi, I've been using Pysam to help me parse bam files. I noticed that in some cases, the Samtools Flag will be set to 0, and the SA tag will also be set. When I use the samtools read.is_supplemental, this will return False. I find this confusing because I would assume that if the SA tag is set, the segment would also be flagged as supplemental.

Under what circumstances will the SA tag be set but the FLAG tag indicating a supplemental alignment won't? Is this because according to the SAM file specifications, "it is required that one and only one line associated with the read satisfies ‘FLAG & 0x900 == 0’" so this flag is only set to 0 to meet those requirements even though it actually is a supplementary alignment?

What is the most reliable way to check for a supplemental alignment? Should I be using the Sam file FLAG or the SA tag?

The other thing I'm confused about is that for one particular read there may be multiple entries in the BAM file that are both supplementary and primary. My understanding is that you can only have one primary alignment. Given that this is a read that doesn't map linearly, is there an entry in the bam file for each place the read maps that can be combined to create the primary alignment? But then, I'm confused about how to interpret the SA flag for each of these entries, which also suggests that each of those segments may also map to additional places.

Thanks.

alignment bam • 4.4k views
ADD COMMENT
0
Entering edit mode

What software is making your bams?

ADD REPLY
0
Entering edit mode

They were created with Minimap2. Is this a question that would be more appropriate to ask on the Minimap2 Github?

ADD REPLY
0
Entering edit mode

ases, the Samtools Flag will be set to 0,

the read is NOT paired (no mate) , mapped, on forward strand, it's a PRIMARY alignment

and the SA tag will also be set.

because this reads has also some supplementary alignemnts. Some parts of the read map elswhere, you should find some reads with the same read-name with the FLAG 2048 set.

ADD REPLY
0
Entering edit mode

Hi Pierre, Thanks for getting back to me. These supplemental alignments from the same read will not have the secondary flag set, so when I try to filter for primary alignments, I also capture these. But you are saying that there will always be one primary alignment that is not supplemental? How should I interpret a segment that is marked as both primary and supplemental?

-Natasha

ADD REPLY

Login before adding your answer.

Traffic: 2710 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6