Skip to content

vimalinx/bio-agent / .claude/skills/bam-to-bed

bam-to-bed

Verified

Use when converting BAM alignment files to BED6, BED12, or BEDPE format for downstream analysis or visualization.

FileKindSize
SKILL.mdskill md1.9 KB
references/help.mdmarkdown2.9 KB
---
name: bam-to-bed
description: Use when converting BAM alignment files to BED6, BED12, or BEDPE format for downstream analysis or visualization.
disable-model-invocation: true
user-invocable: true
---

# 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

```bash
# 1) Basic BAM to BED6
bamToBed \
  -i alignments.bam > alignments.bed
```

```bash
# 2) BED12 output for split alignments
bamToBed \
  -i alignments.bam \
  -bed12 > alignments.bed12
```

```bash
# 3) BEDPE for paired-end reads
bamToBed \
  -i alignments.qname.bam \
  -bedpe > alignments.bedpe
```

## Recommended Workflow

1. Choose the target representation first: BED6 for simple intervals, BED12 for blocked alignments, or BEDPE for read pairs.
2. Query-name sort or group the BAM before using `-bedpe`.
3. Add `-split` / `-splitD` when the CIGAR structure matters for exon-aware or gapped alignments.
4. Redirect stdout to a file and sanity-check coordinates and column count before feeding the result into downstream tools.

## Guardrails

- `-bedpe` requires BAM records to be grouped or sorted by query.
- `-bed12` forces `-split`.
- `-splitD` also forces `-split` and breaks on both `N` and `D` CIGAR operators.
- `-tag` must reference a numeric BAM tag and cannot be combined with BEDPE output.
- Default BED score is mapping quality; `-ed` changes that semantics, especially for BEDPE where the mate edit distances are combined.
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall