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
| 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 | { |
nothing calls this directly
no test coverage detected