26 #include <boost/filesystem/operations.hpp> 
   30 using namespace pwiz::util;
 
   31 using namespace pwiz::minimxml;
 
   32 using namespace pwiz::math;
 
   33 using namespace pwiz::data::peakdata;
 
   44     peakFamily.
score = 0.11235811;
 
   54     peakFamily.
peaks.push_back(peak);
 
   55     peakFamily.
peaks.push_back(a);
 
   56     peakFamily.
peaks.push_back(boo);
 
   86     software.
name = 
"World of Warcraft";
 
   87     software.
version = 
"Wrath of the Lich King";
 
   88     software.
source = 
"Blizzard Entertainment";
 
  109     pd.
scans.push_back(scan);
 
  110     pd.
scans.push_back(scan);
 
  120     pkl->retentionTime = 1234.56;
 
  121     pkl->maxIntensity = 9876.54;
 
  122     pkl->totalIntensity = 32123.45;
 
  123     pkl->mzVariance = 6.023;
 
  127     pkl->peaks = peakFamily.
peaks;
 
  135     if (
os_) *
os_ << 
"testPeakEquality()" <<endl;
 
  149     peak.
attributes[Peak::Attribute_Phase] = 4.20;
 
  151     peak2.
attributes[Peak::Attribute_Phase] = 4.20;
 
  152     peak2.
attributes[Peak::Attribute_Decay] = 6.66;
 
  154     peak.
attributes[Peak::Attribute_Decay] = 6.66;
 
  161     if (
os_) *
os_ << 
"testPeak()" <<endl;
 
  177     peak.
attributes[Peak::Attribute_Frequency] = 5;
 
  181     if (
os_) *
os_ << peak << endl;
 
  196     istringstream iss(oss.str());
 
  198     if (
os_) *
os_ << peakIn << endl;
 
  218     jetsons.
write(writer);
 
  225     istringstream iss(oss.str());
 
  226     flintstones.
read(iss);
 
  231     if (
os_) *
os_    << 
"Testing PeakFamily ... " << endl << oss.str() <<endl;
 
  241     ostringstream oss_scan;
 
  243     scan.
write(writer_scan);
 
  249     istringstream iss_scan(oss_scan.str());
 
  250     scan2.
read(iss_scan);
 
  257     if (
os_) *
os_    << 
"Testing Scan ... " << endl << oss_scan.str() << endl;
 
  268     ostringstream oss_soft;
 
  270     software.
write(writer_soft);
 
  276     istringstream iss_soft(oss_soft.str());
 
  277     software2.
read(iss_soft);
 
  282     if (
os_) *
os_    << 
"Testing Software ... " << endl << oss_soft.str() <<endl;
 
  292     ostringstream oss_pd;
 
  302     istringstream iss_pd(oss_pd.str());
 
  308     if (
os_) *
os_    << 
"Testing PeakData ... " << endl << oss_pd.str()<<endl;
 
  319     ostringstream oss_pkl;
 
  321     dill->write(writer_pkl);
 
  328     istringstream iss_pkl(oss_pkl.str());
 
  329     gherkin.
read(iss_pkl);
 
  334     if (
os_) *
os_ << 
"Testing Peakel ... " << endl << oss_pkl.str() << endl;
 
  346     p.
peaks[0].retentionTime = 666;
 
  347     p.
peaks[1].retentionTime = 667;
 
  369     feature.
mz = 1863.0101;
 
  374     feature.
score = 420.0;
 
  375     feature.
error = 666.0;
 
  380     feature.
peakels.push_back(stateFair);
 
  381     feature.
peakels.push_back(deli);
 
  386     feature.
write(writer_f);
 
  394     istringstream iss(oss_f.str());
 
  401         *
os_ << 
"Testing Feature ... " << endl << oss_f.str() << endl;
 
  402         *
os_ << 
"feature2:\n";
 
  404         feature2.
write(writer);
 
  421     dill->peaks.push_back(
Peak(666,419));
 
  422     dill->peaks.push_back(
Peak(666,423));
 
  425     sweet->peaks.push_back(
Peak(666,421));
 
  426     sweet->peaks.push_back(
Peak(666,424));
 
  429     gherkin->peaks.push_back(
Peak(666,418));
 
  430     gherkin->peaks.push_back(
Peak(666,425));
 
  432     feature.
peakels.push_back(dill);
 
  433     feature.
peakels.push_back(sweet);
 
  434     feature.
peakels.push_back(gherkin);
 
  458 int main(
int argc, 
char* argv[])
 
  464         if (argc>1 && !strcmp(argv[1],
"-v")) 
os_ = &cout;
 
  465         if (
os_) *
os_ << 
"PeakDataTest\n";