76 p.setMetaValue(
"feature_id",
"not mapped");
81 c.setMetaValue(
"feature_id",
String(
c.getUniqueId()));
84 resolveConflict_(
c.getPeptideIdentifications(),
85 map.getUnassignedPeptideIdentifications(),
90 resolveConflictKeepMatching_(
c.getPeptideIdentifications(),
91 map.getUnassignedPeptideIdentifications(),
104 std::vector<PeptideIdentification> & peptides,
105 std::vector<PeptideIdentification> & removed,
109 std::vector<PeptideIdentification> & peptides,
110 std::vector<PeptideIdentification> & removed,
117 std::vector<PeptideIdentification>& unassigned = map.getUnassignedPeptideIdentifications();
121 typedef std::map<std::pair<Int, AASequence>,
typename T::value_type*> FeatureSet;
122 FeatureSet feature_set;
126 for (
typename T::value_type& element : map)
128 std::vector<PeptideIdentification>& pep_ids = element.getPeptideIdentifications();
130 if (!pep_ids.empty())
132 if (pep_ids.size() != 1)
140 pep_ids.front().sort();
141 const std::vector<PeptideHit>& hits = pep_ids.front().getHits();
145 const PeptideHit& highest_score_hit = hits.front();
148 std::pair<Int, AASequence> pair = std::make_pair(element.getCharge(), highest_score_hit.
getSequence());
153 typename FeatureSet::iterator feature_in_set = feature_set.find(pair);
154 if (feature_in_set != feature_set.end())
158 if (feature_in_set->second->getIntensity() < element.getIntensity())
161 std::vector<PeptideIdentification>& obsolete = feature_in_set->second->getPeptideIdentifications();
162 unassigned.insert(unassigned.end(), obsolete.begin(), obsolete.end());
163 std::vector<PeptideIdentification> pep_ids_empty;
164 feature_in_set->second->setPeptideIdentifications(pep_ids_empty);
167 feature_in_set->second = &(element);
172 std::vector<PeptideIdentification>& obsolete = element.getPeptideIdentifications();
173 unassigned.insert(unassigned.end(), obsolete.begin(), obsolete.end());
174 std::vector<PeptideIdentification> pep_ids_empty;
175 element.setPeptideIdentifications(pep_ids_empty);
181 feature_set[pair] = &(element);
A container for consensus elements.
Definition: ConsensusMap.h:66
A method or algorithm argument contains illegal values.
Definition: Exception.h:616
A container for features.
Definition: FeatureMap.h:80
Resolves ambiguous annotations of features with peptide identifications.
Definition: IDConflictResolverAlgorithm.h:32
static void resolve(FeatureMap &features, bool keep_matching=false)
Resolves ambiguous annotations of features with peptide identifications. The the filtered identificat...
static void resolveBetweenFeatures(FeatureMap &features)
In a single (feature/consensus) map, features with the same (possibly modified) sequence and charge s...
static void resolveBetweenFeatures(ConsensusMap &features)
In a single (feature/consensus) map, features with the same (possibly modified) sequence and charge s...
static bool compareIDsSmallerScores_(const PeptideIdentification &left, const PeptideIdentification &right)
static void resolveConflict_(T &map, bool keep_matching)
Definition: IDConflictResolverAlgorithm.h:71
static void resolveConflict_(std::vector< PeptideIdentification > &peptides, std::vector< PeptideIdentification > &removed, UInt64 uid)
static void resolve(ConsensusMap &features, bool keep_matching=false)
Resolves ambiguous annotations of consensus features with peptide identifications....
static void resolveConflictKeepMatching_(std::vector< PeptideIdentification > &peptides, std::vector< PeptideIdentification > &removed, UInt64 uid)
static void resolveBetweenFeatures_(T &map)
Definition: IDConflictResolverAlgorithm.h:114
Representation of a peptide hit.
Definition: PeptideHit.h:31
const AASequence & getSequence() const
returns the peptide sequence
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:39
A more convenient string class.
Definition: String.h:34
uint64_t UInt64
Unsigned integer type (64bit)
Definition: Types.h:47
const double c
Definition: Constants.h:188
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19