Question: understanding pysam pileup()
0
gravatar for geek_y
5.1 years ago by
geek_y11k
Barcelona
geek_y11k wrote:

I am trying to understand how the pysam pileup() method works. Here is my example code:

for pileupcolumn in samfile.pileup("ConsensusB", 1, 2):
    for pileupread in pileupcolumn.pileups:
        if not pileupread.is_del and not pileupread.is_refskip:
            print pileupread.query_position,pileupread.alignment.query_name,pileupread.alignment.query_sequence[pileupread.query_position]

In the above example, I would expect it to give me only reads overlapping at base 1 of reference genome. But I see that it still iterates through each and every base of the reference sequence. How do I get all the bases overlapping a particular position ( lets say a SNP from VCF )

 

pileup pysam • 6.7k views
ADD COMMENTlink modified 5.1 years ago • written 5.1 years ago by geek_y11k
1
gravatar for geek_y
5.1 years ago by
geek_y11k
Barcelona
geek_y11k wrote:

Thanks. I could use https://github.com/alimanfoo/pysamstats for reference.

Great examples here

ADD COMMENTlink modified 13 months ago by _r_am32k • written 5.1 years ago by geek_y11k

Why delete the question?

ADD REPLYlink written 5.1 years ago by _r_am32k

Indeed, the right etiquette is to answer your own question, accept the answer.

ADD REPLYlink written 5.1 years ago by Istvan Albert ♦♦ 86k
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: 1794 users visited in the last hour
_