MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / updateEntries_

Method updateEntries_

src/openms_gui/source/VISUAL/SpectraIDViewTab.cpp:671–924  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 }

Callers

nothing calls this directly

Calls 15

isVisibleFunction · 0.85
concatenateFunction · 0.85
getPeakDataMethod · 0.80
getMSLevelMethod · 0.80
getPrecursorsMethod · 0.80
rowCountMethod · 0.80
setAtBottomRowMethod · 0.80
getSequenceMethod · 0.80
getMetaValueMethod · 0.80
metaValueExistsMethod · 0.80
frontMethod · 0.80

Tested by

no test coverage detected