Pysam is a Python package for reading, manipulating, and writing genomics data such as SAM/BAM/CRAM and VCF/BCF files. It's a lightweight wrapper of the HTSlib API, the same one that powers samtools, bcftools, and tabix.
Thanks. I was going to wait for this to come in with the next HTSlib import, but since samtools/htslib#1674 has already been merged and we use kseq within pysam, it's worth applying it now.
An original fix was submitted by @kloetz to seqtk repo. Improves FASTA parsing to 2GB/s .
See: