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

Method setProteinIdentificationSettings_

src/topp/ConsensusID.cpp:335–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333 }
334
335 void setProteinIdentificationSettings_(ProteinIdentification& prot_id,
336 vector<tuple<String, String, ProteinIdentification::SearchParameters>>& se_ver_settings,
337 vector<tuple<String, String, vector<pair<String, String>>>>& rescore_ver_settings)
338 {
339 // modification params are necessary for further analysis tools (e.g. LuciPHOr2)
340 set<String> fixed_mods_set;
341 set<String> var_mods_set;
342 set<EnzymaticDigestion::Specificity> specs;
343 double prec_tol_ppm = 0.;
344 double prec_tol_da = 0.;
345 double frag_tol_ppm = 0.;
346 double frag_tol_da = 0.;
347 int min_chg = 10000;
348 int max_chg = -10000;
349 Size mc = 0;
350 // we sort them to pick the same entries, no matter the order of the inputs
351 set<String, std::greater<String>> enzymes;
352 set<String, std::greater<String>> dbs;
353
354 // use the first settings as basis (i.e. copy over db and enzyme and tolerance)
355 // we assume that they are the same or similar
356 ProteinIdentification::SearchParameters new_sp = get<2>(se_ver_settings[0]);
357
358 // first check the rescoring procedure. Should at least be the same tool.
359 // "" = IDPosteriorProbability. If parts were not rescored at all, they wont have a PEP annotated,
360 // and the tool will fail in the next step (beginning of algorithm)
361 // TODO maybe also consolidate/merge those settings. But they are currently only used for reporting.
362 const auto& final_rescore_ver_setting = rescore_ver_settings[0];
363 const String& final_rescore_algo = get<0>(final_rescore_ver_setting);
364 const String& final_rescore_algo_version = get<1>(final_rescore_ver_setting);
365
366 for (const auto& rescore_ver_setting : rescore_ver_settings)
367 {
368 if (get<0>(rescore_ver_setting) != final_rescore_algo
369 || get<1>(rescore_ver_setting) != final_rescore_algo_version)
370 {
371 OPENMS_LOG_WARN << "Warning: Trying to use ConsensusID on searches with different rescoring algorithms. " +
372 get<0>(rescore_ver_setting) + " vs " + final_rescore_algo;
373 }
374 }
375 if (!final_rescore_algo.empty()) new_sp.setMetaValue(final_rescore_algo, final_rescore_algo_version);
376 for (const auto& s : get<2>(final_rescore_ver_setting))
377 {
378 // the metavalue names in s.first already contain the algorithm name. No need to prepend
379 new_sp.setMetaValue(s.first, s.second);
380 }
381
382 bool allsamese = true;
383 for (const auto& se_ver_setting : se_ver_settings)
384 {
385 allsamese = allsamese &&
386 (get<0>(se_ver_setting) == get<0>(se_ver_settings[0]) &&
387 get<1>(se_ver_setting) == get<1>(se_ver_settings[0]));
388
389 const ProteinIdentification::SearchParameters& sp = get<2>(se_ver_setting);
390 const String& SE = get<0>(se_ver_setting);
391 new_sp.setMetaValue("SE:" + SE, get<1>(se_ver_setting));
392 new_sp.setMetaValue(SE+":db",sp.db);

Callers

nothing calls this directly

Calls 15

concatenateFunction · 0.85
getInstanceFunction · 0.85
getChargeRangeMethod · 0.80
hasSubstringMethod · 0.80
getEnzymeMethod · 0.80
setSearchEngineMethod · 0.80
setSearchParametersMethod · 0.80
StringClass · 0.50
emptyMethod · 0.45
setMetaValueMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected