Altius / hotspot2

Implementation of hotspot2 by Eric Rynes
16 stars 3 forks source link

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

Closed erynes closed 8 years ago

erynes commented 8 years ago

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.

erynes commented 8 years ago

Closed via commit befb18debccefcd85365e8b67a2ce8a3e4ca1253.