OpenMS
Loading...
Searching...
No Matches
IdentifiedSequence.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Hendrik Weisser $
6// $Authors: Hendrik Weisser $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12
17
18
19namespace OpenMS
20{
21 namespace IdentificationDataInternal
22 {
24 template <typename SeqType>
26 {
27 SeqType sequence;
28
30
40
41 IdentifiedSequence(const IdentifiedSequence& other) = default;
42
44 {
46 // merge parent matches:
47 for (const auto& pair : other.parent_matches)
48 {
49 auto pos = parent_matches.find(pair.first);
50 if (pos == parent_matches.end()) // new entry
51 {
52 parent_matches.insert(pair);
53 }
54 else // merge entries
55 {
56 pos->second.insert(pair.second.begin(), pair.second.end());
57 }
58 }
59
60 return *this;
61 }
62
64 {
65 if (parent_matches.empty())
66 {
67 std::string msg = "no parent found for identified molecule";
68 throw Exception::MissingInformation(__FILE__, __LINE__,
69 OPENMS_PRETTY_FUNCTION, msg);
70 }
71 for (const auto& pair : parent_matches)
72 {
73 if (!pair.first->is_decoy) return false;
74 }
75 return true;
76 }
77 };
78
81
82 // identified peptides indexed by their sequences:
85
86 // identified oligos indexed by their sequences:
89
90 }
91}
Not all required information provided.
Definition Exception.h:155
A collection of identification records, unique and ordered by the key formed from the members KeyMemb...
Definition IDDataContainer.h:62
IdentifiedSequence< NASequence > IdentifiedOligo
Definition IdentifiedSequence.h:80
IDSequencedContainer< AppliedProcessingStep, std::optional< ProcessingStepRef >, &AppliedProcessingStep::processing_step_opt > AppliedProcessingSteps
Definition AppliedProcessingStep.h:64
IteratorWrapper< IdentifiedOligos::iterator > IdentifiedOligoRef
Definition IdentifiedSequence.h:88
IteratorWrapper< IdentifiedPeptides::iterator > IdentifiedPeptideRef
Definition IdentifiedSequence.h:84
std::map< ParentSequenceRef, std::set< ParentMatch > > ParentMatches
mapping: parent sequence -> match information
Definition ParentMatch.h:75
IdentifiedSequence< AASequence > IdentifiedPeptide
Definition IdentifiedSequence.h:79
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Representation of an identified sequence (peptide or oligonucleotide)
Definition IdentifiedSequence.h:26
IdentifiedSequence & merge(const IdentifiedSequence &other)
Definition IdentifiedSequence.h:43
SeqType sequence
Definition IdentifiedSequence.h:27
IdentifiedSequence(const IdentifiedSequence &other)=default
IdentifiedSequence(const SeqType &sequence, const ParentMatches &parent_matches=ParentMatches(), const AppliedProcessingSteps &steps_and_scores=AppliedProcessingSteps())
Definition IdentifiedSequence.h:31
ParentMatches parent_matches
Definition IdentifiedSequence.h:29
bool allParentsAreDecoys() const
Definition IdentifiedSequence.h:63
Wrapper that adds operator< to iterators, so they can be used as (part of) keys in maps/sets or multi...
Definition MetaData.h:20
Base class for ID data with scores and processing steps (and meta info)
Definition ScoredProcessingResult.h:23
AppliedProcessingSteps steps_and_scores
Definition ScoredProcessingResult.h:24
ScoredProcessingResult & merge(const ScoredProcessingResult &other)
Merge in data from another object.