-
Notifications
You must be signed in to change notification settings - Fork 273
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
iterating on unnamed streams #1297
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello pysam devs
I would like to know whether pysam is the right tool for what I'd like to do:
tl;dr: I'd like to get an iterator of
AlignmedSegment
s over an in-memory binary stream (no file, not stdio).I'm streaming CRAM/BCF from an htsget server and wrote a client to lazily consume the binary stream. The client exposes it as a buffered read-only file object (io.RawIOBase) so that we can do:
Now I wanted to make this stream easy to work with from python and thought I could just do
pysam.AlignmentFile(stream)
, but it doesn't work because pysam requires that the input file is on disk, or has a file descriptor.I found that this line in libcalignmentfile.pyx which indeed states this is not possible.
Is this a missing feature, or just out of scope for pysam (e.g. is there a fundamental reason why it is not possible), or maybe I'm just taking the wrong approach?
Any feedback or suggestions welcome :)
The text was updated successfully, but these errors were encountered: