Read/write SAM/BAM/CRAM, VCF/BCF, FASTA/FASTQ. Region queries, pileup, variant filtering, read groups. Python htslib wrapper exposing samtools/bcftools CLI. Use STAR/BWA for alignment; GATK/DeepVariant for variant calling.
SkillScore100Maintained
Automatic
◆Research pack
Last verified 8/23/2026
What it changes
Passed 22 of 22 test cases with the skill, and 20 of 22 without it.
Without skill91%
With skill100%
Checks it passed that the model alone missed
Passes preset='bcf' to tabix_index
Queries bam.header.get('RG') to retrieve read group header records
2 fixed20 passed either way0 still failing0 broke
Pass-rate lift
+9 pp
Tokens
+362%
Agent turns
0%
Response time
-33%
Model gemini-3.6-flashMeasured 8/23/2026v1 · latest is v222 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
This benchmark measured an earlier version of the skill.
See it in action
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 2
Prompt
I need to inspect a BAM header dictionary using Python htslib bindings to find all sample names associated with read group entries. Which top-level header key contains the read group metadata?
What was checked, without and with the skill
Checked
Without skill
With skill
Queries bam.header.get('RG') to retrieve read group header records
Missed
Passed
case-21 · gemini-3.6-flash · 8/23/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md538 linessingle file
Pysam — Genomic File Toolkit
Overview
Pysam provides a Pythonic interface to htslib for reading, manipulating, and writing genomic data files. It handles SAM/BAM/CRAM alignments, VCF/BCF variants, and FASTA/FASTQ sequences with efficient region-based random access. Also exposes samtools and bcftools as callable Python functions.
When to Use
Reading and querying BAM/CRAM alignment files (region extraction, read filtering)
Extracting reference sequences from indexed FASTA files
Calculating per-base coverage and pileup statistics
Building custom bioinformatics pipelines that combine alignment + variant + sequence data
Quality control of NGS data (mapping quality, flag filtering, coverage)
For alignment from FASTQ (read mapping), use STAR, BWA, or minimap2 instead
For variant calling from BAM, use GATK or DeepVariant instead
Prerequisites
pip install pysam
Note: Requires htslib C library (bundled with pip install on most platforms). On some Linux systems, may need libhts-dev or equivalent. Index files (.bai, .tbi, .fai) required for random access — create with pysam.index(), pysam.tabix_index(), or pysam.faidx().
Pre-flight Interview
Settle these with the user before writing any analysis code.
decisions:
- id: D1
param: mappingQualityFloor
kind: required
source: user
ask: "Below what mapping confidence should reads be ignored when piling up or counting?"
default: "0 - no filter"
- id: D2
param: baseQualityFloor