ProteoWizard
Functions | Variables
DiffTest.cpp File Reference
#include "Diff.hpp"
#include "TextWriter.hpp"
#include "examples.hpp"
#include "pwiz/utility/misc/unit.hpp"
#include "pwiz/utility/misc/Std.hpp"
#include <cstring>

Go to the source code of this file.

Functions

void testIdentifiable ()
 
void testFragmentArray ()
 
void testIonType ()
 
void testMeasure ()
 
void testSearchModification ()
 
void testPeptideEvidence ()
 
void testProteinAmbiguityGroup ()
 
void testPeptideHypothesis ()
 
void testProteinDetectionHypothesis ()
 
void testSpectrumIdentificationList ()
 
void testProteinDetectionList ()
 
void testAnalysisData ()
 
void testSearchDatabase ()
 
void testSpectraData ()
 
void testSourceFile ()
 
void testInputs ()
 
void testEnzyme ()
 
void testEnzymes ()
 
void testMassTable ()
 
void testResidue ()
 
void testAmbiguousResidue ()
 
void testFilter ()
 
void testDatabaseTranslation ()
 
void testSpectrumIdentificationProtocol ()
 
void testProteinDetectionProtocol ()
 
void testAnalysisProtocolCollection ()
 
void testContact ()
 
void testPerson ()
 
void testOrganization ()
 
void testBibliographicReference ()
 
void testProteinDetection ()
 
void testSpectrumIdentification ()
 
void testAnalysisCollection ()
 
void testDBSequence ()
 
void testModification ()
 
void testSubstitutionModification ()
 
void testPeptide ()
 
void testSequenceCollection ()
 
void testSampleComponent ()
 
void testSample ()
 
void testSpectrumIdentificationItem ()
 
void testSpectrumIdentificationResult ()
 
void testAnalysisSampleCollection ()
 
void testProvider ()
 
void testContactRole ()
 
void testAnalysisSoftware ()
 
void testDataCollection ()
 
void testIdentData ()
 
void test ()
 
int main (int argc, char *argv[])
 

Variables

ostream * os_ = 0
 
const double epsilon = numeric_limits<double>::epsilon()
 

Function Documentation

§ testIdentifiable()

void testIdentifiable ( )

Definition at line 43 of file DiffTest.cpp.

References diff(), pwiz::identdata::Identifiable::id, pwiz::data::BaseDiffConfig::ignoreVersions, pwiz::identdata::Identifiable::name, os_, and unit_assert.

Referenced by test().

44 {
45  if (os_) *os_ << "testIdentifiable()\n";
46 
47  Identifiable a, b;
48  a.id="id1";
49  a.name="a_name";
50  b = a;
51 
53  if (diff && os_) *os_ << diff_string<TextWriter>(diff) << endl;
54  unit_assert(!diff);
55 
56  b.id="id2";
57  b.name="b_name";
58 
59  diff(a, b);
60  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
62 
63  //
64  // test handling for ids which often differ only
65  // by a trailing version number
66  //
67  b=a;
68  a.id += "_1.2.3";
69  b.id += "_1.2.4";
70  DiffConfig config;
71  Diff<Identifiable, DiffConfig> diff0(config);
72  diff0(a, b);
73  if (os_) *os_ << diff_string<TextWriter>(diff0) << endl;
74  unit_assert(diff0);
75 
76  config.ignoreVersions = true;
77  Diff<Identifiable, DiffConfig> diff1(config);
78  diff1(a, b);
79  if (os_) *os_ << diff_string<TextWriter>(diff1) << endl;
80  unit_assert(!diff1);
81 
82  a.id += "x"; // no longer looks like one of our version strings
83  Diff<Identifiable, DiffConfig> diff2(config);
84  diff2(a, b);
85  if (os_) *os_ << diff_string<TextWriter>(diff2) << endl;
86  unit_assert(diff2);
87 
88 }
Parent class representing extensions of the IdentifiableType from the mzIdentML schema.
Definition: IdentData.hpp:64
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
#define unit_assert(x)
Definition: unit.hpp:85

§ testFragmentArray()

void testFragmentArray ( )

Definition at line 90 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, diff(), pwiz::identdata::FragmentArray::measurePtr, os_, unit_assert, unit_assert_equal, and pwiz::identdata::FragmentArray::values.

Referenced by test().

91 {
92  if (os_) *os_ << "testFragmentArray()\n";
93 
94  FragmentArray a, b;
95 
96  a.values.push_back(1.0);
97  a.measurePtr = MeasurePtr(new Measure("Measure_ref"));
98  b = a;
99 
101  unit_assert(!diff);
102  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
103 
104  a.values.push_back(2.1);
105  b.values.push_back(2.0);
106  b.measurePtr = MeasurePtr(new Measure("fer_erusaeM"));
107  diff(a, b);
108 
109  // a diff was found
110  unit_assert(diff);
111 
112  // the values of the diff are correct
113  unit_assert(diff.a_b.values.size() == 2);
114  unit_assert_equal(0.0, diff.a_b.values[0], 1e-6);
115  unit_assert_equal(0.1, diff.a_b.values[1], 1e-6);
116  unit_assert(diff.b_a.values.size() == 2);
117  unit_assert_equal(0.0, diff.b_a.values[0], 1e-6);
118  unit_assert_equal(-0.1, diff.b_a.values[1], 1e-6);
119 
120  unit_assert(diff.a_b.measurePtr.get());
121  unit_assert(diff.a_b.measurePtr->id == "Measure_ref");
122  unit_assert(diff.b_a.measurePtr.get());
123  unit_assert(diff.b_a.measurePtr->id == "fer_erusaeM");
124 
125  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
126 }
Implementation of MeasureType from the mzIdentML schema.
Definition: IdentData.hpp:573
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
#define unit_assert_equal(x, y, epsilon)
Definition: unit.hpp:99
std::vector< double > values
Definition: IdentData.hpp:591
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
Implementation of FragmentArrayType from the mzIdentML schema.
Definition: IdentData.hpp:589
#define unit_assert(x)
Definition: unit.hpp:85

§ testIonType()

void testIonType ( )

Definition at line 128 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::identdata::IonType::charge, pwiz::data::CVParam::cvid, diff(), epsilon, pwiz::identdata::IonType::fragmentArray, pwiz::identdata::IonType::index, MS_frag__a_ion, MS_frag__z_ion, os_, unit_assert, and unit_assert_equal.

Referenced by test().

129 {
130  if (os_) *os_ << "testIonType()\n";
131 
132  IonType a, b;
133  a.index.push_back(1);
134  a.charge = 1;
135  a.cvid = MS_frag__a_ion;
136  a.fragmentArray.push_back(FragmentArrayPtr(new FragmentArray));
137 
138  b = a;
139 
141  unit_assert(!diff);
142  if (os_ && diff) *os_ << diff_string<TextWriter>(diff) << endl;
143 
144  b.index.back() = 2;
145  b.charge = 2;
146  b.cvid = MS_frag__z_ion;
147  b.fragmentArray.push_back(FragmentArrayPtr(new FragmentArray));
148  b.fragmentArray.back()->measurePtr = MeasurePtr(new Measure("Graduated_cylinder"));
149  diff(a, b);
150 
151  // a diff was found
152  unit_assert(diff);
153  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
154 
155  // and correctly
156  unit_assert(diff.a_b.index.size() == 1);
157  unit_assert(diff.b_a.index.size() == 1);
158  unit_assert_equal(*diff.a_b.index.begin(), 1.0, epsilon);
159  unit_assert_equal(*diff.b_a.index.begin(), 2.0, epsilon);
160  unit_assert_equal(diff.a_b.charge, 1.0, epsilon);
161  unit_assert_equal(diff.b_a.charge, 2.0, epsilon);
162  unit_assert(diff.a_b.cvid == MS_frag__a_ion);
163  unit_assert(diff.b_a.cvid == MS_frag__z_ion);
164  unit_assert(diff.b_a.fragmentArray.size() == 1);
165  unit_assert(diff.b_a.fragmentArray.back()->measurePtr.get());
166  unit_assert(diff.b_a.fragmentArray.back()->measurePtr->id == "Graduated_cylinder");
167 }
Implementation of MeasureType from the mzIdentML schema.
Definition: IdentData.hpp:573
const double epsilon
Definition: DiffTest.cpp:41
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
#define unit_assert_equal(x, y, epsilon)
Definition: unit.hpp:99
MS_frag__z_ion
frag: z ion: Fragmentation information, type of product: z ion.
Definition: cv.hpp:3970
void diff(const string &filename1, const string &filename2)
MS_frag__a_ion
frag: a ion: Fragmentation information, type of product: a ion.
Definition: cv.hpp:3967
ostream * os_
Definition: DiffTest.cpp:40
Implementation of IonTypeType from the mzIdentML schema.
Definition: IdentData.hpp:607
std::vector< int > index
Definition: IdentData.hpp:611
Implementation of FragmentArrayType from the mzIdentML schema.
Definition: IdentData.hpp:589
std::vector< FragmentArrayPtr > fragmentArray
Definition: IdentData.hpp:613
#define unit_assert(x)
Definition: unit.hpp:85

§ testMeasure()

void testMeasure ( )

Definition at line 170 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::data::ParamContainer::cvParams, diff(), pwiz::data::ParamContainer::hasCVParam(), MS_product_ion_intensity, MS_product_ion_m_z, os_, pwiz::data::ParamContainer::set(), and unit_assert.

Referenced by test(), and testSpectrumIdentificationList().

171 {
172  if (os_) *os_ << "testMeasure()\n";
173 
174  Measure a, b;
175  a.set(MS_product_ion_m_z, 200);
176  b = a;
177 
179  unit_assert(!diff);
180 
182 
183  diff(a, b);
184  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
185 
186  // diff was found
187  unit_assert(diff);
188 
189  // and correctly
190  unit_assert(diff.a_b.cvParams.size() == 0);
191  unit_assert(diff.b_a.cvParams.size() == 1);
192  unit_assert(diff.b_a.hasCVParam(MS_product_ion_intensity));
193 }
MS_product_ion_intensity
product ion intensity: The intensity of a single product ion.
Definition: cv.hpp:3955
Implementation of MeasureType from the mzIdentML schema.
Definition: IdentData.hpp:573
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
MS_product_ion_m_z
product ion m/z: The m/z of the product ion.
Definition: cv.hpp:3949
#define unit_assert(x)
Definition: unit.hpp:85

§ testSearchModification()

void testSearchModification ( )

Definition at line 195 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::data::ParamContainer::cvParams, diff(), epsilon, pwiz::identdata::SearchModification::massDelta, os_, pwiz::identdata::SearchModification::residues, pwiz::data::ParamContainer::set(), UNIMOD_Gln__pyro_Glu, UNIMOD_Oxidation, unit_assert, and unit_assert_equal.

Referenced by test().

