CLI toolkit for SAM/BAM/CRAM: sort, index, convert, filter, QC alignments. Core commands: view, sort, index, flagstat, stats, depth, markdup, merge. Required between alignment and variant/peak calling. Use pysam for Python-native BAM access; deeptools for normalized coverage tracks.
SkillScore100Maintained
Automatic
◆Research pack
Last verified 8/23/2026
What it changes
Passed 22 of 22 test cases with the skill, and 21 of 22 without it.
Without skill95%
With skill100%
Checks it passed that the model alone missed
runs samtools collate prior to fixmate
1 fixed21 passed either way0 still failing0 broke
Pass-rate lift
+5 pp
Tokens
+360%
Agent turns
0%
Response time
-21%
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
A test case the skill fixed. Same model, same prompt, with and without the skill.
Prompt
I have a coordinate-sorted BAM file (`aligned_sorted.bam`). A colleague suggested immediately running `samtools markdup aligned_sorted.bam marked.bam`. Provide the shell commands for the complete, correct duplicate marking workflow using samtools.
What was checked, without and with the skill
Checked
Without skill
With skill
includes samtools fixmate in the workflow
Passed
Passed
runs samtools collate prior to fixmate
Missed
Passed
case-04 · 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.md439 linessingle file
samtools — SAM/BAM/CRAM Alignment Toolkit
Overview
samtools is the standard command-line toolkit for processing sequence alignment files in SAM, BAM, and CRAM formats. It handles the complete alignment file lifecycle: format conversion, coordinate sorting, index creation, quality control statistics, read filtering, duplicate marking, and multi-file merging. samtools is a near-universal component of NGS pipelines between alignment (STAR, BWA) and downstream analysis (variant calling, peak calling, coverage).
When to Use
Sorting BAM files by coordinate after alignment (required before indexing)
Indexing sorted BAM files for random access and region queries
Converting between SAM, BAM, and CRAM formats to save storage
Filtering reads by mapping quality, FLAG bits, or genomic regions
Marking or removing PCR duplicates before variant calling
Merging multiple BAM files from different lanes or samples
Calculating per-base depth or coverage breadth for target regions
Use pysam instead for Python-native BAM manipulation in custom scripts
Use deeptools bamCoverage instead when you need normalized bigWig coverage tracks
Use mosdepth instead for whole-genome per-base depth (faster, parallelized)
Prerequisites
Installation: samtools 1.17+ recommended
Input requirements: SAM/BAM/CRAM files; CRAM requires FASTA reference
Companion tools: samtools faidx for FASTA indexing; samtools sort before samtools index
Check before installing: The tool may already be available in the current environment (e.g., inside a pixi / conda env). Run command -v samtools first and skip the install commands below if it returns a path. When running inside a pixi project, invoke the tool via pixi run samtools rather than bare samtools.