prafols / rMSI2

rMSI version two
GNU General Public License v3.0
2 stars 3 forks source link

fabs creates binning bug when tolerance_in_ppm is True #6

Closed RogerGinBer closed 5 months ago

RogerGinBer commented 7 months ago

Hi Pere,

This fabs call in line 75 of the binning makes minMassDistance be always positive, which in turn makes the bin always insert after the current minDistanceIndex (even if the actual distance is negative) https://github.com/prafols/rMSI2/blob/08d79480a3b119da96b0638c6db664125994c7ee/src/peakbinning.cpp#L73-L78 https://github.com/prafols/rMSI2/blob/08d79480a3b119da96b0638c6db664125994c7ee/src/peakbinning.cpp#L101-L110

Running some debug tests, this clearly has a huge impact on the resulting data structures and total runtime:

image

prafols commented 5 months ago

I've just checked it, I agree it was a mistake. Fixed