Altius/hotspot2

hotspot2.cpp: Inconsistency between using bin heights & moving avgs of them, also origDistnSize issue

Closed this issue · 1 comments

Count data from sliding windows gets collected into a distribution, which can be imagined as a histogram. Interpretation of the histogram (what's noise, what's signal) is intended to be done via moving averages of bin heights (default = 5 bins at a time, with one bin for each of count=0, count=1, etc.). In the current version of hotspot2.cpp, this is mostly done as intended, but there are a couple spots where bin heights, rather than moving averages of them, are used, so there's some inconsistency that leads to unexpected behavior.

Also, in the most common situation in slideAndCompute(), in which sliding the window causes one observed site to exit to the left and another observed site to enter from the right, and in which the "exit to left" action gets processed prior to the "enter from right" action, variable origDistnSize is used to store the # of histogram bins prior to those two actions. It needs to get updated when the "exit to left" action removes one or more bins from the upper end of the histogram.

Closed via commit befb18d.