| 65 | } |
| 66 | |
| 67 | ExitCodes main_(int, const char**) override |
| 68 | { |
| 69 | switcher_.setParameters(getParam_().copySubset(switcher_.getParameters())); |
| 70 | String in = getStringOption_("in"), out = getStringOption_("out"); |
| 71 | bool do_proteins_ = getFlag_("proteins"); // from full param of IDScoreSwitcherAlgorithm |
| 72 | |
| 73 | vector<ProteinIdentification> proteins; |
| 74 | vector<PeptideIdentification> peptides; |
| 75 | |
| 76 | IdXMLFile().load(in, proteins, peptides); |
| 77 | |
| 78 | Size counter = 0; |
| 79 | if (do_proteins_) |
| 80 | { |
| 81 | for (auto& pid : proteins) |
| 82 | { |
| 83 | switcher_.switchScores<ProteinIdentification>(pid, counter); |
| 84 | } |
| 85 | } |
| 86 | else |
| 87 | { |
| 88 | for (auto& pepid : peptides) |
| 89 | { |
| 90 | switcher_.switchScores<PeptideIdentification>(pepid, counter); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | IdXMLFile().store(out, proteins, peptides); |
| 95 | |
| 96 | OPENMS_LOG_INFO << "Successfully switched " << counter << " " |
| 97 | << (do_proteins_ ? "protein" : "PSM") << " scores." << endl; |
| 98 | |
| 99 | return EXECUTION_OK; |
| 100 | } |
| 101 | |
| 102 | }; |
| 103 |
nothing calls this directly
no test coverage detected