Question: Is there is Python module / library deals with the flag field in SAM files?
0
gravatar for Medhat
6.0 years ago by
Medhat8.8k
Texas
Medhat8.8k wrote:

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 

bam sam sequence python • 1.7k views
ADD COMMENTlink modified 6.0 years ago • written 6.0 years ago by Medhat8.8k
1

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

ADD REPLYlink written 6.0 years ago by geek_y11k

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

ADD REPLYlink written 6.0 years ago by Devon Ryan97k
2

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

ADD REPLYlink modified 6.0 years ago • written 6.0 years ago by Medhat8.8k
1

You just need more coffee :)

ADD REPLYlink written 6.0 years ago by Devon Ryan97k

:D  I agree

ADD REPLYlink written 6.0 years ago by Medhat8.8k

is there any badge for it ? :-P 

ADD REPLYlink written 6.0 years ago by geek_y11k

We should request one :)

ADD REPLYlink written 6.0 years ago by Devon Ryan97k
1
gravatar for dariober
6.0 years ago by
dariober11k
WCIP | Glasgow | UK
dariober11k wrote:

pysam?

ADD COMMENTlink written 6.0 years ago by dariober11k
1
gravatar for Devon Ryan
6.0 years ago by
Devon Ryan97k
Freiburg, Germany
Devon Ryan97k wrote:

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 COMMENTlink written 6.0 years ago by Devon Ryan97k
Please log in to add an answer.

Help
Access

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