MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / findApexRT

Method findApexRT

src/topp/MetaProSIP.cpp:2475–2550  ·  view source on GitHub ↗

Extract the mono-isotopic trace and reports the rt of the maximum intensity Used to compensate for slight RT shifts (e.g. important if features of a different map are used) n_scans corresponds to the number of neighboring scan rts that should be extracted n_scan = 2 -> vector size = 1 + 2 + 2

Source from the content-addressed store, hash-verified

2473 // n_scans corresponds to the number of neighboring scan rts that should be extracted
2474 // n_scan = 2 -> vector size = 1 + 2 + 2
2475 vector<double> findApexRT(const FeatureMap::iterator feature_it, double hit_rt, const PeakMap& peak_map, Size n_scans)
2476 {
2477 vector<double> seeds_rt;
2478 vector<Peak2D> mono_trace;
2479
2480 if (!feature_it->getConvexHulls().empty())
2481 {
2482 // extract elution profile of 12C containing mass trace using a bounding box
2483 // first convex hull contains the monoisotopic 12C trace
2484 const DBoundingBox<2>& mono_bb = feature_it->getConvexHulls()[0].getBoundingBox();
2485
2486 //(min_rt, max_rt, min_mz, max_mz)
2487 PeakMap::ConstAreaIterator ait = peak_map.areaBeginConst(mono_bb.minPosition()[0], mono_bb.maxPosition()[0], mono_bb.minPosition()[1], mono_bb.maxPosition()[1]);
2488 for (; ait != peak_map.areaEndConst(); ++ait)
2489 {
2490 Peak2D p2d;
2491 p2d.setRT(ait.getRT()); // get rt of scan
2492 p2d.setMZ(ait->getMZ()); // get peak 1D mz
2493 p2d.setIntensity(ait->getIntensity());
2494 mono_trace.push_back(p2d);
2495 }
2496 }
2497
2498 // if there is no 12C mono trace generate a valid starting point
2499 if (mono_trace.empty())
2500 {
2501 Peak2D p2d;
2502 double next_valid_scan_rt = peak_map.RTBegin(hit_rt - 0.001)->getRT();
2503 p2d.setRT(next_valid_scan_rt);
2504 p2d.setMZ(0); // actually not needed
2505 p2d.setIntensity(0);
2506 mono_trace.push_back(p2d);
2507 }
2508
2509 // determine trace peak with highest intensity
2510 double max_trace_int = -1e16;
2511 Size max_trace_int_idx = 0;
2512
2513 for (Size j = 0; j != mono_trace.size(); ++j)
2514 {
2515 if (mono_trace[j].getIntensity() > max_trace_int)
2516 {
2517 max_trace_int = mono_trace[j].getIntensity();
2518 max_trace_int_idx = j;
2519 }
2520 }
2521 double max_trace_int_rt = mono_trace[max_trace_int_idx].getRT();
2522 seeds_rt.push_back(max_trace_int_rt);
2523
2524 for (Size i = 1; i <= n_scans; ++i)
2525 {
2526 double rt_after = max_trace_int_rt;
2527 if (max_trace_int_idx < mono_trace.size() - (Int)i)
2528 {
2529 rt_after = mono_trace[max_trace_int_idx + i].getRT();
2530 }
2531
2532 double rt_before = max_trace_int_rt;

Callers

nothing calls this directly

Calls 13

getConvexHullsMethod · 0.80
getBoundingBoxMethod · 0.80
areaBeginConstMethod · 0.80
areaEndConstMethod · 0.80
emptyMethod · 0.45
setRTMethod · 0.45
getRTMethod · 0.45
setMZMethod · 0.45
getMZMethod · 0.45
getIntensityMethod · 0.45
push_backMethod · 0.45
RTBeginMethod · 0.45

Tested by

no test coverage detected