-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read 10x bam file #15
Comments
Bamnostic was suggested (sourmash-bio/sourmash#539) as a replacement to pysam but I'm not able to use it for 10x-generated single cell bam files. |
I saw your issue. I thought by the tag, field part that it might have been an unpacking issue in the binary part of the data. The problem was actually with how it parses the SAM header. The fields of the SAM header aren't expected to be 3-field because the field type is only really necessary for the BAM format to figure out how to unpack the tag data. I fixed this to handle 3-field tags in SAM header though. Thank you for the heads-up. I made an update to PyPI and conda. Conda might take awhile until it is finalized. If you want the updates now, feel free to just github install it. |
Oops, forgot to quote something. Should be fixed with f7cfb0b Sorry. |
Wow, thank you for the quick fix!
---
Olga Botvinnik, PhD
olgabotvinnik.com <http://www.olgabotvinnik.com>
…On Thu, Sep 6, 2018 at 2:23 PM Marcus D Sherman ***@***.***> wrote:
Oops, forgot to quote something. Should be fixed with f7cfb0b
<f7cfb0b>
Sorry.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAxNcJcLuS97nkIkKLPj4lu3MjFMJqfmks5uYZJPgaJpZM4Wdrlq>
.
|
The program was originally looking for the EOF marker, but I forgot that when the EOF marker BGZF block is decompressed, it evaluates to an empty bytestring `b''`. I put in some extra checks so that if an empty block is found, it ensures it is at the file and is a legitimate end of file. If the file is truncated, it will `raise` a slightly different `StopIteration` error stating that the *potential* end of file is reached. I ran this on the file you mentioned in #15 (btw, awesome Issue suggestion. Thank you for following the template). My debugging is properly running through the file now.
Describe the bug
Cannot read 10x bam file
To Reproduce
Steps to reproduce the behavior:
Using the
possorted_genome_bam.bam
file from here, the following code fails:Expected behavior
Should be able to read the file and iterate through alignments
Screenshots
Desktop (please complete the following information):
Additional context
None
The text was updated successfully, but these errors were encountered: