lixin6135 / pysam

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

truncate option in Samfile.pileup doesn't work #107

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. try calling pileup() with specified region and truncate=True

What is the expected output? What do you see instead?
Expect only columns for positions within specified region; instead see only 
columns for positions *before* the specified region

What version of the product are you using? On what operating system?
pysam 0.7; ubuntu 12.04

Original issue reported on code.google.com by alimanfoo@googlemail.com on 3 Dec 2012 at 11:26

GoogleCodeExporter commented 8 years ago
Hi,

could you provide a short example with data and code?

I can't seem to reproduce this.

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 14 Jan 2013 at 10:31

GoogleCodeExporter commented 8 years ago
Hello Andreas,

I have the same problem with Samfile.pileup and the truncate option.

For testing I created a .bam and .bai file for the ex1.sam.gz file in "tests" 
available from the current module-download.

My script looks like this:
 -------------------------
#!/usr/bin/env python
import pysam

samfile = pysam.Samfile( "pysam/tests/ex1.bam", "rb" )

for pileupcolumn in samfile.pileup(region='chr1:170:172', truncate=True):
        print "coverage at base %s is %s" % (pileupcolumn.pos, pileupcolumn.n)

samfile.close()
 ------------------

I would expect the following output: 

coverage at base 170 is 12
coverage at base 171 is 12

But what I get is the coverage information for positions 173 - 203, like 
without the "truncate" option.

Best regards,
Christine

Original comment by christin...@gmail.com on 20 Mar 2013 at 4:53

GoogleCodeExporter commented 8 years ago
Hi Christine  and Andreas,

I am facing same problem I am wondering this problem fixed?

Thanks,
Srikar.

Original comment by srikarch...@gmail.com on 17 Apr 2013 at 7:53

GoogleCodeExporter commented 8 years ago
Fixed, big bug - many thanks!

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 26 Jun 2013 at 8:28