| 34 | } |
| 35 | |
| 36 | void OSWData::buildNativeIDResolver(const MSExperiment& chrom_traces) |
| 37 | { |
| 38 | // first check if the MSExperiment originates from the same run by checking for matching run-ids |
| 39 | if (chrom_traces.getSqlRunID() != getRunID()) |
| 40 | { |
| 41 | throw Exception::Precondition(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, |
| 42 | "The RUN.ID of the sqMass/MSExperiment ('" + String(chrom_traces.getSqlRunID()) + |
| 43 | "') and the OSW file ('" + String(getRunID()) + "') does not match. " |
| 44 | "Please use a recent version of OpenSwathWorkflow to create matching data."); |
| 45 | } |
| 46 | |
| 47 | Size chrom_count = chrom_traces.getChromatograms().size(); |
| 48 | for (Size i = 0; i < chrom_count; ++i) |
| 49 | { |
| 50 | const auto& chrom = chrom_traces.getChromatograms()[i]; |
| 51 | UInt32 nid; |
| 52 | try |
| 53 | { |
| 54 | nid = chrom.getNativeID().toInt(); |
| 55 | } |
| 56 | catch (...) |
| 57 | { |
| 58 | // probably a precursor native ID, e.g. 5543_precursor_i0 .. currently not handled. |
| 59 | continue; |
| 60 | } |
| 61 | if (transitions_.find(nid) == transitions_.end()) |
| 62 | { |
| 63 | throw Exception::MissingInformation(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Transition with nativeID " + (String(nid)) + " not found in OSW data. Make sure the OSW data was loaded!"); |
| 64 | } |
| 65 | transID_to_index_[nid] = (UInt32)i; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | UInt OSWData::fromNativeID(int transition_id) const |
| 70 | { |
no test coverage detected