Use when you need to find features in one file that fall within a configurable window around features in another file, including strand-aware upstream and downstream proximity searches.
windowBed -a <bed/gff/vcf> -b <bed/gff/vcf> -w <bp>/home/vimalinx/miniforge3/envs/bio/bin/windowBedreferences/help.md# 1) Find B features within 5 kb of each A feature
windowBed \
-a genes.bed \
-b peaks.bed \
-w 5000
# 2) Query a strand-aware promoter window: 2 kb upstream, 500 bp downstream
windowBed \
-a transcripts.bed \
-b atac-peaks.bed \
-l 2000 \
-r 500 \
-sw \
-sm
# 3) Count nearby features instead of returning paired records
windowBed \
-a genes.bed \
-b enhancers.bed \
-w 100000 \
-c
-u, -v), or counts (-c).-w or an asymmetric design with -l and -r.-sw only when upstream/downstream should be interpreted relative to strand, and add -sm or -Sm only when overlap partners must match or oppose strand.-abam and choose whether output should stay BAM-like or be converted with -bed.-a and -b are both required unless BAM input is supplied through -abam, which replaces -a.-w, -l, or -r, bedtools uses a default symmetric window of 1000 bp.-u, -c, and -v change the row count and layout substantially.-sw changes how left/right windows are interpreted relative to feature strand; it is different from -sm / -Sm, which filter the strand relationship between A and B.-h for help; GNU-style --help and --version emit wrapper errors before usage text.