Increase permited equal or bigger neighbor bins to relax peaksFinder conditions #140
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The condition to identify a bin as a peak is to compare the smoothed value of each bin with its 5 neighbouring bins in each direction. If there are more than the changed value neighbour bins equal or higher than the smoothed value of the corresponding bin then it is not a peak. This way the first bin (within the "distance" parameter) that has no more than this number of equal or bigger neighbours is the peak (no more bins within "distance" can be peaks).
I found some cases where setting the value to >2 was not letting some signals detect a peak (if the region of the maximum is flat along several bins). I think >3 is a better compromise to not allow very flat regions to be considered as peak while detecting clear peaks.