Liftoff.bio illustration — cat libraries

pysam

Pythonic access to SAM/BAM/CRAM/VCF via HTSlib

pysam gives you programmatic, high-performance access to sequencing data formats from Python, wrapping the same HTSlib used by SAMtools and BCFtools.

Example

1import pysam
2with pysam.AlignmentFile("sorted.bam", "rb") as bam:
3 for read in bam.fetch("chr1", 0, 100000):
4 if not read.is_unmapped:
5 print(read.query_name, read.reference_start)

Related tools

Liftoff.bio illustration — cat genomics
Open source

Genomics & Sequencing

SAMtools

The standard toolkit for SAM/BAM/CRAM alignment files

Command line
Liftoff.bio illustration — cat genomics
Open source

Genomics & Sequencing

BCFtools

Call, filter and manipulate genomic variants (VCF/BCF)

Command line
Liftoff.bio illustration — cat libraries
Open source

Libraries & SDKs

Biopython

The foundational Python library for computational biology

Python library