196 {
197  if (os_) *os_ << "testSearchModification()\n";
198 
199  SearchModification a, b;
200 
201  a.massDelta = 1;
202  a.residues.push_back('A');
203  a.residues.push_back('B');
205  b = a;
206 
208  unit_assert(!diff);
209 
210  b.massDelta = 10;
211  b.residues.push_back('C');
212  b.cvParams.clear();
214 
215  diff(a, b);
216  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
217 
218  // diff was found
219  unit_assert(diff);
220 
221  // and correctly
222  unit_assert_equal(diff.a_b.massDelta, 9, epsilon);
223  unit_assert_equal(diff.b_a.massDelta, 9, epsilon);
224  unit_assert(diff.a_b.residues.empty());
225  unit_assert(diff.b_a.residues.size() == 1 && diff.b_a.residues[0] == 'C');
226  unit_assert(!diff.a_b.cvParams.empty());
227  unit_assert(diff.a_b.cvParams[0].cvid == UNIMOD_Gln__pyro_Glu);
228  unit_assert(!diff.b_a.cvParams.empty());
229  unit_assert(diff.b_a.cvParams[0].cvid == UNIMOD_Oxidation);
230 }
const double epsilon
Definition: DiffTest.cpp:41
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
#define unit_assert_equal(x, y, epsilon)
Definition: unit.hpp:99
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
std::vector< CVParam > cvParams
a collection of controlled vocabulary terms
Definition: ParamTypes.hpp:250
Implementation of SearchModificationType from the mzIdentML schema.
Definition: IdentData.hpp:388
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
UNIMOD_Gln__pyro_Glu
Gln->pyro-Glu: Pyro-glu from Q.
Definition: cv.hpp:8485
UNIMOD_Oxidation
Oxidation: Oxidation or Hydroxylation.
Definition: cv.hpp:8500
#define unit_assert(x)
Definition: unit.hpp:85

§ testPeptideEvidence()

void testPeptideEvidence ( )

Definition at line 233 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::data::ParamContainer::cvParams, pwiz::identdata::PeptideEvidence::dbSequencePtr, diff(), pwiz::identdata::PeptideEvidence::end, epsilon, pwiz::identdata::PeptideEvidence::frame, pwiz::data::ParamContainer::hasCVParam(), pwiz::identdata::PeptideEvidence::isDecoy, MS_Mascot_expectation_value, MS_Mascot_score, os_, pwiz::identdata::PeptideEvidence::post, pwiz::identdata::PeptideEvidence::pre, pwiz::data::ParamContainer::set(), pwiz::identdata::PeptideEvidence::start, pwiz::identdata::PeptideEvidence::translationTablePtr, unit_assert, and unit_assert_equal.

Referenced by test().

234 {
235  if (os_) *os_ << "testPeptideEvidence()\n";
236 
237  PeptideEvidence a, b;
238 
240  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
241  unit_assert(!diff);
242 
243  a.dbSequencePtr = DBSequencePtr(new DBSequence("DBSequence_ref"));
244  a.start = 1;
245  a.end = 6;
246  a.pre = '-';
247  a.post = '-';
248  a.translationTablePtr = TranslationTablePtr(new TranslationTable("TranslationTable_ref"));
249  a.frame = 0;
250  a.isDecoy = true;
251  a.set(MS_Mascot_score, 15.71);
252  b = a;
253 
254  diff(a,b);
255  unit_assert(!diff);
256 
257  b.dbSequencePtr = DBSequencePtr(new DBSequence("fer_ecneuqeSBD"));
258  b.start = 2;
259  b.end = 7;
260  b.pre = 'A';
261  b.post = 'A';
262  b.translationTablePtr = TranslationTablePtr(new TranslationTable("fer_elbaTnoitalsnarT"));
263  b.frame = 1;
264  b.isDecoy = false;
265  b.set(MS_Mascot_expectation_value, 0.0268534444565851);
266 
267  diff(a, b);
268  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
269 
270  // a diff was found
271  unit_assert(diff);
272 
273  // and correctly
274  unit_assert(diff.a_b.dbSequencePtr.get());
275  unit_assert(diff.a_b.dbSequencePtr->id == "DBSequence_ref");
276  unit_assert(diff.b_a.dbSequencePtr.get());
277  unit_assert(diff.b_a.dbSequencePtr->id == "fer_ecneuqeSBD");
278  unit_assert(diff.a_b.translationTablePtr.get());
279  unit_assert(diff.a_b.translationTablePtr->id == "TranslationTable_ref");
280  unit_assert(diff.b_a.translationTablePtr.get());
281  unit_assert(diff.b_a.translationTablePtr->id == "fer_elbaTnoitalsnarT");
282  unit_assert_equal(diff.a_b.start, 1.0, epsilon);
283  unit_assert_equal(diff.b_a.start, 2.0, epsilon);
284  unit_assert_equal(diff.a_b.end, 6.0, epsilon);
285  unit_assert_equal(diff.b_a.end, 7.0, epsilon);
286  unit_assert(diff.a_b.pre == '-');
287  unit_assert(diff.b_a.pre == 'A');
288  unit_assert(diff.a_b.post == '-');
289  unit_assert(diff.b_a.post == 'A');
290  unit_assert_equal(diff.a_b.frame, 0.0, epsilon);
291  unit_assert_equal(diff.b_a.frame, 1.0, epsilon);
292  unit_assert(diff.a_b.isDecoy == true);
293  unit_assert(diff.b_a.isDecoy == false);
294  unit_assert(diff.a_b.cvParams.size() == 0);
295  unit_assert(diff.b_a.cvParams.size() == 1);
297 
298 }
Implementation of PeptideEvidenceType from the mzIdentML schema.
Definition: IdentData.hpp:626
Implementation of TranslationTableType from the mzIdentML schema.
Definition: IdentData.hpp:517
const double epsilon
Definition: DiffTest.cpp:41
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
MS_Mascot_score
Mascot:score: The Mascot result &#39;Score&#39;.
Definition: cv.hpp:3820
#define unit_assert_equal(x, y, epsilon)
Definition: unit.hpp:99
TranslationTablePtr translationTablePtr
Definition: IdentData.hpp:637
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
MS_Mascot_expectation_value
Mascot:expectation value: The Mascot result &#39;expectation value&#39;.
Definition: cv.hpp:3823
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
Implementation of DBSequenceType from the mzIdentML schema.
Definition: IdentData.hpp:296
#define unit_assert(x)
Definition: unit.hpp:85

§ testProteinAmbiguityGroup()

void testProteinAmbiguityGroup ( )

Definition at line 301 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::data::ParamContainer::cvParams, diff(), pwiz::data::ParamContainer::hasCVParam(), MS_Mascot_expectation_value, MS_Mascot_score, os_, pwiz::identdata::ProteinAmbiguityGroup::proteinDetectionHypothesis, pwiz::data::ParamContainer::set(), and unit_assert.

Referenced by test().

302 {
303  if (os_) *os_ << "testProteinAmbiguityGroup()\n";
304 
306 
307  a.proteinDetectionHypothesis.push_back(ProteinDetectionHypothesisPtr(new ProteinDetectionHypothesis));
308  a.proteinDetectionHypothesis.back()->dbSequencePtr = DBSequencePtr(new DBSequence("DBSequence_ref"));
309  a.set(MS_Mascot_score, 164.4);
310  b = a;
311 
313  unit_assert(!diff);
314 
315  b.proteinDetectionHypothesis.clear();
316  b.set(MS_Mascot_expectation_value, 0.0268534444565851);
317 
318  diff(a, b);
319  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
320 
321  // a diff was found
322  unit_assert(diff);
323 
324  // and correctly
325  unit_assert(diff.a_b.proteinDetectionHypothesis.size() == 1);
326  unit_assert(diff.b_a.proteinDetectionHypothesis.size() == 0);
327  unit_assert(diff.a_b.proteinDetectionHypothesis.back()->dbSequencePtr->id == "DBSequence_ref");
328  unit_assert(diff.a_b.cvParams.size() == 0);
329  unit_assert(diff.b_a.cvParams.size() == 1);
330  unit_assert(diff.b_a.hasCVParam(MS_Mascot_expectation_value)); // TODO check vals also?
331 
332 }
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
MS_Mascot_score
Mascot:score: The Mascot result &#39;Score&#39;.
Definition: cv.hpp:3820
Implementation of ProteinDetectionHypothesisType from the mzIdentML schema.
Definition: IdentData.hpp:819
void diff(const string &filename1, const string &filename2)
Implementation of ProteinAmbiguityGroupType from the mzIdentML schema.
Definition: IdentData.hpp:839
ostream * os_
Definition: DiffTest.cpp:40
MS_Mascot_expectation_value
Mascot:expectation value: The Mascot result &#39;expectation value&#39;.
Definition: cv.hpp:3823
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
std::vector< ProteinDetectionHypothesisPtr > proteinDetectionHypothesis
Definition: IdentData.hpp:844
Implementation of DBSequenceType from the mzIdentML schema.
Definition: IdentData.hpp:296
#define unit_assert(x)
Definition: unit.hpp:85

§ testPeptideHypothesis()

void testPeptideHypothesis ( )

Definition at line 335 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, diff(), os_, pwiz::identdata::PeptideHypothesis::peptideEvidencePtr, pwiz::identdata::PeptideHypothesis::spectrumIdentificationItemPtr, and unit_assert.

336 {
337  if (os_) *os_ << "testPeptideHypothesis()\n";
338 
339  PeptideHypothesis a, b;
341  unit_assert(!diff);
342 
343  a.peptideEvidencePtr = PeptideEvidencePtr(new PeptideEvidence("pe_a"));
344  a.spectrumIdentificationItemPtr.push_back(SpectrumIdentificationItemPtr(new SpectrumIdentificationItem("sii_a")));
345  b.peptideEvidencePtr = PeptideEvidencePtr(new PeptideEvidence("pe_b"));
346  b.spectrumIdentificationItemPtr.push_back(SpectrumIdentificationItemPtr(new SpectrumIdentificationItem("sii_b")));
347 
348  diff(a,b);
349  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
350 
351  // a diff was found
352  unit_assert(diff);
353 
354  // and correctly
355  unit_assert(diff.a_b.peptideEvidencePtr.get());
356  unit_assert(diff.a_b.peptideEvidencePtr->id =="pe_a");
357  unit_assert(diff.b_a.peptideEvidencePtr.get());
358  unit_assert(diff.b_a.peptideEvidencePtr->id == "pe_b");
359  unit_assert(diff.a_b.spectrumIdentificationItemPtr.size() == 1);
360  unit_assert(diff.a_b.spectrumIdentificationItemPtr.back()->id =="sii_a");
361  unit_assert(diff.b_a.spectrumIdentificationItemPtr.size() == 1);
362  unit_assert(diff.b_a.spectrumIdentificationItemPtr.back()->id == "sii_b");
363 }
std::vector< SpectrumIdentificationItemPtr > spectrumIdentificationItemPtr
Definition: IdentData.hpp:809
Implementation of PeptideEvidenceType from the mzIdentML schema.
Definition: IdentData.hpp:626
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
Implementation of PeptideHypothesisType from the mzIdentML schema.
Definition: IdentData.hpp:806
PeptideEvidencePtr peptideEvidencePtr
Definition: IdentData.hpp:808
#define unit_assert(x)
Definition: unit.hpp:85
Implementation of SpectrumIdentificationItemType from the mzIdentML schema.
Definition: IdentData.hpp:669

§ testProteinDetectionHypothesis()

void testProteinDetectionHypothesis ( )

Definition at line 366 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::data::ParamContainer::cvParams, pwiz::identdata::ProteinDetectionHypothesis::dbSequencePtr, diff(), pwiz::data::ParamContainer::hasCVParam(), MS_Mascot_expectation_value, os_, pwiz::identdata::ProteinDetectionHypothesis::passThreshold, pwiz::identdata::ProteinDetectionHypothesis::peptideHypothesis, pwiz::data::ParamContainer::set(), and unit_assert.

Referenced by test().

