Skip to main content

pysam

Category: life-sciences · License: MIT · Version: 2.1 · Includes scripts Tags: SAM/BAM, VCF, genomics, sequencing data, bioinformatics

When to use it

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.

Example requests

Ask your agent in plain language, for example:
  • “How do I pull all reads overlapping chr7:55,019,000-55,019,100 from a BAM in Python?”
  • “I have sample42.cram aligned to GRCh38 and I’m getting ‘failed to populate reference’ when I iterate over it in a script, on a machine with no internet. I want to convert it to BAM and then count per-base depth over chr1:1,000,000-1,000,500, ignoring reads with MAPQ<20 and bases with Q<20. What should I do?”
  • “I have a multi-sample VCF and need a smaller file containing only 3 of the cohort’s samples, keeping only PASS variants. I’d also like to add a new INFO annotation. I want to do this in Python and keep the output indexed so I can query it by region later.”

Install

In Claude Code you can also add the marketplace with /plugin marketplace add KalarisLabs/research-agent-skills and install the whole life-sciences category with /plugin install life-sciences@research-agent-skills.

Full playbook

Read SKILL.md for the complete workflow, references and any scripts. The agent installer copies the full skill folder.
Last modified on October 19, 2026