Agent skill · research science · k-dense-ai

pysam

Python/HTSlib workflows for genomic files. Use when reading, querying, filtering, or writing SAM/BAM/CRAM, VCF/BCF, FASTA/FASTQ, or tabix data with pysam, including pileup, coverage, indexing, and CRAM references.

Why this skill is useful

Provides domain-specific workflows and bundled scripts for genomic data processing that the AI wouldn't reliably generate on its own.

What it needs

Requires python installed locally. About 6k tokens when loaded. Last updated 2026-08-03. 32,849 stars on the source repository.

What this skill does

pysam Overview Use pysam for low-level, streaming access to HTSlib-supported genomic formats: AlignmentFile and AlignedSegment for SAM/BAM/CRAM VariantFile, VariantHeader, and VariantRecord for VCF/BCF FastaFile for indexed FASTA and FastxFile for sequential FASTA/FASTQ TabixFile for BGZF-compressed, tabix-indexed BED/GFF/GTF/custom tables pysam.samtools and pysam.bcftools for wrapped command dispatchers Current upstream baseline: pysam 0.24.0 (27 April 2026), wrapping HTSlib/samtools/bcftools 1.23.1. Read references/sources.md before updating version-specific guidance. Installation Use the pinned release for reproducible work: Confirm the runtime: Prebuilt wheels are available for supported macOS and Linux platforms. A source build needs a C compiler and HTSlib build dependencies; read the official installation guide linked from references/sources.md. First Decide Before writing code: 1. Identify the real format, compression, sort order, and available index. 2. Decide whether coordinates are numeric Python coordinates or a region string. Do not mix them. 3. For CRAM, identify the exact reference assembly and FASTA. 4. Prefer indexed region access; use sequential iteration only when intended. 5. Preserve headers when writing and write to a new path by default. 6. State filtering semantics: mapping/base quality, flags, overlap handling, duplicate handling, and pileup depth cap. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills k-dense-ai/pysam

View the source on GitHub

Browse the @skills marketplace