367 {
368  if (os_) *os_ << "testProteinDetectionHypothesis()\n";
369 
372  unit_assert(!diff);
373 
374  a.dbSequencePtr = DBSequencePtr(new DBSequence("DBSequence_ref"));
375  b.dbSequencePtr = DBSequencePtr(new DBSequence("fer_ecneuqeSBD"));
376  a.passThreshold = true;
377  b.passThreshold = false;
378  a.peptideHypothesis.push_back(PeptideHypothesis());
379  b.peptideHypothesis.push_back(PeptideHypothesis());
380 
381  a.peptideHypothesis.back().peptideEvidencePtr = PeptideEvidencePtr(new PeptideEvidence("pe_a"));
382  a.peptideHypothesis.back().spectrumIdentificationItemPtr.push_back(SpectrumIdentificationItemPtr(new SpectrumIdentificationItem("sii_a")));
383  b.peptideHypothesis.back().peptideEvidencePtr = PeptideEvidencePtr(new PeptideEvidence("pe_b"));
384  b.peptideHypothesis.back().spectrumIdentificationItemPtr.push_back(SpectrumIdentificationItemPtr(new SpectrumIdentificationItem("sii_b")));
385 
387 
388  diff(a,b);
389  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
390 
391  // a diff was found
392  unit_assert(diff);
393 
394  // and correctly
395  unit_assert(diff.a_b.dbSequencePtr.get());
396  unit_assert(diff.a_b.dbSequencePtr->id =="DBSequence_ref");
397  unit_assert(diff.b_a.dbSequencePtr.get());
398  unit_assert(diff.b_a.dbSequencePtr->id == "fer_ecneuqeSBD");
399  unit_assert(diff.a_b.passThreshold == true);
400  unit_assert(diff.b_a.passThreshold == false);
401  unit_assert(diff.a_b.peptideHypothesis.size() == 1);
402  unit_assert(diff.b_a.peptideHypothesis.size() == 1);
403  unit_assert(diff.a_b.peptideHypothesis.back().peptideEvidencePtr->id == "pe_a");
404  unit_assert(diff.b_a.peptideHypothesis.back().peptideEvidencePtr->id == "pe_b");
405  unit_assert(diff.a_b.peptideHypothesis.back().spectrumIdentificationItemPtr.size() == 1);
406  unit_assert(diff.a_b.peptideHypothesis.back().spectrumIdentificationItemPtr.back()->id =="sii_a");
407  unit_assert(diff.b_a.peptideHypothesis.back().spectrumIdentificationItemPtr.size() == 1);
408  unit_assert(diff.b_a.peptideHypothesis.back().spectrumIdentificationItemPtr.back()->id == "sii_b");
409  unit_assert(diff.a_b.cvParams.size() == 1);
410  unit_assert(diff.b_a.cvParams.size() == 0);
412 
413 }
Implementation of PeptideEvidenceType from the mzIdentML schema.
Definition: IdentData.hpp:626
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
Implementation of ProteinDetectionHypothesisType from the mzIdentML schema.
Definition: IdentData.hpp:819
std::vector< PeptideHypothesis > peptideHypothesis
Definition: IdentData.hpp:826
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
Implementation of PeptideHypothesisType from the mzIdentML schema.
Definition: IdentData.hpp:806
MS_Mascot_expectation_value
Mascot:expectation value: The Mascot result &#39;expectation value&#39;.
Definition: cv.hpp:3823
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
Implementation of DBSequenceType from the mzIdentML schema.
Definition: IdentData.hpp:296
#define unit_assert(x)
Definition: unit.hpp:85
Implementation of SpectrumIdentificationItemType from the mzIdentML schema.
Definition: IdentData.hpp:669

§ testSpectrumIdentificationList()

void testSpectrumIdentificationList ( )

Definition at line 415 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, diff(), epsilon, pwiz::identdata::SpectrumIdentificationList::fragmentationTable, MS_Mascot_expectation_value, pwiz::identdata::SpectrumIdentificationList::numSequencesSearched, os_, pwiz::identdata::SpectrumIdentificationList::spectrumIdentificationResult, testMeasure(), unit_assert, and unit_assert_equal.

Referenced by test().

416 {
417  if (os_) *os_ << "testSpectrumIdentificationList()\n";
418 
421  unit_assert(!diff);
422 
423  a.numSequencesSearched = 9;
424  b.numSequencesSearched = 5;
425 
426  MeasurePtr testMeasure(new Measure());
428  a.fragmentationTable.push_back(testMeasure);
429 
430  SpectrumIdentificationResultPtr testSIRPtr(new SpectrumIdentificationResult());
431  testSIRPtr->set(MS_Mascot_expectation_value);
432  a.spectrumIdentificationResult.push_back(testSIRPtr);
433 
434  diff(a,b);
435  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
436 
437  // a diff was found
438  unit_assert(diff);
439 
440  // and correctly
441  unit_assert_equal(diff.a_b.numSequencesSearched,9.0,epsilon);
442  unit_assert_equal(diff.b_a.numSequencesSearched,5.0,epsilon);
443  unit_assert(diff.a_b.fragmentationTable.size() == 1);
444  unit_assert(diff.b_a.fragmentationTable.size() == 0);
445  unit_assert(diff.a_b.fragmentationTable.back()->hasCVParam(MS_Mascot_expectation_value));
446  unit_assert(diff.a_b.spectrumIdentificationResult.size() == 1);
447  unit_assert(diff.b_a.spectrumIdentificationResult.size() == 0);
448  unit_assert(diff.a_b.spectrumIdentificationResult.back()->hasCVParam(MS_Mascot_expectation_value));
449 
450 }
Implementation of MeasureType from the mzIdentML schema.
Definition: IdentData.hpp:573
std::vector< SpectrumIdentificationResultPtr > spectrumIdentificationResult
Definition: IdentData.hpp:751
const double epsilon
Definition: DiffTest.cpp:41
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
#define unit_assert_equal(x, y, epsilon)
Definition: unit.hpp:99
Implementation of SpectrumIdentificationResultType from the mzIdentML schema.
Definition: IdentData.hpp:722
void testMeasure()
Definition: DiffTest.cpp:170
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
std::vector< MeasurePtr > fragmentationTable
Definition: IdentData.hpp:750
MS_Mascot_expectation_value
Mascot:expectation value: The Mascot result &#39;expectation value&#39;.
Definition: cv.hpp:3823
#define unit_assert(x)
Definition: unit.hpp:85
Implementation of SpectrumIdentificationListType from the mzIdentML schema.
Definition: IdentData.hpp:743

§ testProteinDetectionList()

void testProteinDetectionList ( )

Definition at line 453 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::data::ParamContainer::cvParams, diff(), pwiz::data::ParamContainer::hasCVParam(), MS_frag__b_ion, MS_frag__z_ion, MS_Mascot_expectation_value, os_, pwiz::identdata::ProteinDetectionList::proteinAmbiguityGroup, pwiz::data::ParamContainer::set(), and unit_assert.

Referenced by test().

454 {
455  if (os_) *os_ << "testProteinDetectionList()\n";
456 
459  unit_assert(!diff);
460 
461  a.proteinAmbiguityGroup.push_back(ProteinAmbiguityGroupPtr(new ProteinAmbiguityGroup()));
462  a.proteinAmbiguityGroup.back()->set(MS_Mascot_expectation_value, 0.0268534444565851);
463  a.set(MS_frag__z_ion);
464  b.set(MS_frag__b_ion);
465 
466  diff(a,b);
467  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
468 
469  // a diff was found
470  unit_assert(diff);
471 
472  // and correctly
473  unit_assert(diff.a_b.proteinAmbiguityGroup.size() == 1);
474  unit_assert(diff.b_a.proteinAmbiguityGroup.size() == 0);
475  unit_assert(diff.a_b.proteinAmbiguityGroup.back()->hasCVParam(MS_Mascot_expectation_value));
476  unit_assert(diff.a_b.cvParams.size() == 1);
477  unit_assert(diff.b_a.cvParams.size() == 1);
478  unit_assert(diff.a_b.hasCVParam(MS_frag__z_ion));
479  unit_assert(diff.b_a.hasCVParam(MS_frag__b_ion));
480 
481 }
MS_frag__b_ion
frag: b ion: Fragmentation information, type of product: b ion.
Definition: cv.hpp:3946
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
MS_frag__z_ion
frag: z ion: Fragmentation information, type of product: z ion.
Definition: cv.hpp:3970
void diff(const string &filename1, const string &filename2)
Implementation of ProteinAmbiguityGroupType from the mzIdentML schema.
Definition: IdentData.hpp:839
ostream * os_
Definition: DiffTest.cpp:40
Implementation of ProteinDetectionListType from the mzIdentML schema.
Definition: IdentData.hpp:855
MS_Mascot_expectation_value
Mascot:expectation value: The Mascot result &#39;expectation value&#39;.
Definition: cv.hpp:3823
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
std::vector< ProteinAmbiguityGroupPtr > proteinAmbiguityGroup
Definition: IdentData.hpp:860
#define unit_assert(x)
Definition: unit.hpp:85

§ testAnalysisData()

void testAnalysisData ( )

Definition at line 484 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, diff(), epsilon, os_, pwiz::identdata::AnalysisData::proteinDetectionListPtr, pwiz::identdata::AnalysisData::spectrumIdentificationList, unit_assert, and unit_assert_equal.

Referenced by test().

485 {
486  if (os_) *os_ << "testAnalysisData()\n";
487 
488  AnalysisData a, b;
490  unit_assert(!diff);
491 
492  a.spectrumIdentificationList.push_back(boost::shared_ptr<SpectrumIdentificationList>(new SpectrumIdentificationList()));
493  a.spectrumIdentificationList.back()->numSequencesSearched = 5;
494  b.spectrumIdentificationList.push_back(boost::shared_ptr<SpectrumIdentificationList>(new SpectrumIdentificationList()));
495  b.spectrumIdentificationList.back()->numSequencesSearched = 15;
496 
497  a.proteinDetectionListPtr = ProteinDetectionListPtr(new ProteinDetectionList("rosemary"));
498  b.proteinDetectionListPtr = ProteinDetectionListPtr(new ProteinDetectionList("sage"));
499 
500  diff(a,b);
501  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
502 
503  // a diff was found
504  unit_assert(diff);
505 
506  // and correctly
507  unit_assert(diff.a_b.spectrumIdentificationList.size() == 1);
508  unit_assert(diff.b_a.spectrumIdentificationList.size() == 1);
509  unit_assert_equal(diff.a_b.spectrumIdentificationList.back()->numSequencesSearched, 5.0, epsilon);
510  unit_assert_equal(diff.b_a.spectrumIdentificationList.back()->numSequencesSearched, 15.0, epsilon);
511  unit_assert(diff.a_b.proteinDetectionListPtr.get());
512  unit_assert(diff.b_a.proteinDetectionListPtr.get());
513  unit_assert(diff.a_b.proteinDetectionListPtr->id == "rosemary");
514  unit_assert(diff.b_a.proteinDetectionListPtr->id == "sage");
515 
516 }
const double epsilon
Definition: DiffTest.cpp:41
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
std::vector< SpectrumIdentificationListPtr > spectrumIdentificationList
Definition: IdentData.hpp:962
#define unit_assert_equal(x, y, epsilon)
Definition: unit.hpp:99
Implementation of AnalysisDataType from the mzIdentML schema.
Definition: IdentData.hpp:960
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
Implementation of ProteinDetectionListType from the mzIdentML schema.
Definition: IdentData.hpp:855
ProteinDetectionListPtr proteinDetectionListPtr
Definition: IdentData.hpp:963
#define unit_assert(x)
Definition: unit.hpp:85
Implementation of SpectrumIdentificationListType from the mzIdentML schema.
Definition: IdentData.hpp:743

§ testSearchDatabase()

void testSearchDatabase ( )

