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

Method compute

src/openms/source/QC/TIC.cpp:19–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17{
18
19 TIC::Result TIC::compute(const MSExperiment& exp, float bin_size, UInt ms_level)
20 {
21 TIC::Result result;
22 MSChromatogram tic = exp.calculateTIC(bin_size, ms_level);
23 if (!tic.empty())
24 {
25 for (const auto& p : tic)
26 {
27 result.intensities.push_back(p.getIntensity());
28 result.retention_times.push_back(p.getRT());
29 }
30
31 UInt max_int = *max_element(result.intensities.begin(), result.intensities.end());
32
33 for (const auto& i : result.intensities)
34 {
35 if (max_int != 0)
36 {
37 result.relative_intensities.push_back((double)i / max_int * 100);
38 }
39 else
40 {
41 result.relative_intensities.push_back(0.0);
42 }
43 }
44
45 result.area = result.intensities[0];
46
47 for (size_t i = 1; i < result.intensities.size(); ++i)
48 {
49 result.area += result.intensities[i];
50 if (result.intensities[i] > result.intensities[i - 1] * 10) // detect 10x jumps between two subsequent scans
51 {
52 ++result.jump;
53 }
54 if (result.intensities[i] < result.intensities[i - 1] / 10) // detect 10x falls between two subsequent scans
55 {
56 ++result.fall;
57 }
58 }
59 }
60 return result;
61 }
62
63 bool TIC::Result::operator==(const Result& rhs) const
64 {

Callers 15

main_Method · 0.45
main_Method · 0.45
main_Method · 0.45
main_Method · 0.45
main_Method · 0.45
storeMethod · 0.45
START_SECTIONFunction · 0.45

Calls 8

calculateTICMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45
getIntensityMethod · 0.45
getRTMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by 10

START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36
START_SECTIONFunction · 0.36