brentp / hts-python Goto Github PK
View Code? Open in Web Editor NEWpythonic wrapper for libhts (moved to: https://github.com/quinlan-lab/hts-python)
Home Page: https://github.com/quinlan-lab/hts-python
License: MIT License
pythonic wrapper for libhts (moved to: https://github.com/quinlan-lab/hts-python)
Home Page: https://github.com/quinlan-lab/hts-python
License: MIT License
Hello,
I am inspired by your code and currently developing a cffi-based pysam alternative which works with Pypy. While testing your code I found that
ffi.new('kstring_t *', {'m': 0, 'l': 0, 's': ffi.NULL})
causes memory leak, so I replaced it with Pythonic way. You can find the change here:
Maybe there would be better way to do this? Thank you so much for your contribution!
Best regards,
Jeongbin Park
CFFI 1.0 introduced a new out-of-line mode to reduce the overhead when running on CPython.
See:
(Wishlist item rather than bug.)
Hey Brent :)
hts-python is having some difficulty parsing some tags in a specific BAM file:
>>>> import hts
>>>> in_file = hts.Bam('./actual.bam')
>>>> for read in in_file: print read.tags
[('MC', 'Z', '101M'), ('MD', 'Z', '16T2C80'), ('PG', 'Z', 'bwa-meth'), ('RG', 'Z', '44_Mm08_WEAd_Db2_WGBS_E_1_L001__trimmed'), ('NM', 'C', 28), ('MQ', 'C', 60), ('UQ', 'S', 40), ('\x04A', 'S', 67), ('WX', 'S', 67)]
[('MC', 'Z', '7M1D94M'), ('MD', 'Z', '9T2C87'), ('PG', 'Z', 'bwa-meth'), ('RG', 'Z', '44_Mm08_WEAd_Db2_WGBS_E_1_L001__trimmed'), ('NM', 'C', 27), ('MQ', 'C', 25), ('UQ', 'S', 213), ('\x03A', 'S', 67), ('WX', 'S', 67)]
...
Note the '\x03A' and '\x04a'. A 10-read sample of the full bam can be found here: http://ac.gt/actual.bam
Parsing these tags works in samtools and pysam, so it's a real/reproducible issue. If its any consolation, both pysam and samtools fail to parse another BAM file i have which only contains unmapped reads (no chromosome data, which causes the error), so perhaps i'm just having a bad day ;)
If you need more data, or anything else on my end, not a problem! โ๏ธ
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.