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

Method parseLuciphorOutput_

src/topp/LuciphorAdapter.cpp:304–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302 }
303
304 String parseLuciphorOutput_(const String& l_out, map<int, LuciphorPSM>& l_psms, const SpectrumLookup& lookup)
305 {
306 if (!File::exists(l_out))
307 {
308 OPENMS_LOG_ERROR << "LuciPhor2 was not able to provide an output. Please set debug >= 4 for additional information." << std::endl;
309 throw Exception::FileNotFound(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, l_out);
310 }
311
312 CsvFile tsvfile(l_out, '\t');
313 String spec_id = "";
314
315 for (Size row_count = 1; row_count < tsvfile.rowCount(); ++row_count) // skip header line
316 {
317 vector<String> elements;
318 if (!tsvfile.getRow(row_count, elements))
319 {
320 writeLogError_("Error: could not split row " + String(row_count) + " of file '" + l_out + "'");
321 return PARSE_ERROR;
322 }
323
324 spec_id = elements[0];
325 struct LuciphorPSM l_psm = splitSpecId_(spec_id);
326 l_psm.scan_idx = lookup.findByScanNumber(l_psm.scan_nr);
327 l_psm.predicted_pep = elements[2];
328 l_psm.delta_score = elements[7].toDouble();
329 l_psm.predicted_pep_score = elements[8].toDouble();
330 l_psm.global_flr = elements[10].toDouble();
331 l_psm.local_flr = elements[11].toDouble();
332 if (l_psms.count(l_psm.scan_idx) > 0)
333 {
334 return "Duplicate scannr existing " + String(l_psm.scan_nr) + ".";
335 }
336 l_psms[l_psm.scan_idx] = l_psm;
337 }
338 return "";
339 }
340
341 // remove all modifications which are LuciPHOr2 target modifications,
342 // because for these LuciPHOr2 could predict a different position.

Callers

nothing calls this directly

Calls 6

rowCountMethod · 0.80
getRowMethod · 0.80
findByScanNumberMethod · 0.80
toDoubleMethod · 0.80
countMethod · 0.80
StringClass · 0.50

Tested by

no test coverage detected