pysam-developers/pysam
FreePysam is a Python module for reading and manipulating SAM/BAM/VCF/BCF files. It's a lightweight wrapper of the htslib C-API, the same one that powers samtools, bcftools, and tabix.
About pysam-developers/pysam
Pysam is a Python package for reading, manipulating, and writing genomics data in SAM/BAM/CRAM and VCF/BCF formats. It is a lightweight wrapper of the HTSlib C-API, the same library that powers samtools, bcftools, and tabix. Designed for next-generation sequencing data, pysam enables efficient handling of large alignment files and variant calls. Installation is recommended via the bioconda channel for automatic dependency resolution, but it is also available on PyPI. The package is open source under the MIT license and includes a tabix interface for indexed file access. Documentation and community support are available via ReadTheDocs and the pysam user group.
Key Features
Pros & Cons
- Leverages the robust, widely-used HTSlib C-API (also used by samtools, bcftools)
- Supports multiple genomic file formats (SAM, BAM, CRAM, VCF, BCF)
- Easy installation via bioconda (resolves non-Python dependencies)
- Comprehensive documentation and active user group
- Free and open source with a permissive MIT license
- Python-only; not available for other programming languages
- Requires understanding of genomic data formats (SAM/BAM/VCF)
- Compilation from source can be complex without conda