| 109 | |
| 110 | |
| 111 | void MascotXMLFile::initializeLookup(SpectrumMetaDataLookup& lookup, const PeakMap& exp, const String& scan_regex) |
| 112 | { |
| 113 | // load spectra and extract scan numbers from the native IDs |
| 114 | // (expected format: "... scan=#"): |
| 115 | lookup.readSpectra(exp.getSpectra()); |
| 116 | if (scan_regex.empty()) // use default formats |
| 117 | { |
| 118 | if (!lookup.empty()) // raw data given -> spectrum look-up possible |
| 119 | { |
| 120 | // possible formats and resulting scan numbers: |
| 121 | // - Mascot 2.3 (?): |
| 122 | // <pep_scan_title>scan=818</pep_scan_title> -> 818 |
| 123 | // - ProteomeDiscoverer/Mascot 2.3 or 2.4: |
| 124 | // <pep_scan_title>Spectrum136 scans:712,</pep_scan_title> -> 712 |
| 125 | // - other variants: |
| 126 | // <pep_scan_title>Spectrum3411 scans: 2975,</pep_scan_title> -> 2975 |
| 127 | // <...>File773 Spectrum198145 scans: 6094</...> -> 6094 |
| 128 | // <...>6860: Scan 10668 (rt=5380.57)</...> -> 10668 |
| 129 | // <pep_scan_title>Scan Number: 1460</pep_scan_title> -> 1460 |
| 130 | lookup.addReferenceFormat("[Ss]can( [Nn]umber)?s?[=:]? *(?<SCAN>\\d+)"); |
| 131 | // - with .dta input to Mascot: |
| 132 | // <...>/path/to/FTAC05_13.673.673.2.dta</...> -> 673 |
| 133 | lookup.addReferenceFormat(R"(\.(?<SCAN>\d+)\.\d+\.(?<CHARGE>\d+)(\.dta)?)"); |
| 134 | } |
| 135 | // title containing RT and MZ instead of scan number: |
| 136 | // <...>575.848571777344_5018.0811_controllerType=0 controllerNumber=1 scan=11515_EcoliMS2small</...> |
| 137 | lookup.addReferenceFormat(R"(^(?<MZ>\d+(\.\d+)?)_(?<RT>\d+(\.\d+)?))"); |
| 138 | } |
| 139 | else // use only user-defined format |
| 140 | { |
| 141 | lookup.addReferenceFormat(scan_regex); |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | } // namespace OpenMS |
no test coverage detected