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

Function cmpDataRT

src/tests/class_tests/openms/source/MzMLSqliteHandler_test.cpp:91–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void cmpDataRT(const MSExperiment& exp1, const MSExperiment& exp2, double abs_tol = 1e-5, double rel_tol = 1+1e-5)
92{
93 // Logic of comparison: if the absolute difference criterion is fulfilled,
94 // the relative one does not matter. If the absolute difference is larger
95 // than allowed, the test does not fail if the relative difference is less
96 // than allowed.
97 // Note that the sample spectrum intensity has a very large range, from
98 // 0.00013 to 183 838 intensity and encoding both values with high accuracy
99 // is difficult.
100
101 TOLERANCE_ABSOLUTE(abs_tol)
102 TOLERANCE_RELATIVE(rel_tol)
103 for (Size i = 0; i < exp1.getNrChromatograms(); i++)
104 {
105 TEST_EQUAL(exp1.getChromatograms()[i].size() == exp2.getChromatograms()[i].size(), true)
106 for (Size k = 0; k < exp1.getChromatograms()[i].size(); k++)
107 {
108 auto a = exp1.getChromatograms()[i][k].getRT();
109 auto b = exp2.getChromatograms()[i][k].getRT();
110 // avoid the console clutter if nothing interesing happens
111 if (!TEST::isRealSimilar(a, b)) TEST_REAL_SIMILAR(a, b)
112 }
113 }
114}
115
116///////////////////////////
117

Callers 1

START_SECTIONFunction · 0.70

Calls 6

TEST_EQUALFunction · 0.85
isRealSimilarFunction · 0.85
getChromatogramsMethod · 0.80
getNrChromatogramsMethod · 0.45
sizeMethod · 0.45
getRTMethod · 0.45

Tested by

no test coverage detected