bed12-to-bed6
Quick Start
- Command:
bed12ToBed6 -i transcripts.bed12 [options] - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/bed12ToBed6 - Full reference: See
references/help.md
When To Use This Tool
- Split BED12 transcript or gene models into one BED6 record per block.
- Convert exon-style annotations into simple intervals for downstream
intersect,coverage, ormapworkflows. - Preserve block order in the score column with
-nwhen downstream code needs exon numbering. - Simplify BED12 inputs before using tools that only expect BED3/BED6-style intervals.
Common Patterns
# 1) Expand BED12 transcripts into BED6 exon intervals
bed12ToBed6 \
-i transcripts.bed12 \
> exons.bed
# 2) Write the 1-based block number into the BED score column
bed12ToBed6 \
-i transcripts.bed12 \
-n \
> exons-numbered.bed
Recommended Workflow
- Confirm the input is true BED12 with consistent
blockCount,blockSizes, andblockStartsfields. - Decide whether the BED score should stay as the original score or be overwritten with the 1-based block number via
-n. - Run the conversion and redirect to a new BED6 file for downstream interval work.
- Spot-check that the output record count matches the total number of blocks you expected from the source annotation.
Guardrails
- Each BED12 block becomes its own BED6 record; the original block arrays are consumed and not carried forward.
-noverwrites the BED score field, so do not use it if the original score must be preserved.- Invalid BED12 rows can silently produce misleading output; validate block counts and array lengths upstream.
- Prefer
-hfor help; GNU-style--helpand--versionemit wrapper errors before showing usage text.