72 p.setMetaValue(
"feature_id",
"not mapped");
77 c.setMetaValue(
"feature_id",
String(
c.getUniqueId()));
80 resolveConflict_(
c.getPeptideIdentifications(),
81 map.getUnassignedPeptideIdentifications(),
86 resolveConflictKeepMatching_(
c.getPeptideIdentifications(),
87 map.getUnassignedPeptideIdentifications(),
100 std::vector<PeptideIdentification> & peptides,
101 std::vector<PeptideIdentification> & removed,
105 std::vector<PeptideIdentification> & peptides,
106 std::vector<PeptideIdentification> & removed,
113 std::vector<PeptideIdentification>& unassigned = map.getUnassignedPeptideIdentifications();
117 typedef std::map<std::pair<Int, AASequence>,
typename T::value_type*> FeatureSet;
118 FeatureSet feature_set;
122 for (
typename T::value_type& element : map)
124 std::vector<PeptideIdentification>& pep_ids = element.getPeptideIdentifications();
126 if (!pep_ids.empty())
128 if (pep_ids.size() != 1)
136 pep_ids.front().sort();
137 const std::vector<PeptideHit>& hits = pep_ids.front().getHits();
141 const PeptideHit& highest_score_hit = hits.front();
144 std::pair<Int, AASequence> pair = std::make_pair(element.getCharge(), highest_score_hit.
getSequence());
149 typename FeatureSet::iterator feature_in_set = feature_set.find(pair);
150 if (feature_in_set != feature_set.end())
154 if (feature_in_set->second->getIntensity() < element.getIntensity())
157 std::vector<PeptideIdentification>& obsolete = feature_in_set->second->getPeptideIdentifications();
158 unassigned.insert(unassigned.end(), obsolete.begin(), obsolete.end());
159 std::vector<PeptideIdentification> pep_ids_empty;
160 feature_in_set->second->setPeptideIdentifications(pep_ids_empty);
163 feature_in_set->second = &(element);
168 std::vector<PeptideIdentification>& obsolete = element.getPeptideIdentifications();
169 unassigned.insert(unassigned.end(), obsolete.begin(), obsolete.end());
170 std::vector<PeptideIdentification> pep_ids_empty;
171 element.setPeptideIdentifications(pep_ids_empty);
177 feature_set[pair] = &(element);
A container for consensus elements.
Definition: ConsensusMap.h:66
A method or algorithm argument contains illegal values.
Definition: Exception.h:624
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:67
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:110
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
OPENMS_UINT64_TYPE UInt64
Unsigned integer type (64bit)
Definition: Types.h:51
const double c
Definition: Constants.h:188
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22