I have a use case for makewindows that I would really like, and I thought I would see if there is enough interest to incorporate this into bedtools.
I often use the makewindows tool to generate windows around features to make e.g. meta-feature plots. Features include polyA sites, transcription starts, transcription stops, start/stop codons etc. These are usually single base features in a BED file.
The data that I am aggregating is typically stranded, such that I have data for which pos / neg signals are meaningful; these are usually libraries prepared from RNA samples (e.g. RNA-seq, polyA-seq etc).
I typically run a common pipeline for aggregation that is similar to this recipe:
However, the problem is that the window numbers from the current makewindows don't have any sense of strand. For example, for positive strand features, window number "1" has upstream coordinates, and for negative strand features, window number 1 has downstream coordinates. When I ulimately groupby these window numbers to report an aggregated signal, it ends up not making much sense (i.e. the window numbers are the same, but the upstream and downstream signals are mixed).
It would be much nicer if there were a flag in the makewindows tool such that it would pay attention to the strand of features it is making windows around, and report window numbers that are consistent across "upstream" and "downstream" relative to features, i.e. window 1 for a positive strand feature would have coordinates upstream of the feature, and window 1 for a negative strand feature would have coordinates downstream. That way, if you aggregate by a fixed window number, they are all either "upstream" or "downstream".