What problem does it solve?
Pysam provides a Pythonic interface to read, manipulate, and write genomic data formats (SAM/BAM/CRAM, VCF/BCF, FASTA/FASTQ) enabling researchers to build reproducible pipelines and perform variant, alignment, and sequence analyses without low-level HTS tooling.
Core Features & Use Cases
- Read and write alignment files (SAM/BAM/CRAM) and perform region-based queries for variant and read analysis.
- Work with variant data (VCF/BCF), query and filter variants, and annotate or aggregate across samples.
- Extract reference sequences from indexed FASTA files and process raw reads from FASTQ files for QC and downstream analyses.
- Use cases include quality control (BAM stats, depth calculation), variant annotation, and sequence extraction in genomics pipelines.
Quick Start
Install pysam and run basic read, write, and query operations on BAM/VCF data.