Closed MatthewThe closed 4 years ago
Actually, it turns out we already were removing the zero intensity peaks.
It seems that the real problem is the weighting of the peaks, which is done according to the number of spectra they occur in. As a profile ms2 spectrum will typically have many peaks close to each other, each of these peaks is counted as coming from a separate spectrum at the moment.
To solve this, we will actually need to count the unique spectra represented in a consensus peak, rather than the number of unique peaks.
The consensus spectra construction combines peaks based on their mz-value and intensity. If peaks have intensity 0, this can result into a divide by 0 (MSClusterMerge.cpp:163). We should simply remove all zero intensity peaks prior to merging peaks to avoid this.
This typically only occurs in profile ms2 spectra (i.e. not peak picked), for which the merging procedure might not be suited in the first place. However, this issue should be solved regardless.