| 317 | } |
| 318 | |
| 319 | Int MSSpectrum::findHighestInWindow(MSSpectrum::CoordinateType mz, MSSpectrum::CoordinateType tolerance_left, |
| 320 | MSSpectrum::CoordinateType tolerance_right) const |
| 321 | { |
| 322 | if (ContainerType::empty()) |
| 323 | { |
| 324 | return -1; |
| 325 | } |
| 326 | // get left/right iterator |
| 327 | auto left = this->MZBegin(mz - tolerance_left); |
| 328 | auto right = this->MZEnd(mz + tolerance_right); |
| 329 | |
| 330 | // no MS1 precursor peak in +- tolerance window found |
| 331 | if (left == right) |
| 332 | { |
| 333 | return -1; |
| 334 | } |
| 335 | |
| 336 | auto max_intensity_it = std::max_element(left, right, Peak1D::IntensityLess()); |
| 337 | |
| 338 | // find peak (index) with highest intensity to expected position |
| 339 | return (max_intensity_it - this->begin()); |
| 340 | } |
| 341 | |
| 342 | |
| 343 | void MSSpectrum::sortByPositionPresorted(const std::vector<Chunk>& chunks) |
nothing calls this directly
no test coverage detected