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.
npx skills add K-Dense-AI/scientific-agent-skills --skill pysam --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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: ```bash uv pip install "pysam==0.24.0" ``` Confirm the runtime: ```python import pysam print(pysam.__version__) # 0.24.0 print(pysam.__samtools_version__) # 1.23.1 ``` 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
- Overview
- Installation
- First Decide
- Bundled Scripts
- Coordinate Contract
- Alignment Files
- Variant Files
- FASTA, FASTQ, and Tabix
- CRAM, Remote I/O, and Threads
- Wrapped samtools and bcftools
- Writing Rules
- Reference Map
- Common Failure Modes
uv pip install "pysam==0.24.0" python scripts/inspect_hts.py sample.bam python scripts/inspect_hts.py cohort.vcf.gz python scripts/inspect_hts.py reference.fa
What does the pysam skill do?
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.
How do I install it?
Run `npx skills add K-Dense-AI/scientific-agent-skills --skill pysam --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From K-Dense-AI/scientific-agent-skills, a repository with 32,619 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
