uses spectrum_reference, if empty uses spectrum_id, if also empty fall back to using index
| 35 | |
| 36 | // uses spectrum_reference, if empty uses spectrum_id, if also empty fall back to using index |
| 37 | String PercolatorInfile::getScanIdentifier(const PeptideIdentification& pid, size_t index) |
| 38 | { |
| 39 | // MSGF+ uses this field, is empty if not specified |
| 40 | String scan_identifier = pid.getSpectrumReference(); |
| 41 | |
| 42 | if (scan_identifier.empty()) |
| 43 | { |
| 44 | // XTandem uses this (integer) field |
| 45 | // these ids are 1-based in contrast to the index which is 0-based. This might be problematic to use for merging |
| 46 | if (pid.metaValueExists("spectrum_id") && !pid.getMetaValue("spectrum_id").toString().empty()) |
| 47 | { |
| 48 | scan_identifier = "scan=" + pid.getMetaValue("spectrum_id").toString(); |
| 49 | } |
| 50 | else |
| 51 | { |
| 52 | scan_identifier = "index=" + String(index); // fall back |
| 53 | OPENMS_LOG_WARN << "no known spectrum identifiers, using index [1,n] - use at own risk." << endl; |
| 54 | } |
| 55 | } |
| 56 | return scan_identifier.removeWhitespaces(); |
| 57 | } |
| 58 | |
| 59 | vector<PeptideIdentification> PercolatorInfile::load( |
| 60 | const String& pin_file, |
nothing calls this directly
no test coverage detected