83 static void resolveBetweenFeatures(
FeatureMap & features);
90 static void resolveBetweenFeatures(
ConsensusMap & features);
100 p.setMetaValue(
"feature_id",
"not mapped");
105 c.setMetaValue(
"feature_id",
String(
c.getUniqueId()));
106 resolveConflict_(
c.getPeptideIdentifications(),
107 map.getUnassignedPeptideIdentifications(),
118 static void resolveConflict_(
119 std::vector<PeptideIdentification> & peptides,
120 std::vector<PeptideIdentification> & removed,
127 std::vector<PeptideIdentification>& unassigned = map.getUnassignedPeptideIdentifications();
131 typedef std::map<std::pair<Int, AASequence>,
typename T::value_type*> FeatureSet;
132 FeatureSet feature_set;
136 for (
typename T::value_type& element : map)
138 std::vector<PeptideIdentification>& pep_ids = element.getPeptideIdentifications();
140 if (!pep_ids.empty())
142 if (pep_ids.size() != 1)
150 pep_ids.front().sort();
151 const std::vector<PeptideHit>& hits = pep_ids.front().getHits();
155 const PeptideHit& highest_score_hit = hits.front();
158 std::pair<Int, AASequence> pair = std::make_pair(element.getCharge(), highest_score_hit.
getSequence());
163 typename FeatureSet::iterator feature_in_set = feature_set.find(pair);
164 if (feature_in_set != feature_set.end())
168 if (feature_in_set->second->getIntensity() < element.getIntensity())
171 std::vector<PeptideIdentification>& obsolete = feature_in_set->second->getPeptideIdentifications();
172 unassigned.insert(unassigned.end(), obsolete.begin(), obsolete.end());
173 std::vector<PeptideIdentification> pep_ids_empty;
174 feature_in_set->second->setPeptideIdentifications(pep_ids_empty);
177 feature_in_set->second = &(element);
182 std::vector<PeptideIdentification>& obsolete = element.getPeptideIdentifications();
183 unassigned.insert(unassigned.end(), obsolete.begin(), obsolete.end());
184 std::vector<PeptideIdentification> pep_ids_empty;
185 element.setPeptideIdentifications(pep_ids_empty);
191 feature_set[pair] = &(element);
static void resolveConflict_(T &map)
Definition: IDConflictResolverAlgorithm.h:95
A more convenient string class.
Definition: String.h:58
Definition: IDConflictResolverAlgorithm.h:63
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:124
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:62