vimalinx/bio-agent / .claude/skills/bam-to-bed
bam-to-bed
VerifiedUse when converting BAM alignment files to BED6, BED12, or BEDPE format for downstream analysis or visualization.
bam-to-bed
Quick Start
- Command:
bamToBed -i input.bam [options] > output.bed - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/bamToBed - Full reference: See
references/help.md
When To Use This Tool
- Convert alignments from BAM into BED6, BED12, or BEDPE for downstream interval analysis.
- Represent split or spliced alignments as separate blocks with
-split,-splitD, or-bed12. - Export paired-end geometry with
-bedpe. - Preserve extra alignment context such as edit distance or CIGAR when BED output alone is too lossy.
Common Patterns
# 1) Basic BAM to BED6
bamToBed \
-i alignments.bam > alignments.bed
# 2) BED12 output for split alignments
bamToBed \
-i alignments.bam \
-bed12 > alignments.bed12
# 3) BEDPE for paired-end reads
bamToBed \
-i alignments.qname.bam \
-bedpe > alignments.bedpe
Recommended Workflow
- Choose the target representation first: BED6 for simple intervals, BED12 for blocked alignments, or BEDPE for read pairs.
- Query-name sort or group the BAM before using
-bedpe. - Add
-split/-splitDwhen the CIGAR structure matters for exon-aware or gapped alignments. - Redirect stdout to a file and sanity-check coordinates and column count before feeding the result into downstream tools.
Guardrails
-bedperequires BAM records to be grouped or sorted by query.-bed12forces-split.-splitDalso forces-splitand breaks on bothNandDCIGAR operators.-tagmust reference a numeric BAM tag and cannot be combined with BEDPE output.- Default BED score is mapping quality;
-edchanges that semantics, especially for BEDPE where the mate edit distances are combined.
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: 197k | 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: 194k | 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: 194k | 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: 194k | Updated | Claude CodeCodex | Verified | Install |