Use 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.
intersectBed -a <A> -b <B> [options]/home/vimalinx/miniforge3/envs/bio/bin/intersectBedreferences/help.md-c / -C.-wa -wb, -wo, -wao, or -loj.# 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
-u, -v), joining (-wa, -wb, -wo, -wao, -loj), or counting (-c, -C) before you run the command.-s / -S and -f / -F / -r / -e deliberately instead of assuming bedtools defaults fit the biology.-sorted only when the inputs are truly sorted, and provide -g if you need a fixed chromosome order.-a and -b are required, and -b can contain multiple files or wildcards.-a, the default output is BAM-like alignment output unless you request -bed or -ubam.-wao reports non-overlapping A records with a NULL B feature and overlap 0; -wo does not.-C reports counts per B file on distinct lines, which is easy to misread if you expected one line per A feature.-h for help; some --help / --version patterns on these bedtools wrappers emit errors before exiting.