How to calculate the number of peaks that are upstream/downstream of some other peaks
You can use windowBed from bedtools with -c if you just want counts. Or use -wa -wb and then use groupBy for any other operations.