[pysam] How to find both both primary and supplementary read?
1
0
Entering edit mode
2.7 years ago
octpus616 ▴ 100

Dear,

I am interesting in find split reads supporting structure variant, my bam file is alignment by bwa mem with default parmaters. As I know from Sequence Alignment/Map Format Specification, I try to use flag == 2048 to filter supplementary alignment:

  for bam_cat in bam.fetch(counting, int(start), int(end)): 
        #print(bam_cat.flag & 2048)
        if bam_cat.flag & 2048 == 2048: 
            print(str(bam_cat))

I think it work well to subset supplementary alignment, But as my understanding, a supplementary alignment often match a primary alignment (right?) , However, I dont know how to find its primary alignment without another iteration for all bam file (It algorithm complexity is too terrible).

NGS pysam bam python SAM • 1.7k views
ADD COMMENT
0
Entering edit mode
2.7 years ago

However, I dont know how to find its primary alignment without another iteration for all bam file

look at the 'SA' attribute.

ADD COMMENT
0
Entering edit mode

Oh, I got it, thank you, I missed someting.

ADD REPLY

Login before adding your answer.

Traffic: 2058 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