quachtina96 / pysam

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

Doesn't find index files that end only in .bai #134

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. opening a bam file
2. attempting to use a IteratorRowAll object

What is the expected output? What do you see instead?
I don't know what the expected output is but I would assume the example code 
wouldn't produce an error:
>>> samfile = pysam.Samfile('../bams/sample009.brfs.bam', 'rb')
>>> print(len(list(samfile.fetch())))
30393
>>> iter=pysam.IteratorRowAll(samfile)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'IteratorRowAll'

What version of the product are you using? On what operating system?
Using pysam-0.7.5 with python 2.7.5 on ubuntu 13.04 (raring)

Please provide any additional information below.
Additionally the following also produces an error:
>>> iter=pysam.IteratorRow(samfile)
>>> for r in iter:
...    print r
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'pysam.csamtools.IteratorRow' object is not iterable

Can anyone tell me why when I count the reads as above, it gives me a different 
number of reads to Samtools flagstat. Is it not counting unmapped reads? How 
can iterate over ALL reads in a file, mapped or unmapped, qc passed or failed???

Original issue reported on code.google.com by davykava...@gmail.com on 5 Sep 2013 at 10:50

GoogleCodeExporter commented 9 years ago
Incorrect title. Apologies (though that is also an issue I have, but I would 
prefer the above be solved first)

Original comment by davykava...@gmail.com on 5 Sep 2013 at 10:51

GoogleCodeExporter commented 9 years ago
While the above still does not work for me, I have found that using 
fetch(until_eof=True) will do what I want. I think this needs to be made a 
little clearer in the documentation.

Sorry for the awful disregard of posting rules. My bad.

Original comment by davykava...@gmail.com on 5 Sep 2013 at 10:59

GoogleCodeExporter commented 9 years ago
Thanks, I have updated the documentation.

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 17 Sep 2013 at 6:53