Agent skill · research science · aiskillstore
pysam
Genomic file toolkit. Read/write SAM/BAM/CRAM alignments, VCF/BCF variants, FASTA/FASTQ sequences, extract regions, calculate coverage, for NGS data processing pipelines.
Why this skill is useful
Provides domain-specific commands for genomic data processing that the AI wouldn't reliably generate on its own.
What it needs
Requires pysam installed locally. About 5k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Pysam Overview Pysam is a Python module for reading, manipulating, and writing genomic datasets. Read/write SAM/BAM/CRAM alignment files, VCF/BCF variant files, and FASTA/FASTQ sequences with a Pythonic interface to htslib. Query tabix-indexed files, perform pileup analysis for coverage, and execute samtools/bcftools commands. When to Use This Skill This skill should be used when: Working with sequencing alignment files (BAM/CRAM) Analyzing genetic variants (VCF/BCF) Extracting reference sequences or gene regions Processing raw sequencing data (FASTQ) Calculating coverage or read depth Implementing bioinformatics analysis pipelines Quality control of sequencing data Variant calling and annotation workflows Quick Start Installation Basic Examples Read alignment file: Read variant file: Query reference sequence: Core Capabilities 1. Alignment File Operations (SAM/BAM/CRAM) Use the AlignmentFile class to work with aligned sequencing reads. This is appropriate for analyzing mapping results, calculating coverage, extracting reads, or quality control. Common operations: Open and read BAM/SAM/CRAM files Fetch reads from specific genomic regions Filter reads by mapping quality, flags, or other criteria Write filtered or modified alignments Calculate coverage statistics Perform pileup analysis (base-by-base coverage) Access read sequences, quality scores, and alignment information Reference: See references/alignmentfiles.md for detailed documentation on: Opening and reading alignment files AlignedSegment attributes and methods Region-based fetching with fetch() Pileup analysis for coverage Writing and creating BAM files Coordinate systems and indexing Performance optimization tips 2. Variant File Operations (VCF/BCF) Use the VariantFile class to work with genetic variants from variant calling pipelines. This is appropriate for variant analysis, filtering, annotation, or population genetics. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/pysam