| 669 | } |
| 670 | |
| 671 | void SpectraIDViewTab::updateEntries_() |
| 672 | { |
| 673 | |
| 674 | // no valid peak layer attached |
| 675 | if (!hasData(layer_)) |
| 676 | { |
| 677 | clear(); |
| 678 | return; |
| 679 | } |
| 680 | |
| 681 | if (ignore_update) |
| 682 | { |
| 683 | return; |
| 684 | } |
| 685 | |
| 686 | if (!isVisible()) |
| 687 | { |
| 688 | return; |
| 689 | } |
| 690 | |
| 691 | auto layer_peak = dynamic_cast<LayerData1DPeak*>(layer_); |
| 692 | if (!layer_peak) return; |
| 693 | |
| 694 | int restore_spec_index = int(layer_peak->getCurrentIndex()); |
| 695 | |
| 696 | set<String> common_keys; |
| 697 | bool has_peak_annotations(false); |
| 698 | // determine meta values common to all hits |
| 699 | Detail::MetaKeyGetter<std::reference_wrapper<const PeptideHit>> getter; |
| 700 | if (create_rows_for_commmon_metavalue_->isChecked()) |
| 701 | { |
| 702 | std::vector<std::reference_wrapper<const PeptideHit>> all_hits; |
| 703 | |
| 704 | for (const auto& spec : layer_->getPeakData()->getSpectra()) |
| 705 | { |
| 706 | UInt ms_level = spec.getMSLevel(); |
| 707 | const vector<PeptideIdentification>& peptide_ids = spec.getPeptideIdentifications(); |
| 708 | |
| 709 | if (ms_level != 2 || peptide_ids.empty()) // skip non ms2 spectra and spectra with no identification |
| 710 | { |
| 711 | continue; |
| 712 | } |
| 713 | |
| 714 | for (const auto& pep_id : peptide_ids) |
| 715 | { |
| 716 | const vector<PeptideHit>& phits = pep_id.getHits(); |
| 717 | all_hits.insert(all_hits.end(), phits.begin(), phits.end()); |
| 718 | if (!has_peak_annotations && !phits[0].getPeakAnnotations().empty()) |
| 719 | { |
| 720 | has_peak_annotations = true; |
| 721 | } |
| 722 | } |
| 723 | } |
| 724 | |
| 725 | common_keys = MetaInfoInterfaceUtils::findCommonMetaKeys< |
| 726 | std::vector<std::reference_wrapper<const PeptideHit>>, |
| 727 | set<String> >(all_hits.begin(), all_hits.end(), 100.0, getter); |
| 728 | } |
nothing calls this directly
no test coverage detected