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

Function cmpDataRT

src/tests/class_tests/openms/source/SqMassFile_test.cpp:93–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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