OpenMS  3.0.0
IdentificationData.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2022.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Hendrik Weisser $
32 // $Authors: Hendrik Weisser $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
50 
51 #include <unordered_set>
52 
53 namespace OpenMS
54 {
94  class OPENMS_DLLAPI IdentificationData: public MetaInfoInterface
95  {
96  public:
97 
98  // to be able to add overloads and still find the inherited ones
100 
101  // type definitions:
104 
108 
109  using ProcessingSoftware =
111  using ProcessingSoftwares =
113  using ProcessingSoftwareRef =
115 
119 
124 
128 
129  using ScoredProcessingResult =
131 
132  using AppliedProcessingStep =
134  using AppliedProcessingSteps =
136 
140 
144 
147 
150  using IdentifiedPeptideRef =
152 
155  using IdentifiedCompoundRef =
157 
161 
163 
165 
169 
173 
174  // @TODO: allow multiple sets of groups, like with parent sequences
175  // ("ParentGroupSets")?
179 
181  using ParentGroups =
184  using ParentGroupSet =
186  using ParentGroupSets =
188 
189  using AddressLookup = std::unordered_set<uintptr_t>;
190 
192  struct RefTranslator {
193  std::map<InputFileRef, InputFileRef> input_file_refs;
194  std::map<ScoreTypeRef, ScoreTypeRef> score_type_refs;
195  std::map<ProcessingSoftwareRef, ProcessingSoftwareRef> processing_software_refs;
196  std::map<SearchParamRef, SearchParamRef> search_param_refs;
197  std::map<ProcessingStepRef, ProcessingStepRef> processing_step_refs;
198  std::map<ObservationRef, ObservationRef> observation_refs;
199  std::map<ParentSequenceRef, ParentSequenceRef> parent_sequence_refs;
200  std::map<IdentifiedPeptideRef, IdentifiedPeptideRef> identified_peptide_refs;
201  std::map<IdentifiedOligoRef, IdentifiedOligoRef> identified_oligo_refs;
202  std::map<IdentifiedCompoundRef, IdentifiedCompoundRef> identified_compound_refs;
203  std::map<AdductRef, AdductRef> adduct_refs;
204  std::map<ObservationMatchRef, ObservationMatchRef> observation_match_refs;
205 
206  bool allow_missing = false;
207 
209  {
210  switch (old.getMoleculeType())
211  {
213  {
214  auto pos = identified_peptide_refs.find(old.getIdentifiedPeptideRef());
215  if (pos != identified_peptide_refs.end()) return pos->second;
216  }
217  break;
219  {
220  auto pos = identified_compound_refs.find(old.getIdentifiedCompoundRef());
221  if (pos != identified_compound_refs.end()) return pos->second;
222  }
223  break;
224  case MoleculeType::RNA:
225  {
226  auto pos = identified_oligo_refs.find(old.getIdentifiedOligoRef());
227  if (pos != identified_oligo_refs.end()) return pos->second;
228  }
229  break;
230  default:
231  throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
232  "invalid molecule type",
233  String(old.getMoleculeType()));
234  }
235  if (allow_missing) return old;
236  throw Exception::MissingInformation(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
237  "no match for reference");
238  }
239 
241  {
242  auto pos = observation_match_refs.find(old);
243  if (pos != observation_match_refs.end()) return pos->second;
244  if (allow_missing) return old;
245  throw Exception::MissingInformation(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
246  "no match for reference");
247  }
248  };
249 
252  current_step_ref_(processing_steps_.end()), no_checks_(false)
253  {
254  }
255 
263 
266  MetaInfoInterface(std::move(other)),
267  input_files_(std::move(other.input_files_)),
268  processing_softwares_(std::move(other.processing_softwares_)),
269  processing_steps_(std::move(other.processing_steps_)),
270  db_search_params_(std::move(other.db_search_params_)),
271  db_search_steps_(std::move(other.db_search_steps_)),
272  score_types_(std::move(other.score_types_)),
273  observations_(std::move(other.observations_)),
274  parents_(std::move(other.parents_)),
275  parent_groups_(std::move(other.parent_groups_)),
276  identified_peptides_(std::move(other.identified_peptides_)),
277  identified_compounds_(std::move(other.identified_compounds_)),
278  identified_oligos_(std::move(other.identified_oligos_)),
279  adducts_(std::move(other.adducts_)),
280  observation_matches_(std::move(other.observation_matches_)),
281  observation_match_groups_(std::move(other.observation_match_groups_)),
282  current_step_ref_(std::move(other.current_step_ref_)),
283  no_checks_(std::move(other.no_checks_)),
284  // look-up tables:
285  observation_lookup_(std::move(other.observation_lookup_)),
286  parent_lookup_(std::move(other.parent_lookup_)),
287  identified_peptide_lookup_(std::move(other.identified_peptide_lookup_)),
288  identified_compound_lookup_(std::move(other.identified_compound_lookup_)),
289  identified_oligo_lookup_(std::move(other.identified_oligo_lookup_)),
290  observation_match_lookup_(std::move(other.observation_match_lookup_))
291  {
292  }
293 
299  InputFileRef registerInputFile(const InputFile& file);
300 
306  ProcessingSoftwareRef registerProcessingSoftware(
307  const ProcessingSoftware& software);
308 
314  SearchParamRef registerDBSearchParam(const DBSearchParam& param);
315 
321  ProcessingStepRef registerProcessingStep(const ProcessingStep&
322  step);
323 
329  ProcessingStepRef registerProcessingStep(
330  const ProcessingStep& step, SearchParamRef search_ref);
331 
337  ScoreTypeRef registerScoreType(const ScoreType& score);
338 
344  ObservationRef registerObservation(const Observation& obs);
345 
351  ParentSequenceRef registerParentSequence(const ParentSequence& parent);
352 
354  void registerParentGroupSet(const ParentGroupSet& groups);
355 
361  IdentifiedPeptideRef registerIdentifiedPeptide(const IdentifiedPeptide&
362  peptide);
363 
369  IdentifiedCompoundRef registerIdentifiedCompound(const IdentifiedCompound&
370  compound);
371 
377  IdentifiedOligoRef registerIdentifiedOligo(const IdentifiedOligo& oligo);
378 
384  AdductRef registerAdduct(const AdductInfo& adduct);
385 
391  ObservationMatchRef registerObservationMatch(const ObservationMatch& match);
392 
398  MatchGroupRef registerObservationMatchGroup(const ObservationMatchGroup& group);
399 
401  const InputFiles& getInputFiles() const
402  {
403  return input_files_;
404  }
405 
408  {
409  return processing_softwares_;
410  }
411 
414  {
415  return processing_steps_;
416  }
417 
420  {
421  return db_search_params_;
422  }
423 
426  {
427  return db_search_steps_;
428  }
429 
431  const ScoreTypes& getScoreTypes() const
432  {
433  return score_types_;
434  }
435 
438  {
439  return observations_;
440  }
441 
444  {
445  return parents_;
446  }
447 
450  {
451  return parent_groups_;
452  }
453 
456  {
457  return identified_peptides_;
458  }
459 
462  {
463  return identified_compounds_;
464  }
465 
468  {
469  return identified_oligos_;
470  }
471 
473  const Adducts& getAdducts() const
474  {
475  return adducts_;
476  }
477 
480  {
481  return observation_matches_;
482  }
483 
486  {
487  return observation_match_groups_;
488  }
489 
491  void addScore(ObservationMatchRef match_ref, ScoreTypeRef score_ref,
492  double value);
493 
501  void setCurrentProcessingStep(ProcessingStepRef step_ref);
502 
508  ProcessingStepRef getCurrentProcessingStep();
509 
511  void clearCurrentProcessingStep();
512 
519  std::vector<ObservationMatchRef> getBestMatchPerObservation(ScoreTypeRef score_ref,
520  bool require_score = false) const;
521  // @TODO: this currently doesn't take molecule type into account - should it?
522 
524  std::pair<ObservationMatchRef, ObservationMatchRef> getMatchesForObservation(ObservationRef obs_ref) const;
525 
531  ScoreTypeRef findScoreType(const String& score_name) const;
532 
534  void calculateCoverages(bool check_molecule_length = false);
535 
547  void cleanup(bool require_observation_match = true,
548  bool require_identified_sequence = true,
549  bool require_parent_match = true,
550  bool require_parent_group = false,
551  bool require_match_group = false);
552 
554  bool empty() const;
555 
566  RefTranslator merge(const IdentificationData& other);
567 
569  void swap(IdentificationData& other);
570 
572  void clear();
573 
589  template <class ScoredProcessingResults>
590  ScoreTypeRef pickScoreType(const ScoredProcessingResults& container,
591  bool all_elements = false, bool any_score = false) const
592  {
593  std::map<ScoreTypeRef, Size> score_counts;
594 
595  if (any_score)
596  {
597  for (const auto& element : container)
598  {
599  for (const auto& step : element.steps_and_scores)
600  {
601  for (const auto& pair : step.scores)
602  {
603  score_counts[pair.first]++;
604  }
605  }
606  }
607  }
608  else
609  {
610  for (const auto& element : container)
611  {
612  auto score_info = element.getMostRecentScore();
613  if (std::get<2>(score_info)) // check success indicator
614  {
615  ScoreTypeRef score_ref = *std::get<1>(score_info); // unpack the option
616  if (!all_elements) return score_ref;
617  score_counts[score_ref]++; // elements are zero-initialized
618  }
619  }
620  }
621  if (score_counts.empty()) return score_types_.end();
622  auto pos = max_element(score_counts.begin(), score_counts.end());
623  // @TODO: break ties according to some criterion
624  return pos->first;
625  }
626 
628  void setMetaValue(const ObservationMatchRef ref, const String& key, const DataValue& value);
629 
631  void setMetaValue(const ObservationRef ref, const String& key, const DataValue& value);
632 
634  void setMetaValue(const IdentifiedMolecule& var, const String& key, const DataValue& value);
635 
636  // @TODO: add overloads for other data types derived from MetaInfoInterface
637 
638  protected:
639 
640  // containers:
645  // @TODO: store SearchParamRef inside ProcessingStep? (may not be required
646  // for many processing steps)
658 
661 
668 
669  // look-up tables for fast checking of reference validity:
672  // @TODO: just use one "identified_molecule_lookup_" for all molecule types?
677 
679  void checkScoreTypes_(const std::map<ScoreTypeRef, double>& scores) const;
680 
682  void checkAppliedProcessingSteps_(const AppliedProcessingSteps&
683  steps_and_scores) const;
684 
686  void checkParentMatches_(const ParentMatches& matches,
687  MoleculeType expected_type) const;
688 
696  void mergeScoredProcessingResults_(ScoredProcessingResult& result,
697  const ScoredProcessingResult& other,
698  const RefTranslator& trans);
699 
705  template <typename ElementType>
707  {
709  step_ref(step_ref)
710  {
711  }
712 
713  void operator()(ElementType& element)
714  {
715  element.addProcessingStep(step_ref);
716  }
717 
719  };
720 
726  template <typename ElementType>
728  {
729  ModifyMultiIndexAddScore(ScoreTypeRef score_type_ref, double value):
730  score_type_ref(score_type_ref), value(value)
731  {
732  }
733 
734  void operator()(ElementType& element)
735  {
736  if (element.steps_and_scores.empty())
737  {
738  element.addScore(score_type_ref, value);
739  }
740  else // add score to most recent step
741  {
742  element.addScore(score_type_ref, value,
743  element.steps_and_scores.back().processing_step_opt);
744  }
745  }
746 
748  double value;
749  };
750 
756  template <typename ElementType>
758  {
760  lookup(lookup)
761  {
762  }
763 
764  void operator()(ElementType& element)
765  {
766  removeFromSetIf_(element.parent_matches,
767  [&](const ParentMatches::iterator it)
768  {
769  return !lookup.count(it->first);
770  });
771  }
772 
774  };
775 
776 
778  template <typename ContainerType, typename ElementType>
779  typename ContainerType::iterator insertIntoMultiIndex_(
780  ContainerType& container, const ElementType& element)
781  {
782  checkAppliedProcessingSteps_(element.steps_and_scores);
783 
784  auto result = container.insert(element);
785  if (!result.second) // existing element - merge in new information
786  {
787  container.modify(result.first, [&element](ElementType& existing)
788  {
789  existing.merge(element);
790  });
791  }
792 
793  // add current processing step (if necessary):
794  if (current_step_ref_ != processing_steps_.end())
795  {
797  modifier(current_step_ref_);
798  container.modify(result.first, modifier);
799  }
800 
801  return result.first;
802  }
803 
805  template <typename ContainerType, typename ElementType>
806  typename ContainerType::iterator insertIntoMultiIndex_(
807  ContainerType& container, const ElementType& element,
808  AddressLookup& lookup)
809  {
810  typename ContainerType::iterator ref =
811  insertIntoMultiIndex_(container, element);
812  lookup.insert(uintptr_t(&(*ref)));
813  return ref;
814  }
815 
817  template <typename RefType, typename ContainerType>
818  static bool isValidReference_(RefType ref, ContainerType& container)
819  {
820  for (auto it = container.begin(); it != container.end(); ++it)
821  {
822  if (ref == it) return true;
823  }
824  return false;
825  }
826 
828  template <typename RefType>
830  RefType ref, const AddressLookup& lookup)
831  {
832  return lookup.count(ref);
833  }
834 
836  template <typename ContainerType, typename PredicateType>
837  static void removeFromSetIf_(ContainerType& container, PredicateType predicate)
838  {
839  for (auto it = container.begin(); it != container.end(); )
840  {
841  if (predicate(it))
842  {
843  it = container.erase(it);
844  }
845  else
846  {
847  ++it;
848  }
849  }
850  }
851 
853  template <typename ContainerType>
855  ContainerType& container, const AddressLookup& lookup)
856  {
857  removeFromSetIf_(container, [&lookup](typename ContainerType::iterator it)
858  {
859  return !lookup.count(uintptr_t(&(*it)));
860  });
861  }
862 
864  template <typename ContainerType>
865  static void updateAddressLookup_(const ContainerType& container,
866  AddressLookup& lookup)
867  {
868  lookup.clear();
869  lookup.reserve(container.size());
870  for (const auto& element : container)
871  {
872  lookup.insert(uintptr_t(&element));
873  }
874  }
875 
877  template <typename RefType, typename ContainerType>
878  void setMetaValue_(const RefType ref, const String& key, const DataValue& value,
879  ContainerType& container, const AddressLookup& lookup = AddressLookup())
880  {
881  if (!no_checks_ && ((lookup.empty() && !isValidReference_(ref, container)) ||
882  (!lookup.empty() && !isValidHashedReference_(ref, lookup))))
883  {
884  String msg = "invalid reference for the given container";
885  throw Exception::IllegalArgument(__FILE__, __LINE__,
886  OPENMS_PRETTY_FUNCTION, msg);
887  }
888  container.modify(ref, [&key, &value](typename ContainerType::value_type& element)
889  {
890  element.setMetaValue(key, value);
891  });
892  }
893 
894 
895  // these classes need access to manipulate data:
896  friend class IDFilter;
898  };
899 }
OpenMS::IdentificationDataInternal::IdentifiedOligo
IdentifiedSequence< NASequence > IdentifiedOligo
Definition: IdentifiedSequence.h:107
OpenMS::IdentificationDataInternal::MoleculeType
MoleculeType
Definition: MetaData.h:65
OpenMS::IdentificationDataInternal::MassType
MassType
Definition: MetaData.h:73
OpenMS::MapAlignmentTransformer
This class collects functions for applying retention time transformations to data structures.
Definition: MapAlignmentTransformer.h:57
ParentGroup.h
OpenMS::IdentificationData::db_search_steps_
DBSearchSteps db_search_steps_
Definition: IdentificationData.h:647
OpenMS::IdentificationDataInternal::ProcessingSoftwares
std::set< ProcessingSoftware > ProcessingSoftwares
Definition: ProcessingSoftware.h:68
OpenMS::IdentificationData::current_step_ref_
ProcessingStepRef current_step_ref_
Reference to the current data processing step (see setCurrentProcessingStep())
Definition: IdentificationData.h:660
OpenMS::Exception::IllegalArgument
A method or algorithm argument contains illegal values.
Definition: Exception.h:648
OpenMS::IdentificationData::ProcessingSteps
IdentificationDataInternal::ProcessingSteps ProcessingSteps
Definition: IdentificationData.h:117
OpenMS::IdentificationDataInternal::IdentifiedPeptide
IdentifiedSequence< AASequence > IdentifiedPeptide
Definition: IdentifiedSequence.h:106
OpenMS::IdentificationData::IdentifiedPeptides
IdentificationDataInternal::IdentifiedPeptides IdentifiedPeptides
Definition: IdentificationData.h:149
OpenMS::IdentificationData::RefTranslator::translate
ObservationMatchRef translate(ObservationMatchRef old) const
Definition: IdentificationData.h:240
OpenMS::IdentificationData::AppliedProcessingSteps
IdentificationDataInternal::AppliedProcessingSteps AppliedProcessingSteps
Definition: IdentificationData.h:135
ParentMatch.h
OpenMS::IdentificationData::isValidReference_
static bool isValidReference_(RefType ref, ContainerType &container)
Check whether a reference points to an element in a container.
Definition: IdentificationData.h:818
OpenMS::IdentificationDataInternal::ProcessingSteps
std::set< ProcessingStep > ProcessingSteps
Definition: ProcessingStep.h:88
OpenMS::IdentificationDataInternal::InputFiles
boost::multi_index_container< InputFile, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::member< InputFile, String, &InputFile::name > > > > InputFiles
Definition: include/OpenMS/METADATA/ID/InputFile.h:94
OpenMS::IdentificationData::RefTranslator::input_file_refs
std::map< InputFileRef, InputFileRef > input_file_refs
Definition: IdentificationData.h:193
OpenMS::IdentificationData::RefTranslator::adduct_refs
std::map< AdductRef, AdductRef > adduct_refs
Definition: IdentificationData.h:203
OpenMS::IdentificationData::pickScoreType
ScoreTypeRef pickScoreType(const ScoredProcessingResults &container, bool all_elements=false, bool any_score=false) const
Definition: IdentificationData.h:590
OpenMS::IdentificationDataInternal::ParentSequences
boost::multi_index_container< ParentSequence, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::member< ParentSequence, String, &ParentSequence::accession > > > > ParentSequences
Definition: ParentSequence.h:120
OpenMS::Exception::InvalidValue
Invalid value exception.
Definition: Exception.h:327
MetaData.h
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::IdentificationDataInternal::DBSearchParams
std::set< DBSearchParam > DBSearchParams
Definition: DBSearchParam.h:124
OpenMS::IdentificationData::ModifyMultiIndexAddProcessingStep
Helper functor for adding processing steps to elements in a @t boost::multi_index_container structure...
Definition: IdentificationData.h:706
OpenMS::IdentificationDataInternal::IdentifiedOligos
boost::multi_index_container< IdentifiedOligo, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::member< IdentifiedOligo, NASequence, &IdentifiedOligo::sequence > > > > IdentifiedOligos
Definition: IdentifiedSequence.h:124
OpenMS::IdentificationDataInternal::IdentifiedMolecule::getMoleculeType
MoleculeType getMoleculeType() const
OpenMS::IdentificationData::insertIntoMultiIndex_
ContainerType::iterator insertIntoMultiIndex_(ContainerType &container, const ElementType &element)
Helper function for adding entries (derived from ScoredProcessingResult) to a boost::multi_index_cont...
Definition: IdentificationData.h:779
OpenMS::IdentificationData::ModifyMultiIndexAddScore::score_type_ref
ScoreTypeRef score_type_ref
Definition: IdentificationData.h:747
OpenMS::IdentificationDataInternal::AdductOpt
std::optional< AdductRef > AdductOpt
Definition: ObservationMatch.h:70
OpenMS::IdentificationData::identified_oligo_lookup_
AddressLookup identified_oligo_lookup_
Definition: IdentificationData.h:675
OpenMS::IdentificationDataInternal::IdentifiedMolecule
Variant type holding Peptide/Compound/Oligo references and convenience functions.
Definition: IdentifiedMolecule.h:54
OpenMS::IdentificationDataInternal::ObservationRef
IteratorWrapper< Observations::iterator > ObservationRef
Definition: Observation.h:96
OpenMS::IdentificationDataInternal::PROTEIN
Definition: MetaData.h:67
OpenMS::IdentificationData::observations_
Observations observations_
Definition: IdentificationData.h:649
ProcessingStep.h
OpenMS::IdentificationDataInternal::ParentMatches
std::map< ParentSequenceRef, std::set< ParentMatch > > ParentMatches
mapping: parent sequence -> match information
Definition: ParentMatch.h:101
OpenMS::IdentificationData::getObservationMatches
const ObservationMatches & getObservationMatches() const
Return the registered observation matches (immutable)
Definition: IdentificationData.h:479
OpenMS::IdentificationData::DBSearchParams
IdentificationDataInternal::DBSearchParams DBSearchParams
Definition: IdentificationData.h:121
OpenMS::IdentificationData::ModifyMultiIndexRemoveParentMatches::lookup
const AddressLookup & lookup
Definition: IdentificationData.h:773
ScoreType.h
OpenMS::IdentificationData::RefTranslator::processing_step_refs
std::map< ProcessingStepRef, ProcessingStepRef > processing_step_refs
Definition: IdentificationData.h:197
OpenMS::IdentificationData::setMetaValue_
void setMetaValue_(const RefType ref, const String &key, const DataValue &value, ContainerType &container, const AddressLookup &lookup=AddressLookup())
Helper function to add a meta value to an element in a multi-index container.
Definition: IdentificationData.h:878
OpenMS::IdentificationData::ModifyMultiIndexAddProcessingStep::ModifyMultiIndexAddProcessingStep
ModifyMultiIndexAddProcessingStep(ProcessingStepRef step_ref)
Definition: IdentificationData.h:708
InputFile
OpenMS::InputFile InputFile
Definition: SwathTabWidget.h:143
OpenMS::IdentificationDataInternal::AppliedProcessingSteps
boost::multi_index_container< AppliedProcessingStep, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::ordered_unique< boost::multi_index::member< AppliedProcessingStep, std::optional< ProcessingStepRef >, &AppliedProcessingStep::processing_step_opt > > > > AppliedProcessingSteps
Definition: AppliedProcessingStep.h:133
OpenMS::IdentificationData::observation_match_lookup_
AddressLookup observation_match_lookup_
Definition: IdentificationData.h:676
OpenMS::IdentificationDataInternal::ScoreType
Information about a score type.
Definition: ScoreType.h:45
OpenMS::IdentificationData::getInputFiles
const InputFiles & getInputFiles() const
Return the registered input files (immutable)
Definition: IdentificationData.h:401
OpenMS::IdentificationData::no_checks_
bool no_checks_
Suppress validity checks in register... calls?
Definition: IdentificationData.h:667
OpenMS::IdentificationData::removeFromSetIfNotHashed_
static void removeFromSetIfNotHashed_(ContainerType &container, const AddressLookup &lookup)
Remove elements from a set (or ordered multi_index_container) if they don't occur in a look-up table.
Definition: IdentificationData.h:854
OpenMS::IdentificationData::PeakAnnotations
IdentificationDataInternal::PeakAnnotations PeakAnnotations
Definition: IdentificationData.h:164
OpenMS::IdentificationData::InputFiles
IdentificationDataInternal::InputFiles InputFiles
Definition: IdentificationData.h:106
OpenMS::IdentificationDataInternal::ParentGroupSet
Set of groups of ambiguously identified parent sequences (e.g. results of running a protein inference...
Definition: ParentGroup.h:69
OpenMS::IdentificationData::RefTranslator::observation_refs
std::map< ObservationRef, ObservationRef > observation_refs
Definition: IdentificationData.h:198
OpenMS::IdentificationData::getParentSequences
const ParentSequences & getParentSequences() const
Return the registered parent sequences (immutable)
Definition: IdentificationData.h:443
OpenMS::IdentificationDataInternal::DBSearchParam
Parameters specific to a database search step.
Definition: DBSearchParam.h:47
OpenMS::IdentificationData::RefTranslator::identified_compound_refs
std::map< IdentifiedCompoundRef, IdentifiedCompoundRef > identified_compound_refs
Definition: IdentificationData.h:202
OpenMS::IdentificationData::RefTranslator::translate
IdentifiedMolecule translate(IdentifiedMolecule old) const
Definition: IdentificationData.h:208
OpenMS::IdentificationData::identified_compounds_
IdentifiedCompounds identified_compounds_
Definition: IdentificationData.h:653
OpenMS::IdentificationData::ModifyMultiIndexAddScore::value
double value
Definition: IdentificationData.h:748
OpenMS::IdentificationData::score_types_
ScoreTypes score_types_
Definition: IdentificationData.h:648
IdentifiedSequence.h
OpenMS::IdentificationData::ModifyMultiIndexAddProcessingStep::operator()
void operator()(ElementType &element)
Definition: IdentificationData.h:713
OpenMS::IdentificationData::ObservationMatches
IdentificationDataInternal::ObservationMatches ObservationMatches
Definition: IdentificationData.h:171
OpenMS::IdentificationDataInternal::AdductRef
IteratorWrapper< Adducts::iterator > AdductRef
Definition: ObservationMatch.h:69
ParentSequence.h
OpenMS::IdentificationDataInternal::ObservationMatchGroup
: Group of related (co-identified) input matches
Definition: ObservationMatchGroup.h:50
OpenMS::IdentificationData::getParentGroupSets
const ParentGroupSets & getParentGroupSets() const
Return the registered parent sequence groupings (immutable)
Definition: IdentificationData.h:449
OpenMS::IdentificationData::ModifyMultiIndexRemoveParentMatches::ModifyMultiIndexRemoveParentMatches
ModifyMultiIndexRemoveParentMatches(const AddressLookup &lookup)
Definition: IdentificationData.h:759
OpenMS::IdentificationData::ObservationMatchGroups
IdentificationDataInternal::ObservationMatchGroups ObservationMatchGroups
Definition: IdentificationData.h:177
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::IdentificationDataInternal::SearchParamRef
IteratorWrapper< DBSearchParams::iterator > SearchParamRef
Definition: DBSearchParam.h:125
OpenMS::IdentificationData::getDBSearchParams
const DBSearchParams & getDBSearchParams() const
Return the registered database search parameters (immutable)
Definition: IdentificationData.h:419
OpenMS::IdentificationData::updateAddressLookup_
static void updateAddressLookup_(const ContainerType &container, AddressLookup &lookup)
Recreate the address look-up table for a container.
Definition: IdentificationData.h:865
OpenMS::IdentificationDataInternal::PeakAnnotations
std::vector< PeptideHit::PeakAnnotation > PeakAnnotations
Definition: ObservationMatch.h:52
OpenMS::IdentificationDataInternal::IdentifiedOligoRef
IteratorWrapper< IdentifiedOligos::iterator > IdentifiedOligoRef
Definition: IdentifiedSequence.h:125
OpenMS::IdentificationDataInternal::ObservationMatchRef
IteratorWrapper< ObservationMatches::iterator > ObservationMatchRef
Definition: ObservationMatch.h:152
OpenMS::IdentificationData::ModifyMultiIndexAddScore::ModifyMultiIndexAddScore
ModifyMultiIndexAddScore(ScoreTypeRef score_type_ref, double value)
Definition: IdentificationData.h:729
OpenMS::IdentificationDataInternal::ParentGroups
boost::multi_index_container< ParentGroup, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::member< ParentGroup, std::set< ParentSequenceRef >, &ParentGroup::parent_refs > > > > ParentGroups
Definition: ParentGroup.h:64
OpenMS::IdentificationData::observation_match_groups_
ObservationMatchGroups observation_match_groups_
Definition: IdentificationData.h:657
OpenMS::IdentificationData::Observations
IdentificationDataInternal::Observations Observations
Definition: IdentificationData.h:138
OpenMS::IdentificationDataInternal::ProcessingSoftware
Information about software used for data processing.
Definition: ProcessingSoftware.h:48
OpenMS::IdentificationDataInternal::DBSearchSteps
std::map< ProcessingStepRef, SearchParamRef > DBSearchSteps
Definition: DBSearchParam.h:126
OpenMS::MetaInfoInterface::setMetaValue
void setMetaValue(const String &name, const DataValue &value)
Sets the DataValue corresponding to a name.
OpenMS::DataValue
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:58
OpenMS::IdentificationDataInternal::ParentGroupRef
IteratorWrapper< ParentGroups::iterator > ParentGroupRef
Definition: ParentGroup.h:65
OpenMS::IdentificationDataInternal::Observation
Representation of an observation, e.g. a spectrum or feature, in an input data file.
Definition: Observation.h:53
OpenMS::IdentificationData::input_files_
InputFiles input_files_
Definition: IdentificationData.h:641
OpenMS::IdentificationData::ModifyMultiIndexAddScore
Helper functor for adding scores to elements in a boost::multi_index_container structure.
Definition: IdentificationData.h:727
OpenMS::IdentificationData::removeFromSetIf_
static void removeFromSetIf_(ContainerType &container, PredicateType predicate)
Remove elements from a set (or ordered multi_index_container) if they fulfill a predicate.
Definition: IdentificationData.h:837
OpenMS::MetaInfoInterface
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:60
OpenMS::IdentificationData::ParentMatches
IdentificationDataInternal::ParentMatches ParentMatches
Definition: IdentificationData.h:146
OpenMS::IdentificationData::identified_peptides_
IdentifiedPeptides identified_peptides_
Definition: IdentificationData.h:652
OpenMS::IDFilter
Collection of functions for filtering peptide and protein identifications.
Definition: IDFilter.h:78
OpenMS::IdentificationDataInternal::IteratorWrapper< InputFiles::iterator >
OpenMS::AdductInfo
Definition: AdductInfo.h:42
OpenMS::IdentificationData::processing_softwares_
ProcessingSoftwares processing_softwares_
Definition: IdentificationData.h:642
OpenMS::IdentificationData::identified_oligos_
IdentifiedOligos identified_oligos_
Definition: IdentificationData.h:654
OpenMS::IdentificationData::getIdentifiedCompounds
const IdentifiedCompounds & getIdentifiedCompounds() const
Return the registered compounds (immutable)
Definition: IdentificationData.h:461
OpenMS::IdentificationData::ParentGroupSets
IdentificationDataInternal::ParentGroupSets ParentGroupSets
Definition: IdentificationData.h:187
OpenMS::IdentificationDataInternal::ParentGroupSets
std::vector< ParentGroupSet > ParentGroupSets
Definition: ParentGroup.h:82
OpenMS::IdentificationData::IdentifiedOligos
IdentificationDataInternal::IdentifiedOligos IdentifiedOligos
Definition: IdentificationData.h:159
OpenMS::IdentificationDataInternal::Adducts
std::set< AdductInfo, AdductCompare > Adducts
Definition: ObservationMatch.h:68
OpenMS::IdentificationData::getObservations
const Observations & getObservations() const
Return the registered observations (immutable)
Definition: IdentificationData.h:437
OpenMS::IdentificationData::ParentGroups
IdentificationDataInternal::ParentGroups ParentGroups
Definition: IdentificationData.h:182
OpenMS::IdentificationData::getProcessingSteps
const ProcessingSteps & getProcessingSteps() const
Return the registered data processing steps (immutable)
Definition: IdentificationData.h:413
OpenMS::IdentificationData::insertIntoMultiIndex_
ContainerType::iterator insertIntoMultiIndex_(ContainerType &container, const ElementType &element, AddressLookup &lookup)
Variant of insertIntoMultiIndex_() that also updates a look-up table of valid references (addresses)
Definition: IdentificationData.h:806
OpenMS::IdentificationData::parent_groups_
ParentGroupSets parent_groups_
Definition: IdentificationData.h:651
OpenMS::IdentificationDataInternal::ParentSequenceRef
IteratorWrapper< ParentSequences::iterator > ParentSequenceRef
Definition: ParentSequence.h:121
OpenMS::IdentificationDataInternal::ParentSequence
Representation of a parent sequence that is identified only indirectly (e.g. a protein).
Definition: ParentSequence.h:49
OpenMS::IdentificationData::RefTranslator::search_param_refs
std::map< SearchParamRef, SearchParamRef > search_param_refs
Definition: IdentificationData.h:196
OpenMS::IdentificationData::getAdducts
const Adducts & getAdducts() const
Return the registered adducts (immutable)
Definition: IdentificationData.h:473
OpenMS::IdentificationDataInternal::COMPOUND
Definition: MetaData.h:68
OpenMS::IdentificationData::getDBSearchSteps
const DBSearchSteps & getDBSearchSteps() const
Return the registered database search steps (immutable)
Definition: IdentificationData.h:425
OpenMS::IdentificationData::IdentificationData
IdentificationData(IdentificationData &&other) noexcept
Move constructor.
Definition: IdentificationData.h:265
OpenMS::IdentificationData::ParentSequences
IdentificationDataInternal::ParentSequences ParentSequences
Definition: IdentificationData.h:142
OpenMS::IdentificationDataInternal::IdentifiedMolecule::getIdentifiedPeptideRef
IdentifiedPeptideRef getIdentifiedPeptideRef() const
OpenMS::IdentificationDataInternal::ObservationMatches
boost::multi_index_container< ObservationMatch, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::composite_key< ObservationMatch, boost::multi_index::member< ObservationMatch, ObservationRef, &ObservationMatch::observation_ref >, boost::multi_index::member< ObservationMatch, IdentifiedMolecule, &ObservationMatch::identified_molecule_var >, boost::multi_index::member< ObservationMatch, AdductOpt, &ObservationMatch::adduct_opt > > > > > ObservationMatches
Definition: ObservationMatch.h:150
OpenMS::IdentificationData::ModifyMultiIndexAddProcessingStep::step_ref
ProcessingStepRef step_ref
Definition: IdentificationData.h:718
OpenMS::IdentificationData::IdentifiedCompounds
IdentificationDataInternal::IdentifiedCompounds IdentifiedCompounds
Definition: IdentificationData.h:154
OpenMS::IdentificationData::parent_lookup_
AddressLookup parent_lookup_
Definition: IdentificationData.h:671
OpenMS::IdentificationDataInternal::AppliedProcessingStep
Definition: AppliedProcessingStep.h:55
OpenMS::IdentificationDataInternal::IdentifiedMolecule::getIdentifiedCompoundRef
IdentifiedCompoundRef getIdentifiedCompoundRef() const
OpenMS::IdentificationDataInternal::RNA
Definition: MetaData.h:69
OpenMS::IdentificationData::getScoreTypes
const ScoreTypes & getScoreTypes() const
Return the registered score types (immutable)
Definition: IdentificationData.h:431
OpenMS::IdentificationData::getObservationMatchGroups
const ObservationMatchGroups & getObservationMatchGroups() const
Return the registered groups of observation matches (immutable)
Definition: IdentificationData.h:485
OpenMS::IdentificationData::db_search_params_
DBSearchParams db_search_params_
Definition: IdentificationData.h:644
OpenMS::IdentificationData::ProcessingSoftwares
IdentificationDataInternal::ProcessingSoftwares ProcessingSoftwares
Definition: IdentificationData.h:112
OpenMS::IdentificationData::AddressLookup
std::unordered_set< uintptr_t > AddressLookup
Definition: IdentificationData.h:189
OpenMS::IdentificationDataInternal::Observations
boost::multi_index_container< Observation, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::composite_key< Observation, boost::multi_index::member< Observation, InputFileRef, &Observation::input_file >, boost::multi_index::member< Observation, String, &Observation::data_id > > > > > Observations
Definition: Observation.h:95
OpenMS::IdentificationDataInternal::InputFileRef
IteratorWrapper< InputFiles::iterator > InputFileRef
Definition: include/OpenMS/METADATA/ID/InputFile.h:95
OpenMS::IdentificationData::RefTranslator
structure that maps references of corresponding objects after copying
Definition: IdentificationData.h:192
OpenMS::IdentificationDataInternal::ProcessingSoftwareRef
IteratorWrapper< ProcessingSoftwares::iterator > ProcessingSoftwareRef
Definition: ProcessingSoftware.h:69
OpenMS::IdentificationData
Representation of spectrum identification results and associated data.
Definition: IdentificationData.h:94
OpenMS::IdentificationData::identified_peptide_lookup_
AddressLookup identified_peptide_lookup_
Definition: IdentificationData.h:673
OpenMS::IdentificationDataInternal::ScoredProcessingResult
Base class for ID data with scores and processing steps (and meta info)
Definition: ScoredProcessingResult.h:44
IdentifiedCompound.h
OpenMS::IdentificationData::ModifyMultiIndexRemoveParentMatches
Helper functor for removing invalid parent matches from elements in a boost::multi_index_container st...
Definition: IdentificationData.h:757
OpenMS::IdentificationData::IdentificationData
IdentificationData()
Default constructor.
Definition: IdentificationData.h:251
OpenMS::IdentificationData::ModifyMultiIndexAddScore::operator()
void operator()(ElementType &element)
Definition: IdentificationData.h:734
OpenMS::IdentificationData::RefTranslator::observation_match_refs
std::map< ObservationMatchRef, ObservationMatchRef > observation_match_refs
Definition: IdentificationData.h:204
OpenMS::IdentificationData::adducts_
Adducts adducts_
Definition: IdentificationData.h:655
OpenMS::IdentificationData::observation_matches_
ObservationMatches observation_matches_
Definition: IdentificationData.h:656
OpenMS::IdentificationDataInternal::IdentifiedSequence
Representation of an identified sequence (peptide or oligonucleotide)
Definition: IdentifiedSequence.h:52
OpenMS::IdentificationDataInternal::ProcessingStepRef
IteratorWrapper< ProcessingSteps::iterator > ProcessingStepRef
Definition: ProcessingStep.h:89
OpenMS::IdentificationDataInternal::InputFile
Information about input files that were processed.
Definition: include/OpenMS/METADATA/ID/InputFile.h:50
OpenMS::IdentificationData::RefTranslator::identified_oligo_refs
std::map< IdentifiedOligoRef, IdentifiedOligoRef > identified_oligo_refs
Definition: IdentificationData.h:201
Observation.h
OpenMS::IdentificationData::RefTranslator::identified_peptide_refs
std::map< IdentifiedPeptideRef, IdentifiedPeptideRef > identified_peptide_refs
Definition: IdentificationData.h:200
OpenMS::IdentificationDataInternal::ProcessingStep
Data processing step that is applied to the data (e.g. database search, PEP calculation,...
Definition: ProcessingStep.h:47
OpenMS::IdentificationDataInternal::ScoreTypes
std::set< ScoreType > ScoreTypes
Definition: ScoreType.h:91
ObservationMatchGroup.h
OpenMS::IdentificationData::AdductOpt
IdentificationDataInternal::AdductOpt AdductOpt
Definition: IdentificationData.h:168
OpenMS::IdentificationData::ModifyMultiIndexRemoveParentMatches::operator()
void operator()(ElementType &element)
Definition: IdentificationData.h:764
OpenMS::IdentificationDataInternal::MatchGroupRef
IteratorWrapper< ObservationMatchGroups::iterator > MatchGroupRef
Definition: ObservationMatchGroup.h:100
OpenMS::IdentificationData::RefTranslator::processing_software_refs
std::map< ProcessingSoftwareRef, ProcessingSoftwareRef > processing_software_refs
Definition: IdentificationData.h:195
OpenMS::InputFile
A simple widget with a line-edit and a browse button to choose filenames.
Definition: gui/include/OpenMS/VISUAL/InputFile.h:55
OpenMS::IdentificationData::RefTranslator::parent_sequence_refs
std::map< ParentSequenceRef, ParentSequenceRef > parent_sequence_refs
Definition: IdentificationData.h:199
OpenMS::IdentificationData::getIdentifiedOligos
const IdentifiedOligos & getIdentifiedOligos() const
Return the registered identified oligonucleotides (immutable)
Definition: IdentificationData.h:467
OpenMS::IdentificationData::processing_steps_
ProcessingSteps processing_steps_
Definition: IdentificationData.h:643
OpenMS::IdentificationDataInternal::IdentifiedMolecule::getIdentifiedOligoRef
IdentifiedOligoRef getIdentifiedOligoRef() const
OpenMS::IdentificationData::identified_compound_lookup_
AddressLookup identified_compound_lookup_
Definition: IdentificationData.h:674
OpenMS::IdentificationDataInternal::ParentMatch
Meta data for the association between an identified molecule (e.g. peptide) and a parent sequence (e....
Definition: ParentMatch.h:45
OpenMS::Exception::MissingInformation
Not all required information provided.
Definition: Exception.h:186
InputFile.h
OpenMS::IdentificationData::RefTranslator::score_type_refs
std::map< ScoreTypeRef, ScoreTypeRef > score_type_refs
Definition: IdentificationData.h:194
OpenMS::IdentificationData::Adducts
IdentificationDataInternal::Adducts Adducts
Definition: IdentificationData.h:166
OpenMS::IdentificationDataInternal::ObservationMatchGroups
boost::multi_index_container< ObservationMatchGroup, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::member< ObservationMatchGroup, std::set< ObservationMatchRef >, &ObservationMatchGroup::observation_match_refs > > > > ObservationMatchGroups
Definition: ObservationMatchGroup.h:99
OpenMS::IdentificationDataInternal::IdentifiedPeptides
boost::multi_index_container< IdentifiedPeptide, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::member< IdentifiedPeptide, AASequence, &IdentifiedPeptide::sequence > > > > IdentifiedPeptides
Definition: IdentifiedSequence.h:115
OpenMS::IdentificationDataInternal::ObservationMatch
Representation of a search hit (e.g. peptide-spectrum match).
Definition: ObservationMatch.h:73
OpenMS::IdentificationDataInternal::ParentGroup
: Group of ambiguously identified parent sequences (e.g. protein group)
Definition: ParentGroup.h:50
OpenMS::IdentificationData::isValidHashedReference_
static bool isValidHashedReference_(RefType ref, const AddressLookup &lookup)
Check validity of a reference based on a look-up table of addresses.
Definition: IdentificationData.h:829
OpenMS::IdentificationData::getIdentifiedPeptides
const IdentifiedPeptides & getIdentifiedPeptides() const
Return the registered identified peptides (immutable)
Definition: IdentificationData.h:455
OpenMS::IdentificationData::parents_
ParentSequences parents_
Definition: IdentificationData.h:650
OpenMS::IdentificationData::observation_lookup_
AddressLookup observation_lookup_
Definition: IdentificationData.h:670
OpenMS::IdentificationDataInternal::IdentifiedCompounds
boost::multi_index_container< IdentifiedCompound, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::member< IdentifiedCompound, String, &IdentifiedCompound::identifier > > > > IdentifiedCompounds
Definition: IdentifiedCompound.h:80
OpenMS::IdentificationDataInternal::IdentifiedCompound
Definition: IdentifiedCompound.h:48
OpenMS::IdentificationData::DBSearchSteps
IdentificationDataInternal::DBSearchSteps DBSearchSteps
Definition: IdentificationData.h:123
OpenMS::IdentificationDataInternal::IdentifiedPeptideRef
IteratorWrapper< IdentifiedPeptides::iterator > IdentifiedPeptideRef
Definition: IdentifiedSequence.h:116
OpenMS::IdentificationDataInternal::IdentifiedCompoundRef
IteratorWrapper< IdentifiedCompounds::iterator > IdentifiedCompoundRef
Definition: IdentifiedCompound.h:81
OpenMS::IdentificationDataInternal::ScoreTypeRef
IteratorWrapper< ScoreTypes::iterator > ScoreTypeRef
Definition: ScoreType.h:92
OpenMS::IdentificationData::getProcessingSoftwares
const ProcessingSoftwares & getProcessingSoftwares() const
Return the registered data processing software (immutable)
Definition: IdentificationData.h:407
ObservationMatch.h
DBSearchParam.h
OpenMS::IdentificationData::ScoreTypes
IdentificationDataInternal::ScoreTypes ScoreTypes
Definition: IdentificationData.h:126