Re:Seq – A Language for Bioinformatics
by snackematician on Tuesday January 21, 2020 @01:27PM
(#22109815)
To 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.
``` for seq in bamfile: print(seq.pos) ``` or whatever.
[0] https://github.com/samtools/htslib