Use when you need to remove overlapping portions of one interval set from another, such as subtracting blacklist, repeat, or annotation regions from BED, GFF, VCF, or BAM-like inputs.
subtractBed -a <bed/gff/vcf> -b <bed/gff/vcf>/home/vimalinx/miniforge3/envs/bio/bin/subtractBed-A or -N.# 1) Remove blacklist segments from peaks
subtractBed \
-a peaks.bed \
-b blacklist.bed \
> peaks.clean.bed
# 2) Remove whole A features if at least half the feature overlaps B
subtractBed \
-a exons.bed \
-b repeats.bed \
-A \
-f 0.5 \
> exons.filtered.bed
# 3) Subtract only same-strand overlaps, treating BED12/BAM splits separately
subtractBed \
-a transcripts.bed12 \
-b antisense-mask.bed \
-s \
-split \
> transcripts.trimmed.bed
-A / -N.-f, -F, -r, -e, -s, or -S.-sorted with -g when a stable chromosome order matters.-wo or -wb as a diagnostic pass rather than as the final cleaned output.-A removes the whole A feature on qualifying overlap, while -N with -f uses the summed overlap across all B features.-wo and -wb change the output layout for overlap inspection; do not treat those outputs like plain trimmed BED intervals.-sorted requires truly coordinate-sorted inputs and may need -nonamecheck if naming conventions differ (chr1 vs chr01).-bed when the downstream consumer expects BED-style output rather than alignment output.