Definition at line 519 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::data::CVParam::cvid, pwiz::data::ParamContainer::cvParams, pwiz::identdata::SearchDatabase::databaseName, diff(), pwiz::data::CVParam::empty(), epsilon, pwiz::identdata::SearchDatabase::fileFormat, pwiz::data::ParamContainer::hasCVParam(), MS_frag__z_ion, pwiz::identdata::SearchDatabase::numDatabaseSequences, pwiz::identdata::SearchDatabase::numResidues, os_, pwiz::identdata::SearchDatabase::releaseDate, pwiz::data::ParamContainer::set(), unit_assert, unit_assert_equal, and pwiz::identdata::SearchDatabase::version.

Referenced by test().

520 {
521  if (os_) *os_ << "testSearchDatabase()" << endl;
522 
523  SearchDatabase a, b;
525  unit_assert(!diff);
526 
527  a.version = "1.0";
528  b.version = "1.1";
529 
530  a.releaseDate = "20090726";
531  b.releaseDate = "20090727";
532 
533  a.numDatabaseSequences = 5;
534  b.numDatabaseSequences = 15;
535 
536  a.numResidues = 3;
537  b.numResidues = 13;
538 
541 
542  diff(a,b);
543  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
544 
545  // a diff was found
546  unit_assert(diff);
547 
548  // and correctly
549  unit_assert(diff.a_b.version == "1.0");
550  unit_assert(diff.b_a.version == "1.1");
551  unit_assert(diff.a_b.releaseDate == "20090726");
552  unit_assert(diff.b_a.releaseDate == "20090727");
553  unit_assert_equal(diff.a_b.numDatabaseSequences, 5.0, epsilon);
554  unit_assert_equal(diff.b_a.numDatabaseSequences, 15.0, epsilon);
555  unit_assert_equal(diff.a_b.numResidues, 3.0, epsilon);
556  unit_assert_equal(diff.b_a.numResidues, 13.0, epsilon);
557  unit_assert(!diff.a_b.fileFormat.empty());
558  unit_assert(diff.b_a.fileFormat.empty());
559  unit_assert(diff.a_b.fileFormat.cvid == MS_frag__z_ion);
560  unit_assert(diff.a_b.databaseName.cvParams.size() == 1);
561  unit_assert(diff.b_a.databaseName.cvParams.size() == 0);
562  unit_assert(diff.a_b.databaseName.hasCVParam(MS_frag__z_ion));
563 
564 }
const double epsilon
Definition: DiffTest.cpp:41
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
#define unit_assert_equal(x, y, epsilon)
Definition: unit.hpp:99
MS_frag__z_ion
frag: z ion: Fragmentation information, type of product: z ion.
Definition: cv.hpp:3970
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
Implementation of SearchDatabaseType from the mzIdentML schema.
Definition: IdentData.hpp:270
#define unit_assert(x)
Definition: unit.hpp:85

§ testSpectraData()

void testSpectraData ( )

Definition at line 567 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::data::CVParam::cvid, diff(), pwiz::data::CVParam::empty(), pwiz::identdata::SpectraData::externalFormatDocumentation, pwiz::identdata::SpectraData::fileFormat, pwiz::identdata::SpectraData::location, MS_frag__b_ion, os_, and unit_assert.

Referenced by test().

568 {
569  if (os_) *os_ << "testSpectraData()\n" << endl;
570 
571  SpectraData a, b;
573  unit_assert(!diff);
574 
575  a.location = "mahtomedi";
576  b.location = "white_bear_lake";
577  a.externalFormatDocumentation.push_back("wikipedia");
578  b.externalFormatDocumentation.push_back("ehow");
580 
581  diff(a,b);
582  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
583 
584  // a diff was found
585  unit_assert(diff);
586 
587  // and correctly
588  unit_assert(diff.a_b.location == "mahtomedi");
589  unit_assert(diff.b_a.location == "white_bear_lake");
590  unit_assert(diff.a_b.externalFormatDocumentation.size() == 1);
591  unit_assert(diff.b_a.externalFormatDocumentation.size() == 1);
592  unit_assert(diff.a_b.externalFormatDocumentation.back() == "wikipedia");
593  unit_assert(diff.b_a.externalFormatDocumentation.back() == "ehow");
594  unit_assert(!diff.a_b.fileFormat.empty());
595  unit_assert(diff.b_a.fileFormat.empty());
596  unit_assert(diff.a_b.fileFormat.cvid == MS_frag__b_ion);
597 
598 }
MS_frag__b_ion
frag: b ion: Fragmentation information, type of product: b ion.
Definition: cv.hpp:3946
Implementation of SpectraDataType from the mzIdentML schema.
Definition: IdentData.hpp:697
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
std::vector< std::string > externalFormatDocumentation
Definition: IdentData.hpp:704
#define unit_assert(x)
Definition: unit.hpp:85

§ testSourceFile()

void testSourceFile ( )

Definition at line 601 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::data::CVParam::cvid, pwiz::data::ParamContainer::cvParams, diff(), pwiz::data::CVParam::empty(), pwiz::identdata::SourceFile::externalFormatDocumentation, pwiz::identdata::SourceFile::fileFormat, pwiz::data::ParamContainer::hasCVParam(), pwiz::identdata::SourceFile::location, MS_sample_name, MS_sample_number, MS_wolf, os_, pwiz::data::ParamContainer::set(), and unit_assert.

Referenced by test().

602 {
603  if (os_) *os_ << "testSourceFile()\n" << endl;
604 
605  SourceFile a,b;
607  unit_assert(!diff);
608 
609  a.location = "madison";
610  b.location = "middleton";
611  a.fileFormat.cvid = MS_wolf;
612  a.externalFormatDocumentation.push_back("The Idiot's Guide to External Formats");
613  b.externalFormatDocumentation.push_back("External Formats for Dummies");
615  b.set(MS_sample_name);
616 
617  diff(a,b);
618  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
619 
620  // a diff was found
621  unit_assert(diff);
622 
623  // and correctly
624  unit_assert(diff.a_b.location == "madison");
625  unit_assert(diff.b_a.location == "middleton");
626  unit_assert(!diff.a_b.fileFormat.empty());
627  unit_assert(diff.b_a.fileFormat.empty());
628  unit_assert(diff.a_b.fileFormat.cvid == MS_wolf);
629  unit_assert(diff.a_b.externalFormatDocumentation.size() == 1);
630  unit_assert(diff.b_a.externalFormatDocumentation.size() == 1);
631  unit_assert(diff.a_b.externalFormatDocumentation.back() == "The Idiot's Guide to External Formats");
632  unit_assert(diff.b_a.externalFormatDocumentation.back() == "External Formats for Dummies");
633  unit_assert(diff.a_b.cvParams.size() == 1);
634  unit_assert(diff.b_a.cvParams.size() == 1);
635  unit_assert(diff.a_b.hasCVParam(MS_sample_number));
636  unit_assert(diff.b_a.hasCVParam(MS_sample_name));
637 
638 }
MS_wolf
wolf (massWolf): A software for converting Waters raw directory format to mzXML or mzML...
Definition: cv.hpp:2071
MS_sample_name
sample name: A reference string relevant to the sample under study.
Definition: cv.hpp:106
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
void diff(const string &filename1, const string &filename2)
std::vector< std::string > externalFormatDocumentation
Definition: IdentData.hpp:928
ostream * os_
Definition: DiffTest.cpp:40
MS_sample_number
sample number: A reference number relevant to the sample under study.
Definition: cv.hpp:103
Implementation of SourceFileType from the mzIdentML schema.
Definition: IdentData.hpp:923
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
#define unit_assert(x)
Definition: unit.hpp:85

§ testInputs()

void testInputs ( )

Definition at line 641 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, diff(), epsilon, os_, pwiz::identdata::Inputs::searchDatabase, pwiz::identdata::Inputs::sourceFile, pwiz::identdata::Inputs::spectraData, unit_assert, and unit_assert_equal.

Referenced by test().

642 {
643 
644  if (os_) *os_ << "testInputs()\n";
645 
646  Inputs a, b;
648  unit_assert(!diff);
649 
650  a.sourceFile.push_back(SourceFilePtr(new SourceFile()));
651  a.sourceFile.back()->location = "Sector 9";
652 
653  a.searchDatabase.push_back(SearchDatabasePtr(new SearchDatabase()));
654  a.searchDatabase.back()->numDatabaseSequences = 100;
655 
656  a.spectraData.push_back(SpectraDataPtr(new SpectraData()));
657  a.spectraData.back()->location = "Cloud 9";
658 
659  diff(a,b);
660  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
661 
662  // a diff was found
663  unit_assert(diff);
664 
665  // and correctly
666  unit_assert(diff.a_b.sourceFile.size() == 1);
667  unit_assert(diff.b_a.sourceFile.size() == 0);
668  unit_assert(diff.a_b.sourceFile.back()->location == "Sector 9");
669  unit_assert(diff.a_b.searchDatabase.size() == 1);
670  unit_assert(diff.b_a.searchDatabase.size() == 0);
671  unit_assert_equal(diff.a_b.searchDatabase.back()->numDatabaseSequences, 100.0, epsilon);
672  unit_assert(diff.a_b.spectraData.size() == 1);
673  unit_assert(diff.b_a.spectraData.size() == 0);
674  unit_assert(diff.a_b.spectraData.back()->location == "Cloud 9");
675 
676 }
Implementation of SpectraDataType from the mzIdentML schema.
Definition: IdentData.hpp:697
const double epsilon
Definition: DiffTest.cpp:41
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
Implementation of the InputsType from the mzIdentML schema.
Definition: IdentData.hpp:943
#define unit_assert_equal(x, y, epsilon)
Definition: unit.hpp:99
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
std::vector< SourceFilePtr > sourceFile
Definition: IdentData.hpp:946
Implementation of SourceFileType from the mzIdentML schema.
Definition: IdentData.hpp:923
Implementation of SearchDatabaseType from the mzIdentML schema.
Definition: IdentData.hpp:270
std::vector< SpectraDataPtr > spectraData
Definition: IdentData.hpp:948
std::vector< SearchDatabasePtr > searchDatabase
Definition: IdentData.hpp:947
#define unit_assert(x)
Definition: unit.hpp:85
boost::shared_ptr< SourceFile > SourceFilePtr
Description of the source file, including location and type.
Definition: MSData.hpp:75

§ testEnzyme()

void testEnzyme ( )

Definition at line 679 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::identdata::Enzyme::cTermGain, pwiz::data::ParamContainer::cvParams, diff(), pwiz::identdata::Enzyme::enzymeName, pwiz::data::ParamContainer::hasCVParam(), pwiz::identdata::Identifiable::id, pwiz::identdata::Enzyme::minDistance, pwiz::identdata::Enzyme::missedCleavages, MS_Trypsin, pwiz::identdata::Enzyme::nTermGain, os_, SemiSpecific, pwiz::data::ParamContainer::set(), pwiz::identdata::Enzyme::siteRegexp, pwiz::identdata::Enzyme::terminalSpecificity, and unit_assert.

Referenced by test().

