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

Method generateInputfileMapping_

src/topp/MSGFPlusAdapter.cpp:299–328  ·  view source on GitHub ↗

Parse mzML and create RTMapping get RT: it doesn't exist in output from MS-GF+ get m/z: it is rounded after converting to TSV

Source from the content-addressed store, hash-verified

297 // get RT: it doesn't exist in output from MS-GF+
298 // get m/z: it is rounded after converting to TSV
299 void generateInputfileMapping_(map<String, vector<float> >& rt_mapping)
300 {
301 String exp_name = getStringOption_("in");
302
303 if (!exp_name.empty())
304 {
305 PeakMap exp;
306 // load only MS2 spectra:
307 MzMLFile f;
308 f.getOptions().addMSLevel(2);
309 f.getOptions().setFillData(false);
310 f.load(exp_name, exp);
311 exp.getPrimaryMSRunPath(primary_ms_run_path_);
312 // if no primary run is assigned, the mzML file is the (unprocessed) primary file
313 if (primary_ms_run_path_.empty())
314 {
315 primary_ms_run_path_.push_back(exp_name);
316 }
317
318 for (MSSpectrum& ms : exp)
319 {
320 String id = ms.getNativeID(); // expected format: "... scan=#"
321 if (!id.empty())
322 {
323 rt_mapping[id].push_back(ms.getRT());
324 rt_mapping[id].push_back(ms.getPrecursors()[0].getMZ());
325 }
326 }
327 }
328 }
329
330 String makeModString_(const String& mod_name, bool fixed=true)
331 {

Callers

nothing calls this directly

Calls 10

addMSLevelMethod · 0.80
setFillDataMethod · 0.80
getNativeIDMethod · 0.80
getPrecursorsMethod · 0.80
emptyMethod · 0.45
loadMethod · 0.45
getPrimaryMSRunPathMethod · 0.45
push_backMethod · 0.45
getRTMethod · 0.45
getMZMethod · 0.45

Tested by

no test coverage detected