vimalinx/bio-agent / .claude/skills/samtools
samtools
UnverifiedUse when working with SAM, BAM, or CRAM alignment files to sort, index, view, convert, or compute statistics.
samtools
Quick Start
- Command:
samtools - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/samtools - Version: 1.22.1
- Reference: See
references/help.mdfor full command documentation and options
When To Use This Tool
- Inspect, convert, sort, index, and summarize SAM/BAM/CRAM files.
- It is the default plumbing tool around almost every alignment workflow.
- Use it immediately after aligners and before most downstream coverage or variant workflows.
- Prefer subcommand-oriented usage;
samtoolsis a dispatcher, not a single operation.
Common Patterns
# 1) Convert SAM to BAM
samtools view -b -o sample.bam sample.sam
# 2) Sort and index a BAM
samtools sort -@ 8 -o sample.sorted.bam sample.bam
samtools index sample.sorted.bam
# 3) Inspect basic mapping statistics
samtools flagstat sample.sorted.bam
samtools stats sample.sorted.bam > sample.stats.txt
# 4) Extract one region
samtools view sample.sorted.bam chr1:100000-110000
Recommended Workflow
- Convert aligner output into BAM or CRAM as needed.
- Sort the file before indexing or region-based access.
- Run
flagstat,stats,coverage, ordepthto sanity-check the alignment. - Use specialized subcommands like
fastq,fasta,faidx, ordictonly when the workflow specifically needs them.
Guardrails
- Region-based operations require sorted and indexed files.
samtools quickcheckis a cheap integrity test before burning compute on a broken BAM/CRAM.- Use
-@for thread-aware subcommands, but do not assume every subcommand parallelizes the same way. - Be explicit about output format and destination; many subcommands default to stdout.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |