35 #ifndef OPENMS_ANALYSIS_ID_IDCONFLICTRESOLVERALGORITHM 36 #define OPENMS_ANALYSIS_ID_IDCONFLICTRESOLVERALGORITHM 87 static void resolveBetweenFeatures(
FeatureMap & features);
94 static void resolveBetweenFeatures(
ConsensusMap & features);
104 p.setMetaValue(
"feature_id",
"not mapped");
109 c.setMetaValue(
"feature_id",
String(
c.getUniqueId()));
110 resolveConflict_(
c.getPeptideIdentifications(),
111 map.getUnassignedPeptideIdentifications(),
122 static void resolveConflict_(
123 vector<PeptideIdentification> & peptides,
124 vector<PeptideIdentification> & removed,
131 std::vector<PeptideIdentification>& unassigned = map.getUnassignedPeptideIdentifications();
135 typedef std::map<std::pair<Int, AASequence>,
typename T::value_type*> FeatureSet;
136 FeatureSet feature_set;
140 for (
typename T::value_type& element : map)
142 std::vector<PeptideIdentification>& pep_ids = element.getPeptideIdentifications();
144 if (!pep_ids.empty())
146 if (pep_ids.size() != 1)
154 pep_ids.front().sort();
155 const std::vector<PeptideHit>& hits = pep_ids.front().getHits();
159 const PeptideHit& highest_score_hit = hits.front();
162 std::pair<Int, AASequence> pair = std::make_pair(element.getCharge(), highest_score_hit.
getSequence());
167 typename FeatureSet::iterator feature_in_set = feature_set.find(pair);
168 if (feature_in_set != feature_set.end())
172 if (feature_in_set->second->getIntensity() < element.getIntensity())
175 std::vector<PeptideIdentification>& obsolete = feature_in_set->second->getPeptideIdentifications();
176 unassigned.insert(unassigned.end(), obsolete.begin(), obsolete.end());
177 std::vector<PeptideIdentification> pep_ids_empty;
178 feature_in_set->second->setPeptideIdentifications(pep_ids_empty);
181 feature_in_set->second = &(element);
186 std::vector<PeptideIdentification>& obsolete = element.getPeptideIdentifications();
187 unassigned.insert(unassigned.end(), obsolete.begin(), obsolete.end());
188 std::vector<PeptideIdentification> pep_ids_empty;
189 element.setPeptideIdentifications(pep_ids_empty);
195 feature_set[pair] = &(element);
static void resolveConflict_(T &map)
Definition: IDConflictResolverAlgorithm.h:99
A more convenient string class.
Definition: String.h:57
Definition: IDConflictResolverAlgorithm.h:67
A container for features.
Definition: FeatureMap.h:93
const AASequence & getSequence() const
returns the peptide sequence without trailing or following spaces
A container for consensus elements.
Definition: ConsensusMap.h:75
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
A method or algorithm argument contains illegal values.
Definition: Exception.h:648
Representation of a peptide hit.
Definition: PeptideHit.h:54
OPENMS_UINT64_TYPE UInt64
Unsigned integer type (64bit)
Definition: Types.h:77
static void resolveBetweenFeatures_(T &map)
Definition: IDConflictResolverAlgorithm.h:128
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:62