Skip to content

Pysam 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.

License

pysam-developers/pysam

master
Switch branches/tags
Code

Latest commit

The Makefile also builds ex2.bam from ex2.sam via `samtools view`.
Samtools as traditionally built using zlib typically generates a
124703-byte file, whereas when built using libdeflate it typically
generates a 122804-byte file -- but `head -c 124000` leaves that unchanged
and the test cases fail because ex2_truncated.bam is unexpectedly valid.

Rewrite the truncation rule to remove the final 512 bytes, irrespective
of ex2.bam's length. (No practical compression will reduce it to less
than 512 bytes in total, so this is safe.) Fixes #1128.
56b1624

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
doc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 defaults
conda config --add channels conda-forge
conda config --add channels bioconda
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.15.1, samtools-1.15.1, and bcftools-1.15.1.

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 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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published