680 {
681  if (os_) *os_ << "testEnzyme()\n";
682 
683  Enzyme a,b;
685  if (diff && os_) *os_ << diff_string<TextWriter>(diff) << endl;
686  unit_assert(!diff);
687 
688  a.id = "Donald Trump";
689  b.id = "Donald Duck";
690  a.nTermGain = "y";
691  b.nTermGain = "n";
692  a.cTermGain = "y";
693  b.cTermGain = "n";
695  b.terminalSpecificity = proteome::Digestion::FullySpecific;
696  a.missedCleavages = 1;
697  b.missedCleavages = 5;
698  a.minDistance = 2;
699  b.minDistance = 4;
700  a.siteRegexp = "^";
701  b.siteRegexp = "$";
703 
704  diff(a,b);
705  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
706 
707  // a diff was found
708  unit_assert(diff);
709 
710  // and correctly
711  unit_assert(diff.a_b.id == "Donald Trump");
712  unit_assert(diff.b_a.id == "Donald Duck");
713  unit_assert(diff.a_b.nTermGain == "y");
714  unit_assert(diff.b_a.nTermGain == "n");
715  unit_assert(diff.a_b.cTermGain == "y");
716  unit_assert(diff.a_b.terminalSpecificity == proteome::Digestion::SemiSpecific);
717  unit_assert(diff.b_a.terminalSpecificity == proteome::Digestion::FullySpecific);
718  unit_assert(diff.b_a.cTermGain == "n");
719  unit_assert(diff.a_b.missedCleavages == 1);
720  unit_assert(diff.b_a.missedCleavages == 5);
721  unit_assert(diff.a_b.minDistance == 2);
722  unit_assert(diff.b_a.minDistance == 4);
723  unit_assert(diff.a_b.siteRegexp == "^");
724  unit_assert(diff.b_a.siteRegexp == "$");
725  unit_assert(diff.a_b.enzymeName.cvParams.size() == 1);
726  unit_assert(diff.b_a.enzymeName.cvParams.size() == 0);
727  unit_assert(diff.a_b.enzymeName.hasCVParam(MS_Trypsin));
728 
729 }
Implementation of EnzymeType from the mzIdentML schema.
Definition: IdentData.hpp:408
MS_Trypsin
Trypsin: Enzyme trypsin.
Definition: cv.hpp:4027
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
void diff(const string &filename1, const string &filename2)
SemiSpecific
neither termini must match digestion motif(s)
Definition: Digestion.hpp:120
ostream * os_
Definition: DiffTest.cpp:40
ParamContainer enzymeName
Definition: IdentData.hpp:420
proteome::Digestion::Specificity terminalSpecificity
Definition: IdentData.hpp:415
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
#define unit_assert(x)
Definition: unit.hpp:85

§ testEnzymes()

void testEnzymes ( )

Definition at line 732 of file DiffTest.cpp.

References diff(), pwiz::identdata::Enzymes::enzymes, pwiz::identdata::Enzymes::independent, and os_.

Referenced by test().

733 {
734  if (os_) *os_ << "testEnzymes()\n";
735 
736  Enzymes a, b;
738  if (diff && os_) *os_ << diff_string<TextWriter>(diff) << endl;
739 
740  a.independent = "indep";
741  b.enzymes.push_back(EnzymePtr(new Enzyme()));
742 }
boost::logic::tribool independent
Definition: IdentData.hpp:433
Implementation of EnzymeType from the mzIdentML schema.
Definition: IdentData.hpp:408
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
std::vector< EnzymePtr > enzymes
Definition: IdentData.hpp:435
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
Implementation of EnzymesType from the mzIdentML schema.
Definition: IdentData.hpp:431

§ testMassTable()

void testMassTable ( )

Definition at line 745 of file DiffTest.cpp.

References pwiz::identdata::MassTable::ambiguousResidue, diff(), pwiz::identdata::MassTable::id, pwiz::identdata::MassTable::msLevel, os_, pwiz::identdata::MassTable::residues, and unit_assert.

Referenced by test().

746 {
747  if (os_) *os_ << "testMassTable()\n";
748 
749  MassTable a, b;
750 
751  a.id = "id";
752  a.msLevel.push_back(1);
753 
754  ResiduePtr c(new Residue());
755  a.residues.push_back(c);
756 
757  AmbiguousResiduePtr d(new AmbiguousResidue());
758  a.ambiguousResidue.push_back(d);
759 
760  b = a;
762  unit_assert(!diff);
763 
764  b.id = "b_id";
765  diff(a, b);
766  unit_assert(diff);
767 
768  a.id = "b_id";
769  b.msLevel.push_back(2);
770  diff(a, b);
771  unit_assert(diff);
772 
773  b.msLevel.push_back(2);
774  b.residues.clear();
775  diff(a, b);
776  unit_assert(diff);
777 
778  a.residues.clear();
779  b.ambiguousResidue.clear();
780  diff(a, b);
781  unit_assert(diff);
782 }
Implementation of AmbiguousResidueType from the mzIdentML schema.
Definition: IdentData.hpp:463
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
std::vector< ResiduePtr > residues
Definition: IdentData.hpp:487
void diff(const string &filename1, const string &filename2)
Implementation of MassTableType from the mzIdentML schema.
Definition: IdentData.hpp:480
ostream * os_
Definition: DiffTest.cpp:40
std::vector< int > msLevel
Definition: IdentData.hpp:485
Implementation of ResidueType from the mzIdentML schema.
Definition: IdentData.hpp:445
#define unit_assert(x)
Definition: unit.hpp:85
std::vector< AmbiguousResiduePtr > ambiguousResidue
Definition: IdentData.hpp:488

§ testResidue()

void testResidue ( )

Definition at line 785 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::identdata::Residue::code, diff(), epsilon, pwiz::identdata::Residue::mass, os_, unit_assert, and unit_assert_equal.

Referenced by test().

786 {
787  if (os_) *os_ << "testResidue()\n";
788 
789  Residue a, b;
790 
791  a.code = 'A';
792  a.mass = 1.0;
793  b = a;
794 
796  unit_assert(!diff);
797 
798  b.code = 'C';
799  b.mass = 2.0;
800 
801  diff(a, b);
802  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
803 
804  unit_assert(diff);
805 
806  unit_assert(diff.a_b.code == 'A');
807  unit_assert(diff.b_a.code == 'C');
808  unit_assert_equal(diff.a_b.mass, 1.0, epsilon);
809  unit_assert_equal(diff.b_a.mass, 1.0, epsilon);
810 }
const double epsilon
Definition: DiffTest.cpp:41
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
#define unit_assert_equal(x, y, epsilon)
Definition: unit.hpp:99
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
Implementation of ResidueType from the mzIdentML schema.
Definition: IdentData.hpp:445
#define unit_assert(x)
Definition: unit.hpp:85

§ testAmbiguousResidue()

void testAmbiguousResidue ( )

Definition at line 813 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::identdata::AmbiguousResidue::code, pwiz::data::ParamContainer::cvParam(), diff(), MS_alternate_single_letter_codes, os_, pwiz::data::ParamContainer::set(), unit_assert, and pwiz::data::CVParam::value.

Referenced by test().

814 {
815  if (os_) *os_ << "testAmbiguousResidue()\n";
816 
817  AmbiguousResidue a, b;
818 
819  a.code = 'Z';
821  b = a;
822 
824  unit_assert(!diff);
825 
826  b.code = 'B';
828 
829  diff(a, b);
830  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
831 
832  unit_assert(diff);
833 
834  unit_assert(diff.a_b.code == 'Z');
835  unit_assert(diff.b_a.code == 'B');
836  unit_assert(diff.a_b.cvParam(MS_alternate_single_letter_codes).value == "E Q");
837  unit_assert(diff.b_a.cvParam(MS_alternate_single_letter_codes).value == "D N");
838 }
MS_alternate_single_letter_codes
alternate single letter codes: List of standard residue one letter codes which are used to replace a ...
Definition: cv.hpp:4330
Implementation of AmbiguousResidueType from the mzIdentML schema.
Definition: IdentData.hpp:463
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
#define unit_assert(x)
Definition: unit.hpp:85

§ testFilter()

void testFilter ( )

Definition at line 841 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::data::ParamContainer::clear(), diff(), pwiz::identdata::Filter::exclude, pwiz::identdata::Filter::filterType, pwiz::data::ParamContainer::hasCVParam(), pwiz::identdata::Filter::include, MS_database_filtering, MS_DB_filter_on_accession_numbers, MS_DB_filter_taxonomy, MS_DB_MW_filter, MS_DB_PI_filter, MS_translation_table, os_, pwiz::data::ParamContainer::set(), and unit_assert.

Referenced by test().

842 {
843  if (os_) *os_ << "testFilter()\n";
844 
845  Filter a, b;
846 
850  b = a;
851 
853  unit_assert(!diff);
854 
855  b.filterType.clear();
857  b.include.clear();
859  b.exclude.clear();
861 
862  diff(a, b);
863  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
864 
865  unit_assert(diff);
866 
867  unit_assert(diff.a_b.filterType.hasCVParam(MS_DB_filter_taxonomy));
868  unit_assert(diff.b_a.filterType.hasCVParam(MS_database_filtering));
869  unit_assert(diff.a_b.include.hasCVParam(MS_DB_PI_filter));
870  unit_assert(diff.b_a.include.hasCVParam(MS_DB_filter_on_accession_numbers));
871  unit_assert(diff.a_b.exclude.hasCVParam(MS_translation_table));
872  unit_assert(diff.b_a.exclude.hasCVParam(MS_DB_MW_filter));
873 }
MS_DB_MW_filter
DB MW filter: Filtering applied specifically by protein molecular weight, specified as either a range...
Definition: cv.hpp:3412
ParamContainer exclude
Definition: IdentData.hpp:505
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
MS_database_filtering
database filtering: Was there filtering used on the database.
Definition: cv.hpp:3403
ParamContainer filterType
Definition: IdentData.hpp:503
void clear()
clears the collections
Implementation of FilterType from the mzIdentML schema.
Definition: IdentData.hpp:501
void diff(const string &filename1, const string &filename2)
ParamContainer include
Definition: IdentData.hpp:504
MS_DB_PI_filter
DB PI filter: Filtering applied specifically by predicted protein isoelectric focussing point (pI)...
Definition: cv.hpp:3415
ostream * os_
Definition: DiffTest.cpp:40
MS_translation_table
translation table: The translation table used to translate the nucleotides to amino acids...
Definition: cv.hpp:3421
MS_DB_filter_taxonomy
DB filter taxonomy: A taxonomy filter was to the database search.
Definition: cv.hpp:3406
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
MS_DB_filter_on_accession_numbers
DB filter on accession numbers: Filtering applied specifically by accession number pattern...
Definition: cv.hpp:3409
#define unit_assert(x)
Definition: unit.hpp:85

§ testDatabaseTranslation()

void testDatabaseTranslation ( )

Definition at line 876 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, diff(), pwiz::identdata::DatabaseTranslation::frames, MS_translation_table, MS_translation_table_description, os_, pwiz::identdata::DatabaseTranslation::translationTable, unit_assert, and unit_assert_operator_equal.

Referenced by test().

