Is there is Python module / library deals with the flag field in SAM files?
2
0
Entering edit mode
9.9 years ago
Medhat 9.8k

I am writing some python script for sam file , and I want to get the information from the flag file about the sequence, Is there any module or lib that can do it or I need to write mine?

if there is not previous code to do it what is the pseudo code that deals with it shall I convert from int to hex then bin and use some tabular to get the info or what?

Thanks

sequence SAM BAM python • 3.1k views
ADD COMMENT
1
Entering edit mode

Have you tried pysam library? I think the sam/bam object has an attribute called flag.

ADD REPLY
0
Entering edit mode

Three replies of "try pysam" at once must be a new record.

ADD REPLY
2
Entering edit mode

It means, I need to make my homework with more concentration before I post a question

ADD REPLY
1
Entering edit mode

You just need more coffee :)

ADD REPLY
0
Entering edit mode

:D I agree

ADD REPLY
0
Entering edit mode

is there any badge for it ? :-P

ADD REPLY
0
Entering edit mode

We should request one :)

ADD REPLY
1
Entering edit mode
9.9 years ago

pysam?

ADD COMMENT
1
Entering edit mode
9.9 years ago

pysam can do that for you. An AlignedSegment object has fields such as is_duplicate, is_proper_pair, is_read1, etc.. That makes things pretty convenient.

ADD COMMENT

Login before adding your answer.

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