slop-bed
Quick Start
- Command:
slopBed -i <input> -g <genome> -b <int>orbedtools slop -i <input> -g <genome> -b <int> - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/slopBed - Full reference: See
references/help.md
When To Use This Tool
- Expand intervals outward by a fixed amount on both sides.
- Add asymmetric upstream/downstream flanks with
-land-r. - Build strand-aware promoter or neighborhood windows with
-s. - Scale flanking size as a fraction of interval length with
-pct.
Common Patterns
# 1) Add 200 bp of symmetric flank to every interval
slopBed \
-i peaks.bed \
-g genome.sizes \
-b 200
# 2) Create a strand-aware promoter window: 2 kb upstream, 200 bp downstream
slopBed \
-i transcripts.bed \
-g genome.sizes \
-l 2000 \
-r 200 \
-s
# 3) Expand each interval by 25% of its own length on both sides
slopBed \
-i intervals.bed \
-g genome.sizes \
-b 0.25 \
-pct
Recommended Workflow
- Prepare a genome file (or FASTA
.fai) so bedtools knows the chromosome bounds. - Choose symmetric expansion with
-bor asymmetric expansion with-lplus-r. - Add
-sonly when left/right should be interpreted relative to feature strand, and add-pctonly when flank sizes should scale with feature length. - Inspect a few results to confirm the biological interpretation and the expected boundary clipping at chromosome edges.
Guardrails
-iand-gare both required.- Use either
-balone or-ltogether with-r; these modes are mutually exclusive. - With
-pct, values are fractions of feature length rather than base pairs. -schanges how left and right are interpreted for negative-strand records; it is essential for true upstream/downstream flanks.- Starts are clipped to 0 and ends are clipped to chromosome length when expansion would cross chromosome boundaries.