877 {
878  if (os_) *os_ << "testDatabaseTranslation()\n";
879 
880  DatabaseTranslation a, b;
881 
882  a.frames.push_back(1);
883  a.frames.push_back(2);
884 
885  TranslationTablePtr tt(new TranslationTable("TT_1", "TT_1"));
886  tt->set(MS_translation_table, "GATTACA");
887  tt->set(MS_translation_table_description, "http://somewhere.com");
888  a.translationTable.push_back(tt);
889  b = a;
890 
892  unit_assert(!diff);
893 
894  b.translationTable.clear();
895 
896  diff(a, b);
897  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
898 
899  unit_assert(diff);
900 
901  unit_assert_operator_equal(0, diff.a_b.frames.size());
902  unit_assert_operator_equal(0, diff.b_a.frames.size());
903  unit_assert_operator_equal(1, diff.a_b.translationTable.size());
904  unit_assert_operator_equal(0, diff.b_a.translationTable.size());
905 
906  b = a;
907  b.frames.push_back(3);
908 
909  diff(a, b);
910  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
911 
912  unit_assert(diff);
913 
914  unit_assert_operator_equal(0, diff.a_b.frames.size());
915  unit_assert_operator_equal(1, diff.b_a.frames.size());
916  unit_assert_operator_equal(0, diff.a_b.translationTable.size());
917  unit_assert_operator_equal(0, diff.b_a.translationTable.size());
918 }
Implementation of TranslationTableType from the mzIdentML schema.
Definition: IdentData.hpp:517
std::vector< TranslationTablePtr > translationTable
Definition: IdentData.hpp:533
Implementation of DatabaseTranslationType from the mzIdentML schema.
Definition: IdentData.hpp:530
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
void diff(const string &filename1, const string &filename2)
#define unit_assert_operator_equal(expected, actual)
Definition: unit.hpp:92
ostream * os_
Definition: DiffTest.cpp:40
MS_translation_table
translation table: The translation table used to translate the nucleotides to amino acids...
Definition: cv.hpp:3421
MS_translation_table_description
translation table description: A URL that describes the translation table used to translate the nucle...
Definition: cv.hpp:4510
#define unit_assert(x)
Definition: unit.hpp:85

§ testSpectrumIdentificationProtocol()

void testSpectrumIdentificationProtocol ( )

Definition at line 921 of file DiffTest.cpp.

References pwiz::identdata::SpectrumIdentificationProtocol::additionalSearchParams, pwiz::identdata::SpectrumIdentificationProtocol::analysisSoftwarePtr, pwiz::data::CVParam::cvid, pwiz::identdata::SpectrumIdentificationProtocol::databaseFilters, diff(), pwiz::identdata::Enzymes::enzymes, pwiz::identdata::SpectrumIdentificationProtocol::enzymes, ralab::base::filter::filter(), pwiz::identdata::SpectrumIdentificationProtocol::fragmentTolerance, pwiz::identdata::Identifiable::id, pwiz::identdata::SpectrumIdentificationProtocol::massTable, pwiz::identdata::SpectrumIdentificationProtocol::modificationParams, MS_FileFilter, MS_ms_ms_search, MS_pmf_search, MS_search_tolerance_minus_value, MS_search_tolerance_plus_value, MS_SEQUEST_CleavesAt, pwiz::identdata::Identifiable::name, os_, pwiz::identdata::SpectrumIdentificationProtocol::parentTolerance, pwiz::identdata::SpectrumIdentificationProtocol::searchType, pwiz::data::ParamContainer::set(), pwiz::identdata::SpectrumIdentificationProtocol::threshold, and unit_assert.

Referenced by test().

922 {
923  if (os_) *os_ << "testSpectrumIdentificationProtocol()\n";
924 
925  SpectrumIdentificationProtocol a("a_id", "a_name"), b;
926 
927  a.analysisSoftwarePtr = AnalysisSoftwarePtr(new AnalysisSoftware("a_as"));
928 
929  a.searchType.cvid = MS_pmf_search;
930  a.additionalSearchParams.set(MS_SEQUEST_CleavesAt, "cleavage");
931  SearchModificationPtr smp(new SearchModification());
932  smp->fixedMod = true;
933  a.modificationParams.push_back(smp);
934  a.enzymes.enzymes.push_back(EnzymePtr(new Enzyme("a_enzyme")));
935  a.massTable.push_back(MassTablePtr(new MassTable("mt_id")));
936  a.fragmentTolerance.set(MS_search_tolerance_plus_value, 1.0);
937  a.parentTolerance.set(MS_search_tolerance_plus_value, 2.0);
938  a.threshold.set(MS_search_tolerance_minus_value, 3.0);
939  FilterPtr filter = FilterPtr(new Filter());
940  filter->filterType.set(MS_FileFilter);
941  a.databaseFilters.push_back(filter);
942  a.databaseTranslation = DatabaseTranslationPtr(new DatabaseTranslation());
943  b = a;
944 
946  unit_assert(!diff);
947 
948  b.id = "b_id";
949  b.name = "b_name";
950 
951  diff(a, b);
952  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
953 
954  // TODO debug removal - put it back
955  //unit_assert(diff);
956 
957  b.analysisSoftwarePtr = AnalysisSoftwarePtr(new AnalysisSoftware("b_as"));
958 
961  b.modificationParams.clear();
962  b.enzymes.enzymes.clear();
963  b.massTable.clear();
967  b.databaseFilters.clear();
968 
969  diff(a, b);
970  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
971 
972  unit_assert(diff);
973 }
Implementation of EnzymeType from the mzIdentML schema.
Definition: IdentData.hpp:408
Implementation of DatabaseTranslationType from the mzIdentML schema.
Definition: IdentData.hpp:530
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
MS_search_tolerance_minus_value
search tolerance minus value:
Definition: cv.hpp:4480
Implementation of FilterType from the mzIdentML schema.
Definition: IdentData.hpp:501
std::vector< EnzymePtr > enzymes
Definition: IdentData.hpp:435
void diff(const string &filename1, const string &filename2)
Implementation of MassTableType from the mzIdentML schema.
Definition: IdentData.hpp:480
MS_SEQUEST_CleavesAt
SEQUEST:CleavesAt:
Definition: cv.hpp:3364
ostream * os_
Definition: DiffTest.cpp:40
std::vector< SearchModificationPtr > modificationParams
Definition: IdentData.hpp:554
MS_search_tolerance_plus_value
search tolerance plus value:
Definition: cv.hpp:4477
Implementation of SearchModificationType from the mzIdentML schema.
Definition: IdentData.hpp:388
MS_FileFilter
FileFilter: Extracts or manipulates portions of data from peak, feature or consensus feature files...
Definition: cv.hpp:2788
Implementation of SpectrumIdentificationProtocolType from the mzIdentML schema.
Definition: IdentData.hpp:545
MS_ms_ms_search
ms-ms search: An MS2 search (with fragment ions).
Definition: cv.hpp:3556
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
Implementation of AnalysisSoftwareType from the mzIdentML schema.
Definition: IdentData.hpp:211
#define unit_assert(x)
Definition: unit.hpp:85
MS_pmf_search
pmf search: A peptide mass fingerprint search.
Definition: cv.hpp:3550
void filter(const TContainer &data, const TContainer &filter, TContainer &result, bool circular=false, uint32_t sides=2)
Applies linear convolution (filtering) to a univariate time series.
Definition: filter.hpp:112

§ testProteinDetectionProtocol()

void testProteinDetectionProtocol ( )

Definition at line 976 of file DiffTest.cpp.

References pwiz::identdata::ProteinDetectionProtocol::analysisSoftwarePtr, diff(), pwiz::identdata::Identifiable::id, MS_low_intensity_threshold, pwiz::identdata::Identifiable::name, os_, and unit_assert.

Referenced by test().

977 {
978  if (os_) *os_ << "testProteinDetectionProtocol()\n";
979 
980  ProteinDetectionProtocol a("a_id", "a_name"), b;
981 
982  a.analysisSoftwarePtr = AnalysisSoftwarePtr(new AnalysisSoftware());
983 
984  a.analysisParams.set(MS_low_intensity_threshold);
985  a.threshold.set(MS_low_intensity_threshold);
986 
987  b = a;
988 
990  unit_assert(!diff);
991 
992  b.id = "b_id";
993  b.name = "b_name";
994 
995  diff(a, b);
996  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
997 
998  //unit_assert(diff);
999 }
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
Implementation of ProteinDetectionProtocolType from the mzIdentML schema.
Definition: IdentData.hpp:786
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
Implementation of AnalysisSoftwareType from the mzIdentML schema.
Definition: IdentData.hpp:211
#define unit_assert(x)
Definition: unit.hpp:85
MS_low_intensity_threshold
low intensity threshold: Threshold below which some action is taken.
Definition: cv.hpp:2407

§ testAnalysisProtocolCollection()

void testAnalysisProtocolCollection ( )

Definition at line 1002 of file DiffTest.cpp.

References os_.

Referenced by test().

1003 {
1004  if (os_) *os_ << "testAnalysisProtocolCollection()\n";
1005 }
ostream * os_
Definition: DiffTest.cpp:40

§ testContact()

void testContact ( )

Definition at line 1008 of file DiffTest.cpp.

References diff(), pwiz::identdata::IdentifiableParamContainer::id, MS_contact_address, MS_contact_email, MS_contact_fax_number, MS_contact_phone_number, MS_contact_toll_free_phone_number, pwiz::identdata::IdentifiableParamContainer::name, os_, pwiz::data::ParamContainer::set(), and unit_assert.

Referenced by test().

1009 {
1010  if (os_) *os_ << "testContact()\n";
1011 
1012  Contact a("a_id", "a_name"), b;
1013 
1014  a.set(MS_contact_address, "address");
1015  a.set(MS_contact_phone_number, "phone");
1016  a.set(MS_contact_email, "email");
1017  a.set(MS_contact_fax_number, "fax");
1018  a.set(MS_contact_toll_free_phone_number, "tollFreePhone");
1019 
1020  b = a;
1021 
1023  unit_assert(!diff);
1024 
1025  b.id = "b_id";
1026  b.name = "b_name";
1027 
1028  diff(a, b);
1029  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
1030 
1031  unit_assert(diff);
1032 
1033  b.set(MS_contact_address, "b_address");
1034  b.set(MS_contact_phone_number, "b_phone");
1035  b.set(MS_contact_email, "b_email");
1036  b.set(MS_contact_fax_number, "b_fax");
1037  b.set(MS_contact_toll_free_phone_number, "b_tollFreePhone");
1038 
1039 
1040  diff(a, b);
1041  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
1042 
1043  unit_assert(diff);
1044 }
MS_contact_address
contact address: Postal address of the contact person or organization.
Definition: cv.hpp:2260
Implementation of ContactType from mzIdentML.
Definition: IdentData.hpp:117
MS_contact_phone_number
contact phone number: Phone number of the contact person or organization.
Definition: cv.hpp:5521
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
MS_contact_fax_number
contact fax number: Fax number for the contact person or organization.
Definition: cv.hpp:5524
MS_contact_toll_free_phone_number
contact toll-free phone number: Toll-free phone number of the contact person or organization.
Definition: cv.hpp:5527
MS_contact_email
contact email: Email address of the contact person or organization.
Definition: cv.hpp:2266
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
#define unit_assert(x)
Definition: unit.hpp:85

§ testPerson()

void testPerson ( )

Definition at line 1047 of file DiffTest.cpp.

References pwiz::identdata::Person::affiliations, diff(), pwiz::identdata::Person::firstName, pwiz::identdata::Person::lastName, pwiz::identdata::Person::midInitials, os_, and unit_assert.

Referenced by test().

1048 {
1049  if (os_) *os_ << "testPerson()\n";
1050 
1051  Person a, b;
1052 
1053  a.lastName = "last";
1054  a.firstName = "first";
1055  a.midInitials = "mi";
1056 
1057  a.affiliations.push_back(OrganizationPtr(new Organization("org")));
1058 
1059  b = a;
1061  unit_assert(!diff);
1062 
1063  b.lastName = "smith";
1064  diff(a, b);
1065  unit_assert(diff);
1066 
1067  a.lastName = "smith";
1068  b.firstName = "john";
1069  diff(a, b);
1070  unit_assert(diff);
1071 
1072  a.firstName = "john";
1073  b.midInitials = "j.j.";
1074  diff(a, b);
1075  unit_assert(diff);
1076 
1077  a.midInitials = "j.j.";
1078  b.affiliations.clear();
1079  diff(a, b);
1080  unit_assert(diff);
1081 }
std::vector< OrganizationPtr > affiliations
Definition: IdentData.hpp:161
Implementation of PersonType from the mzIdentML schema.
Definition: IdentData.hpp:152
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
Implementation of AbstractOrganizationType from the mzIdentML schema.
Definition: IdentData.hpp:135
#define unit_assert(x)
Definition: unit.hpp:85

§ testOrganization()

void testOrganization ( )

Definition at line 1084 of file DiffTest.cpp.

References os_.

Referenced by test().

1085 {
1086  if (os_) *os_ << "testOrganization()\n";
1087 }
ostream * os_
Definition: DiffTest.cpp:40

§ testBibliographicReference()

void testBibliographicReference ( )

Definition at line 1090 of file DiffTest.cpp.

References os_.

Referenced by test().

1091 {
1092  if (os_) *os_ << "testBibliographicReference()\n";
1093 }
ostream * os_
Definition: DiffTest.cpp:40

§ testProteinDetection()

void testProteinDetection ( )

Definition at line 1096 of file DiffTest.cpp.

References os_.

Referenced by test().

1097 {
1098  if (os_) *os_ << "testProteinDetection()\n";
1099 }
ostream * os_
Definition: DiffTest.cpp:40

§ testSpectrumIdentification()

void testSpectrumIdentification ( )

Definition at line 1102 of file DiffTest.cpp.

References os_.

Referenced by test().

1103 {
1104  if (os_) *os_ << "testSpectrumIdentification()\n";
1105 }
ostream * os_
Definition: DiffTest.cpp:40

§ testAnalysisCollection()

void testAnalysisCollection ( )

Definition at line 1108 of file DiffTest.cpp.

References os_.

Referenced by test().

1109 {
1110  if (os_) *os_ << "testAnalysisCollection()\n";
1111 
1112 }
ostream * os_
Definition: DiffTest.cpp:40

§ testDBSequence()

void testDBSequence ( )

Definition at line 1115 of file DiffTest.cpp.

References os_.

Referenced by test().

1116 {
1117  if (os_) *os_ << "testDBSequence()\n";
1118 }
ostream * os_
Definition: DiffTest.cpp:40

§ testModification()

void testModification ( )

Definition at line 1121 of file DiffTest.cpp.

References os_.

Referenced by test().

1122 {
1123  if (os_) *os_ << "testModification()\n";
1124 }
ostream * os_
Definition: DiffTest.cpp:40

§ testSubstitutionModification()

void testSubstitutionModification ( )

Definition at line 1127 of file DiffTest.cpp.

References os_.

Referenced by test().

1128 {
1129  if (os_) *os_ << "testSubstitutionModification()\n";
1130 }
ostream * os_
Definition: DiffTest.cpp:40

§ testPeptide()

void testPeptide ( )

Definition at line 1133 of file DiffTest.cpp.

References os_.

Referenced by test().

1134 {
1135  if (os_) *os_ << "testPeptide()\n";
1136 }
ostream * os_
Definition: DiffTest.cpp:40

§ testSequenceCollection()

void testSequenceCollection ( )

Definition at line 1139 of file DiffTest.cpp.

References os_.

Referenced by test().

1140 {
1141  if (os_) *os_ << "testSequenceCollection()\n";
1142 }
ostream * os_
Definition: DiffTest.cpp:40

§ testSampleComponent()

void testSampleComponent ( )

Definition at line 1145 of file DiffTest.cpp.

References os_.

Referenced by test().

1146 {
1147  if (os_) *os_ << "testSampleComponent()\n";
1148 }
ostream * os_
Definition: DiffTest.cpp:40

§ testSample()

void testSample ( )

Definition at line 1151 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::identdata::Sample::contactRole, pwiz::data::ParamContainer::cvParams, diff(), pwiz::data::ParamContainer::hasCVParam(), MS_role_type, MS_sample_name, os_, pwiz::data::ParamContainer::set(), and unit_assert.

Referenced by test().

1152 {
1153  if (os_) *os_ << "testSample()\n";
1154 
1155  Sample a, b;
1156 
1157  a.contactRole.push_back(ContactRolePtr(new ContactRole(MS_role_type, ContactPtr(new Person("contactPtr")))));
1158  b = a;
1159 
1161  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
1162  unit_assert(!diff);
1163 
1164  b.contactRole.back().reset(new ContactRole(MS_role_type, ContactPtr(new Person("fer_rehto"))));
1165  b.set(MS_sample_name);
1166 
1167  diff(a, b);
1168  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
1169 
1170  // a diff was found
1171  unit_assert(diff);
1172 
1173  // and correctly
1174  unit_assert(diff.a_b.cvParams.size() == 0);
1175  unit_assert(diff.b_a.cvParams.size() == 1);
1176  unit_assert(diff.a_b.contactRole.size() == 1);
1177  unit_assert(diff.b_a.contactRole.size() == 1);
1178  unit_assert(diff.a_b.contactRole.back().get());
1179  unit_assert(diff.b_a.contactRole.back().get());
1180  unit_assert(diff.a_b.contactRole.back()->contactPtr.get());
1181  unit_assert(diff.b_a.contactRole.back()->contactPtr.get());
1182  unit_assert(diff.a_b.contactRole.back()->contactPtr->id == "contactPtr");
1183  unit_assert(diff.b_a.contactRole.back()->contactPtr->id == "fer_rehto");
1184  unit_assert(diff.b_a.hasCVParam(MS_sample_name));
1185 }
MS_sample_name
sample name: A reference string relevant to the sample under study.
Definition: cv.hpp:106
Implementation of PersonType from the mzIdentML schema.
Definition: IdentData.hpp:152
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
boost::shared_ptr< Contact > ContactPtr
Definition: TraData.hpp:57
Implementation of the SampleType from the mzIdentML schema.
Definition: IdentData.hpp:195
MS_role_type
role type: Role of a Person or Organization.
Definition: cv.hpp:4066
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
Implementation of ContactRoleType from the mzIdentML schema.
Definition: IdentData.hpp:175
#define unit_assert(x)
Definition: unit.hpp:85
std::vector< ContactRolePtr > contactRole
Definition: IdentData.hpp:200

§ testSpectrumIdentificationItem()

void testSpectrumIdentificationItem ( )

Definition at line 1188 of file DiffTest.cpp.

References os_.

Referenced by test().

1189 {
1190  if (os_) *os_ << "testSpectrumIdentificationItem()\n";
1191 }
ostream * os_
Definition: DiffTest.cpp:40

§ testSpectrumIdentificationResult()

void testSpectrumIdentificationResult ( )

Definition at line 1194 of file DiffTest.cpp.

References os_.

Referenced by test().

1195 {
1196  if (os_) *os_ << "testSpectrumIdentificationResult()\n";
1197 }
ostream * os_
Definition: DiffTest.cpp:40

§ testAnalysisSampleCollection()

void testAnalysisSampleCollection ( )

Definition at line 1200 of file DiffTest.cpp.

References os_.

Referenced by test().

1201 {
1202  if (os_) *os_ << "testAnalysisSampleCollection()\n";
1203 }
ostream * os_
Definition: DiffTest.cpp:40

§ testProvider()

void testProvider ( )

Definition at line 1206 of file DiffTest.cpp.

References os_.

Referenced by test().

1207 {
1208  if (os_) *os_ << "testProvider()\n";
1209 }
ostream * os_
Definition: DiffTest.cpp:40

§ testContactRole()

void testContactRole ( )

Definition at line 1212 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::identdata::ContactRole::contactPtr, pwiz::data::CVParam::cvid, diff(), MS_software_vendor, os_, and unit_assert.

Referenced by test().

1213 {
1214  if (os_) *os_ << "testContactRole()\n";
1215 
1216  ContactRole a, b;
1217 
1218  a.contactPtr = ContactPtr(new Person("cid", "cname"));
1220 
1221  b = a;
1222 
1224  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
1225  unit_assert(!diff);
1226 
1227  b.contactPtr = ContactPtr(new Organization("cid2", "cname2"));
1228 
1229  diff(a, b);
1230 
1231  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
1232  unit_assert(diff);
1233 
1234  unit_assert(diff.b_a.contactPtr.get());
1235  unit_assert(diff.a_b.contactPtr.get());
1236  unit_assert(diff.a_b.contactPtr->id == "cid");
1237  unit_assert(diff.b_a.contactPtr->id == "cid2");
1238  unit_assert(diff.a_b.contactPtr->name == "cname");
1239  unit_assert(diff.b_a.contactPtr->name == "cname2");
1240 }
MS_software_vendor
software vendor: Software vendor role.
Definition: cv.hpp:4069
Implementation of PersonType from the mzIdentML schema.
Definition: IdentData.hpp:152
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
boost::shared_ptr< Contact > ContactPtr
Definition: TraData.hpp:57
Implementation of AbstractOrganizationType from the mzIdentML schema.
Definition: IdentData.hpp:135
Implementation of ContactRoleType from the mzIdentML schema.
Definition: IdentData.hpp:175
#define unit_assert(x)
Definition: unit.hpp:85

§ testAnalysisSoftware()

void testAnalysisSoftware ( )

Definition at line 1243 of file DiffTest.cpp.

References pwiz::identdata::AnalysisSoftware::customizations, diff(), os_, unit_assert, pwiz::identdata::AnalysisSoftware::URI, and pwiz::identdata::AnalysisSoftware::version.

Referenced by test().

1244 {
1245  if (os_) *os_ << "testAnalysisSoftware()\n";
1246 
1247  AnalysisSoftware a, b;
1248 
1250  unit_assert(!diff);
1251 
1252  // a.version
1253  a.version="version";
1254  // b.contactRole
1255  // a.softwareName
1256  // b.URI
1257  b.URI="URI";
1258  // a.customizations
1259  a.customizations="customizations";
1260 
1261  diff(a, b);
1262 }
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
Implementation of AnalysisSoftwareType from the mzIdentML schema.
Definition: IdentData.hpp:211
#define unit_assert(x)
Definition: unit.hpp:85

§ testDataCollection()

void testDataCollection ( )

Definition at line 1265 of file DiffTest.cpp.

References pwiz::identdata::DataCollection::analysisData, diff(), pwiz::identdata::DataCollection::inputs, os_, pwiz::identdata::Inputs::searchDatabase, pwiz::identdata::Inputs::sourceFile, pwiz::identdata::Inputs::spectraData, pwiz::identdata::AnalysisData::spectrumIdentificationList, and unit_assert.

Referenced by test().

1266 {
1267  if (os_) *os_ << "testDataCollection()\n";
1268 
1269  DataCollection a, b;
1271  unit_assert(!diff);
1272 
1273  // a.inputs
1274  a.inputs.sourceFile.push_back(SourceFilePtr(new SourceFile()));
1275  b.inputs.searchDatabase.push_back(SearchDatabasePtr(new SearchDatabase()));
1276  a.inputs.spectraData.push_back(SpectraDataPtr(new SpectraData()));
1277 
1278  // b.analysisData
1279  b.analysisData.spectrumIdentificationList.push_back(SpectrumIdentificationListPtr(new SpectrumIdentificationList()));
1280 
1281  diff(a, b);
1282  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
1283 
1284 }
Implementation of SpectraDataType from the mzIdentML schema.
Definition: IdentData.hpp:697
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
std::vector< SpectrumIdentificationListPtr > spectrumIdentificationList
Definition: IdentData.hpp:962
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
std::vector< SourceFilePtr > sourceFile
Definition: IdentData.hpp:946
Implementation of DataCollectionType from the mzIdentML schema.
Definition: IdentData.hpp:974
Implementation of SourceFileType from the mzIdentML schema.
Definition: IdentData.hpp:923
Implementation of SearchDatabaseType from the mzIdentML schema.
Definition: IdentData.hpp:270
std::vector< SpectraDataPtr > spectraData
Definition: IdentData.hpp:948
std::vector< SearchDatabasePtr > searchDatabase
Definition: IdentData.hpp:947
#define unit_assert(x)
Definition: unit.hpp:85
Implementation of SpectrumIdentificationListType from the mzIdentML schema.
Definition: IdentData.hpp:743
boost::shared_ptr< SourceFile > SourceFilePtr
Description of the source file, including location and type.
Definition: MSData.hpp:75

§ testIdentData()

void testIdentData ( )

Definition at line 1287 of file DiffTest.cpp.

References pwiz::data::Diff< object_type, config_type, object_result_type >::a_b, pwiz::identdata::IdentData::analysisSoftwareList, pwiz::identdata::IdentData::auditCollection, pwiz::data::Diff< object_type, config_type, object_result_type >::b_a, pwiz::identdata::IdentData::bibliographicReference, pwiz::identdata::IdentData::cvs, diff(), pwiz::identdata::examples::initializeTiny(), os_, and unit_assert.

Referenced by test().

1288 {
1289  if (os_) *os_ << "testIdentData()\n";
1290 
1291  IdentData a, b;
1292 
1295 
1297  unit_assert(!diff);
1298 
1299  a.cvs.push_back(CV());
1300  b.analysisSoftwareList.push_back(AnalysisSoftwarePtr(new AnalysisSoftware));
1301  a.auditCollection.push_back(ContactPtr(new Contact()));
1302  b.bibliographicReference.push_back(BibliographicReferencePtr(new BibliographicReference));
1303  // a.analysisSampleCollection
1304  // b.sequenceCollection
1305  // a.analysisCollection
1306  // b.analysisProtocolCollection
1307  // a.dataCollection
1308  // b.bibliographicReference
1309 
1310  diff(a, b);
1311  if (os_) *os_ << diff_string<TextWriter>(diff) << endl;
1312 
1313  unit_assert(diff);
1314 
1315  unit_assert(diff.a_b.cvs.size() == 1);
1316  unit_assert(diff.b_a.cvs.empty());
1317 }
Implementation of ContactType from mzIdentML.
Definition: IdentData.hpp:117
Calculate diffs of objects in a ProteoWizard data model hierarchy.
Definition: diff_std.hpp:142
Information about an ontology or CV source and a short &#39;lookup&#39; tag to refer to.
Definition: cv.hpp:13353
void diff(const string &filename1, const string &filename2)
ostream * os_
Definition: DiffTest.cpp:40
boost::shared_ptr< Contact > ContactPtr
Definition: TraData.hpp:57
Implementation of the MzIdentMLType from the mzIdentML schema.
Definition: IdentData.hpp:993
std::vector< BibliographicReferencePtr > bibliographicReference
Definition: IdentData.hpp:1022
std::vector< ContactPtr > auditCollection
Definition: IdentData.hpp:1010
PWIZ_API_DECL void initializeTiny(IdentData &mzid)
Implementation of AnalysisSoftwareType from the mzIdentML schema.
Definition: IdentData.hpp:211
std::vector< AnalysisSoftwarePtr > analysisSoftwareList
Definition: IdentData.hpp:1006
Implementation for the BibliographicReferenceType tag in the mzIdentML schema.
Definition: IdentData.hpp:95
#define unit_assert(x)
Definition: unit.hpp:85
std::vector< CV > cvs
Definition: IdentData.hpp:1004

§ test()

void test ( )

Definition at line 1319 of file DiffTest.cpp.

References testAmbiguousResidue(), testAnalysisCollection(), testAnalysisData(), testAnalysisProtocolCollection(), testAnalysisSampleCollection(), testAnalysisSoftware(), testBibliographicReference(), testContact(), testContactRole(), testDatabaseTranslation(), testDataCollection(), testDBSequence(), testEnzyme(), testEnzymes(), testFilter(), testFragmentArray(), testIdentData(), testIdentifiable(), testInputs(), testIonType(), testMassTable(), testMeasure(), testModification(), testOrganization(), testPeptide(), testPeptideEvidence(), testPerson(), testProteinAmbiguityGroup(), testProteinDetection(), testProteinDetectionHypothesis(), testProteinDetectionList(), testProteinDetectionProtocol(), testProvider(), testResidue(), testSample(), testSampleComponent(), testSearchDatabase(), testSearchModification(), testSequenceCollection(), testSourceFile(), testSpectraData(), testSpectrumIdentification(), testSpectrumIdentificationItem(), testSpectrumIdentificationList(), testSpectrumIdentificationProtocol(), testSpectrumIdentificationResult(), and testSubstitutionModification().

Referenced by main().

1320 {
1321  testIdentifiable();
1322  testContact();
1323  testContactRole();
1325  testIonType();
1326  testMeasure();
1333  testAnalysisData();
1335  testSpectraData();
1336  testSourceFile();
1337  testInputs();
1338  testEnzyme();
1339  testEnzymes();
1340  testMassTable();
1341  testResidue();
1343  testFilter();
1348  testPerson();
1349  testOrganization();
1354  testDBSequence();
1355  testModification();
1357  testPeptide();
1360  testSample();
1365  testProvider();
1368  testIdentData();
1369 }
void testIonType()
Definition: DiffTest.cpp:128
void testContact()
Definition: DiffTest.cpp:1008
void testSpectrumIdentificationResult()
Definition: DiffTest.cpp:1194
void testSampleComponent()
Definition: DiffTest.cpp:1145
void testBibliographicReference()
Definition: DiffTest.cpp:1090
void testDBSequence()
Definition: DiffTest.cpp:1115
void testEnzymes()
Definition: DiffTest.cpp:732
void testProvider()
Definition: DiffTest.cpp:1206
void testSearchModification()
Definition: DiffTest.cpp:195
void testDataCollection()
Definition: DiffTest.cpp:1265
void testAnalysisData()
Definition: DiffTest.cpp:484
void testSpectraData()
Definition: DiffTest.cpp:567
void testProteinAmbiguityGroup()
Definition: DiffTest.cpp:301
void testSubstitutionModification()
Definition: DiffTest.cpp:1127
void testSpectrumIdentificationItem()
Definition: DiffTest.cpp:1188
void testPeptide()
Definition: DiffTest.cpp:1133
void testAmbiguousResidue()
Definition: DiffTest.cpp:813
void testProteinDetectionProtocol()
Definition: DiffTest.cpp:976
void testContactRole()
Definition: DiffTest.cpp:1212
void testIdentData()
Definition: DiffTest.cpp:1287
void testMeasure()
Definition: DiffTest.cpp:170
void testFragmentArray()
Definition: DiffTest.cpp:90
void testAnalysisSoftware()
Definition: DiffTest.cpp:1243
void testMassTable()
Definition: DiffTest.cpp:745
void testModification()
Definition: DiffTest.cpp:1121
void testAnalysisProtocolCollection()
Definition: DiffTest.cpp:1002
void testAnalysisCollection()
Definition: DiffTest.cpp:1108
void testSample()
Definition: DiffTest.cpp:1151
void testSourceFile()
Definition: DiffTest.cpp:601
void testAnalysisSampleCollection()
Definition: DiffTest.cpp:1200
void testInputs()
Definition: DiffTest.cpp:641
void testSpectrumIdentificationProtocol()
Definition: DiffTest.cpp:921
void testPeptideEvidence()
Definition: DiffTest.cpp:233
void testFilter()
Definition: DiffTest.cpp:841
void testSequenceCollection()
Definition: DiffTest.cpp:1139
void testIdentifiable()
Definition: DiffTest.cpp:43
void testDatabaseTranslation()
Definition: DiffTest.cpp:876
void testPerson()
Definition: DiffTest.cpp:1047
void testResidue()
Definition: DiffTest.cpp:785
void testProteinDetection()
Definition: DiffTest.cpp:1096
void testSpectrumIdentification()
Definition: DiffTest.cpp:1102
void testSearchDatabase()
Definition: DiffTest.cpp:519
void testProteinDetectionHypothesis()
Definition: DiffTest.cpp:366
void testProteinDetectionList()
Definition: DiffTest.cpp:453
void testSpectrumIdentificationList()
Definition: DiffTest.cpp:415
void testOrganization()
Definition: DiffTest.cpp:1084
void testEnzyme()
Definition: DiffTest.cpp:679

§ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 1371 of file DiffTest.cpp.

References os_, test(), TEST_EPILOG, TEST_FAILED, and TEST_PROLOG_EX.

1372 {
1373  TEST_PROLOG_EX(argc, argv, "_IdentData")
1374 
1375  try
1376  {
1377  if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
1378  test();
1379  }
1380  catch (exception& e)
1381  {
1382  TEST_FAILED(e.what())
1383  }
1384  catch (...)
1385  {
1386  TEST_FAILED("Caught unknown exception.")
1387  }
1388 
1389  TEST_EPILOG
1390 }
void test()
Definition: DiffTest.cpp:1319
#define TEST_EPILOG
Definition: unit.hpp:182
ostream * os_
Definition: DiffTest.cpp:40
#define TEST_PROLOG_EX(argc, argv, suffix)
Definition: unit.hpp:157
#define TEST_FAILED(x)
Definition: unit.hpp:176

Variable Documentation

§ os_

ostream* os_ = 0

Definition at line 40 of file DiffTest.cpp.

Referenced by main(), testAmbiguousResidue(), testAnalysisCollection(), testAnalysisData(), testAnalysisProtocolCollection(), testAnalysisSampleCollection(), testAnalysisSoftware(), testBibliographicReference(), testBinaryDataArray(), testBinaryDataOnly(), testChromatogram(), testChromatogramList(), testComponent(), testComponentList(), testCompound(), testConfiguration(), testContact(), testContactRole(), testDatabaseTranslation(), testDataCollection(), testDataProcessing(), testDBSequence(), testEnzyme(), testEnzymes(), testEvidence(), testFileContent(), testFileDescription(), testFilter(), testFragmentArray(), testIdentData(), testIdentifiable(), testInputs(), testInstrument(), testInstrumentConfiguration(), testIonType(), testMassTable(), testMaxPrecisionDiff(), testMeasure(), testModification(), testMSData(), testMSDiffUpdate(), testOrganization(), testPeptide(), testPeptideEvidence(), testPeptideHypothesis(), testPerson(), testPrecursor(), testPrediction(), testProcessingMethod(), testProduct(), testProtein(), testProteinAmbiguityGroup(), testProteinDetection(), testProteinDetectionHypothesis(), testProteinDetectionList(), testProteinDetectionProtocol(), testProteinList(), testProteomeData(), testProvider(), testResidue(), testRetentionTime(), testRun(), testSample(), testSampleComponent(), testScan(), testScanList(), testScanSettings(), testSearchDatabase(), testSearchModification(), testSequenceCollection(), testSoftware(), testSource(), testSourceFile(), testSpectraData(), testSpectrum(), testSpectrumIdentification(), testSpectrumIdentificationItem(), testSpectrumIdentificationList(), testSpectrumIdentificationProtocol(), testSpectrumIdentificationResult(), testSpectrumList(), testSubstitutionModification(), testTarget(), testTraData(), testTransition(), and testValidation().

§ epsilon

const double epsilon = numeric_limits<double>::epsilon()