brittneybrinsfield / pysam

Automatically exported from code.google.com/p/pysam
0 stars 0 forks source link

Expose pilup max depth setter #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
#63 is closed as wontfix, but it seems you can set the max depth allowed in an 
alignment: 

void bam_plp_set_maxcnt(bam_plp_t iter, int maxcnt)

If you expose this functionality, we can get the depths we want.

Perhaps add a max_depth to the pileup call, and then use it in setting up the 
iterator:
http://code.google.com/p/pysam/source/browse/pysam/csamtools.pyx#1675

Original issue reported on code.google.com by cas...@gmail.com on 19 Sep 2011 at 9:02

GoogleCodeExporter commented 9 years ago
Attached patch, not much of a mercurial user so let me know if I'm not doing it 
right.

Adds a max_depth option to pileup: 

for pu_column in samfile.pileup('chr11', position, position+1, 
max_depth=200000):
    if pu_column.pos == position: 
        print pu_column.pos, pu_column.n

which outputs: 

pos: 59855948 depth: 54981

showing > 8000 reads at this position.

Original comment by cas...@gmail.com on 19 Sep 2011 at 9:43

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for submitting this patch.

I will incorporate it at the next release - due within this month.

Bw,
Andreas

Original comment by andreas....@gmail.com on 7 Oct 2011 at 7:00

GoogleCodeExporter commented 9 years ago
Added patch.

Original comment by andreas....@gmail.com on 19 Oct 2011 at 8:49