4 ms·
Fascinating, but there exist already htslib [0] bindings for Python (and many other languages). htslib truly is the standard library with respect to high-throug
by chromatin 7y ago
Fascinating, but there exist already htslib [0] bindings for Python (and many other languages). htslib truly is the standard library with respect to high-throughput sequencing data file access, and with high level bindings, we can already write something like:
```
for seq in bamfile:
print(seq.pos)
```
or whatever.
[0] https://github.com/samtools/htslib https://github.com/samtools/htslib
- snackematician 7y agoTo expand on this -- I believe pysam [0] is the official htslib interface for Python. It's quite good. In addition to providing Python bindings, it also provides extra functionality from within Cython, if you need additional features/speed but don't want to drop all the way down to C. [0] https://pysam.readthedocs.io/en/latest/ https://pysam.readthedocs.io/en/latest/
- mbreese 7y agoIs the pysam API more stable now? Years ago, I had to stop using it because the API has changed between versions too much.