/// Fill up transition group with paired Transitions and Chromatograms void getTransitionGroup(OpenSwath::SpectrumAccessPtr input, MRMTransitionGroupType& transition_group, String id) { transition_group.setTransitionGroupID(id); // Go through all transitions for (Size i = 0; i < assay_map[id].size(); i++) { // Check first whether we have a mapping (e.g. see -force option) const TransitionType* transition = assay_map[id][i]; if (chromatogram_map.find(transition->getNativeID()) == chromatogram_map.end()) { LOG_DEBUG << "Found no matching chromatogram for id " << transition->getNativeID() << std::endl; continue; } OpenSwath::ChromatogramPtr cptr = input->getChromatogramById(chromatogram_map[transition->getNativeID()]); MSChromatogram chromatogram; OpenSwathDataAccessHelper::convertToOpenMSChromatogram(cptr, chromatogram); chromatogram.setMetaValue("product_mz", transition->getProductMZ()); chromatogram.setMetaValue("precursor_mz", transition->getPrecursorMZ()); chromatogram.setNativeID(transition->getNativeID()); // Now add the transition and the chromatogram to the group transition_group.addTransition(*transition, transition->getNativeID()); transition_group.addChromatogram(chromatogram, chromatogram.getNativeID()); } }
void setup_transition_group(MRMTransitionGroupType & transition_group) { // this is a simulated SRM experiment where the two traces are not sampled at // the exact same time points, thus a resampling is necessary before applying // the algorithm. static const double rtdata_1[] = {1474.34, 1477.11, 1479.88, 1482.64, 1485.41, 1488.19, 1490.95, 1493.72, 1496.48, 1499.25, 1502.03, 1504.8 , 1507.56, 1510.33, 1513.09, 1515.87, 1518.64, 1521.42}; static const double rtdata_2[] = {1473.55, 1476.31, 1479.08, 1481.84, 1484.61, 1487.39, 1490.15, 1492.92, 1495.69, 1498.45, 1501.23, 1504 , 1506.76, 1509.53, 1512.29, 1515.07, 1517.84, 1520.62}; static const double intdata_1[] = {3.26958, 3.74189, 3.31075, 86.1901, 3.47528, 387.864, 13281 , 6375.84, 39852.6, 2.66726, 612.747, 3.34313, 793.12 , 3.29156, 4.00586, 4.1591 , 3.23035, 3.90591}; static const double intdata_2[] = {3.44054 , 2142.31 , 3.58763 , 3076.97 , 6663.55 , 45681 , 157694 , 122844 , 86034.7 , 85391.1 , 15992.8 , 2293.94 , 6934.85 , 2735.18 , 459.413 , 3.93863 , 3.36564 , 3.44005}; { RichPeakChromatogram chromatogram; for (int k = 0; k < 18; k++) { ChromatogramPeak peak; peak.setMZ(rtdata_1[k]); peak.setIntensity(intdata_1[k]); chromatogram.push_back(peak); } chromatogram.setMetaValue("product_mz", 618.31); chromatogram.setNativeID("1"); transition_group.addChromatogram(chromatogram, chromatogram.getNativeID()); } { RichPeakChromatogram chromatogram; for (int k = 0; k < 18; k++) { ChromatogramPeak peak; peak.setMZ(rtdata_2[k]); peak.setIntensity(intdata_2[k]); chromatogram.push_back(peak); } chromatogram.setMetaValue("product_mz", 619.31); chromatogram.setNativeID("2"); transition_group.addChromatogram(chromatogram, chromatogram.getNativeID()); } }