vimalinx/bio-agent / .claude/skills/intersect-bed
intersect-bed
UnverifiedUse when you need to find overlaps between two genomic interval files (BED, GFF, VCF, or BAM), filter features by intersection, or count/report overlapping regions between datasets.
intersect-bed
Quick Start
- Command:
intersectBed -a <A> -b <B> [options] - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/intersectBed - Full reference: See
references/help.md
When To Use This Tool
- Find overlaps between genomic intervals in BED, GFF, VCF, or BAM-like inputs.
- Filter A features to keep only overlapping records or only non-overlapping records.
- Count overlaps per A feature with
-c/-C. - Retain joined context from both files with
-wa -wb,-wo,-wao, or-loj. - Apply strand-aware and fraction-aware overlap rules before downstream annotation or QC.
Common Patterns
# 1) Basic interval overlap
intersectBed \
-a peaks.bed \
-b promoters.bed
# 2) Keep both records plus overlap length
intersectBed \
-a peaks.bed \
-b promoters.bed \
-wa -wb -wo
# 3) Count overlaps per A interval with reciprocal overlap filtering
intersectBed \
-a peaks.bed \
-b enhancers.bed \
-c \
-f 0.5 \
-r
Recommended Workflow
- Decide whether you need filtering (
-u,-v), joining (-wa,-wb,-wo,-wao,-loj), or counting (-c,-C) before you run the command. - Confirm chromosome naming conventions match across files before trusting an empty result.
- Add
-s/-Sand-f/-F/-r/-edeliberately instead of assuming bedtools defaults fit the biology. - Use
-sortedonly when the inputs are truly sorted, and provide-gif you need a fixed chromosome order.
Guardrails
- Both
-aand-bare required, and-bcan contain multiple files or wildcards. - With BAM as
-a, the default output is BAM-like alignment output unless you request-bedor-ubam. -waoreports non-overlapping A records with a NULL B feature and overlap0;-wodoes not.-Creports counts per B file on distinct lines, which is easy to misread if you expected one line per A feature.- Prefer
-hfor help; some--help/--versionpatterns on these bedtools wrappers emit errors before exiting.
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 |