Count overlaps
The -wo (write overlap) option allows one to also report the number of base pairs of overlap between the features that overlap between each of the files:
We can also count, for each feature in the “A” file, the number of overlapping features in the “B” file. This is handled with the -c option:
Often we want to identify those features in our A file that do not overlap features in the B file. The -v option is your friend in this case:
Recall that the default is to report overlaps between features in A and B so long as at least one basepair of overlap exists. However, the -f option allows you to specify what fraction of each feature in A should be overlapped by a feature in B before it is reported. Let’s be more strict and require 50% of overlap: