Skip to content

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.

License

Notifications You must be signed in to change notification settings

pysam-developers/pysam

Folders and files

NameName
Last commit message
Last commit date
Feb 3, 2025
Mar 25, 2025
Feb 5, 2025
Feb 5, 2025
Feb 10, 2025
Mar 25, 2025
Nov 16, 2023
Mar 25, 2025
Mar 25, 2025
Mar 26, 2025
Feb 28, 2011
Feb 3, 2025
Feb 5, 2025
Sep 10, 2023
Aug 15, 2023
May 16, 2024
Oct 16, 2009
Feb 5, 2025
Oct 30, 2024
Feb 5, 2025
Feb 5, 2025
Oct 4, 2023
Sep 10, 2023
Mar 4, 2022
Feb 4, 2025

Repository files navigation

Pysam

build status Documentation Status

Pysam is a python module for reading and manipulating files in the SAM/BAM format. The SAM/BAM format is a way to store efficiently large numbers of alignments (Li 2009), such as those routinely created by next-generation sequencing methods.

Pysam is a lightweight wrapper of the samtools C-API. Pysam also includes an interface for tabix.

If you are using the conda packaging manager (e.g. miniconda or anaconda), you can install pysam from the bioconda channel:

conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install pysam

Installation through bioconda is the recommended way to install pysam as it resolves non-python dependencies and uses pre-configured compilation options. Especially for OS X this will potentially save a lot of trouble.

The current version of pysam wraps 3rd-party code from htslib-1.21, samtools-1.21, and bcftools-1.21.

Pysam is available through PyPI. To install, type:

pip install pysam

Pysam documentation is available here

Questions and comments are very welcome and should be sent to the pysam user group

About

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.

Topics

Resources

License

Stars

Watchers

Forks