* @brief find a theoretical delta mass pattern that matches the detected pattern * * @param consensus detected pattern * @param label set label set extracted from the detected pattern * @param theoretical_patterns list of theoretical delta mass patterns * @param delta_mass_matched Was this delta mass in the theoretical pattern matched? * @param index_label_set inde
| 297 | * @return index of matching pattern |
| 298 | */ |
| 299 | int findMatchingPattern_(const ConsensusMap::ConstIterator consensus, const MultiplexDeltaMasses::LabelSet& label_set, const std::vector<MultiplexDeltaMasses>& theoretical_patterns, std::vector<bool>& delta_mass_matched, int& index_label_set) |
| 300 | { |
| 301 | // loop over theoretical patterns |
| 302 | for (std::vector<MultiplexDeltaMasses>::const_iterator it_pattern = theoretical_patterns.begin(); it_pattern != theoretical_patterns.end(); ++it_pattern) |
| 303 | { |
| 304 | std::vector<MultiplexDeltaMasses::DeltaMass> pattern = it_pattern->getDeltaMasses(); |
| 305 | |
| 306 | double shift = matchLabelSet_(pattern, label_set, index_label_set); |
| 307 | if (!std::isnan(shift)) |
| 308 | { |
| 309 | // reset boolean vector to false |
| 310 | delta_mass_matched.assign(delta_mass_matched.size(), false); |
| 311 | |
| 312 | bool match = matchDeltaMasses_(consensus, pattern, shift, delta_mass_matched); |
| 313 | if (match) |
| 314 | { |
| 315 | return (it_pattern - theoretical_patterns.begin()); |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | return -1; |
| 321 | } |
| 322 | |
| 323 | /** |
| 324 | * @brief find the m/z for the complete consensus |