28 #include "boost/iostreams/positioning.hpp" 29 #include "boost/filesystem/path.hpp" 38 namespace bfs = boost::filesystem;
54 fabs(a->retentionTime - b->retentionTime) <
rt_epsilon;
64 if (
os_) *
os_ <<
"testFeatureDetectorSimple() ... " << endl;
73 config.
cp = CalibrationParameters::thermo_FT();
79 MSDataFile msd((datadir /
"FeatureDetectorTest_Bombesin.mzML").
string());
82 fds.
detect(msd, output_features);
87 bombesin2_truth->mz = 810.4148;
88 bombesin2_truth->retentionTime = 1866;
90 FeatureField::iterator bombesin2_hopeful = find_if(output_features.begin(), output_features.end(),
mzrtEqual(bombesin2_truth));
93 unit_assert(bombesin2_hopeful != output_features.end());
96 if (
os_) *
os_ <<
"\n[FeatureDetectorSimple] Bombesin detected at charge state +2 ... " << endl << *bombesin2_hopeful << endl;
102 bombesin3_truth->mz = 540.6123;
103 bombesin3_truth->retentionTime = 1866;
105 FeatureField::iterator bombesin3_hopeful = find_if(output_features.begin(), output_features.end(),
mzrtEqual(bombesin3_truth));
108 unit_assert(bombesin3_hopeful != output_features.end());
111 if (
os_) *
os_ <<
"\n[FeatureDetectorSimple] Bombesin detected at charge state +3 ... " << endl << *bombesin3_hopeful << endl;
117 int main(
int argc,
char* argv[])
123 bfs::path datadir =
".";
125 for (
int i=1; i<argc; i++)
127 if (!strcmp(argv[i],
"-v"))
133 datadir = bfs::path(argv[i]).branch_path();
FeatureDetectorSimple detects 'rectangular' features, ie number of peaks in isotope envelope is the s...
void testFeatureDetectorSimple(const bfs::path &datadir)
MZRTField is a std::set of boost::shared_ptrs, stored as a binary tree ordered by LessThan_MZRT...
virtual void detect(const MSData &msd, FeatureField &result) const
FT-specific implementation of PeakFamilyDetector.
data::CalibrationParameters cp
boost::shared_ptr< Feature > FeaturePtr
MSData object plus file I/O.
#define TEST_PROLOG(argc, argv)
int main(int argc, char *argv[])
bool operator()(FeaturePtr b) const