MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / getOriginalSearchEngineSettings_

Method getOriginalSearchEngineSettings_

src/topp/ConsensusID.cpp:244–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242 }
243
244 tuple<String, String, ProteinIdentification::SearchParameters> getOriginalSearchEngineSettings_(const ProteinIdentification& prot)
245 {
246 String engine = prot.getSearchEngine();
247 const ProteinIdentification::SearchParameters& old_sp = prot.getSearchParameters();
248 if (engine != "Percolator")
249 {
250 return std::tie(engine, prot.getSearchEngineVersion(), old_sp);
251 }
252 else
253 {
254 String original_SE = "Unknown";
255 String original_SE_ver = "0.0";
256 vector<String> mvkeys;
257
258 old_sp.getKeys(mvkeys);
259 for (const String & mvkey : mvkeys)
260 {
261 if (mvkey.hasPrefix("SE:"))
262 {
263 original_SE = mvkey.substr(3);
264 original_SE_ver = old_sp.getMetaValue(mvkey);
265 break; // multiSE percolator before consensusID not allowed; we take first only
266 }
267 }
268
269 ProteinIdentification::SearchParameters sp{};
270 for (const String & mvkey : mvkeys)
271 {
272 if (mvkey.hasPrefix(original_SE))
273 {
274 if (mvkey.hasSuffix("db"))
275 {
276 sp.db = old_sp.getMetaValue(mvkey);
277 }
278 else if (mvkey.hasSuffix("db_version"))
279 {
280 sp.db_version = old_sp.getMetaValue(mvkey);
281 }
282 else if (mvkey.hasSuffix("taxonomy"))
283 {
284 sp.taxonomy = old_sp.getMetaValue(mvkey);
285 }
286 else if (mvkey.hasSuffix("charges"))
287 {
288 sp.charges = old_sp.getMetaValue(mvkey);;
289 }
290 else if (mvkey.hasSuffix("fixed_modifications"))
291 {
292 const String& s = old_sp.getMetaValue(mvkey);
293 s.split(',', sp.fixed_modifications);
294 }
295 else if (mvkey.hasSuffix("variable_modifications"))
296 {
297 const String& s = old_sp.getMetaValue(mvkey);
298 s.split(',', sp.variable_modifications);
299 }
300 else if (mvkey.hasSuffix("missed_cleavages"))
301 {

Callers

nothing calls this directly

Calls 9

getInstanceFunction · 0.85
substrMethod · 0.80
getMetaValueMethod · 0.80
getEnzymeMethod · 0.80
getKeysMethod · 0.45
hasPrefixMethod · 0.45
hasSuffixMethod · 0.45
splitMethod · 0.45
toBoolMethod · 0.45

Tested by

no test coverage detected