ProteoWizard
Functions | Variables
ReferencesTest.cpp File Reference
#include "References.hpp"
#include "pwiz/utility/misc/unit.hpp"
#include "pwiz/utility/misc/Std.hpp"
#include "pwiz/utility/minimxml/XMLWriter.hpp"

Go to the source code of this file.

Functions

void testParamContainer ()
 
void testFileDescription ()
 
void testComponentList ()
 
void testInstrumentConfiguration ()
 
void testDataProcessing ()
 
void testScanSettings ()
 
void testPrecursor ()
 
void testProduct ()
 
void testScan ()
 
void testScanList ()
 
void testBinaryDataArray ()
 
void testSpectrum ()
 
void testChromatogram ()
 
void testRun ()
 
void testMSData ()
 
void test ()
 
int main (int argc, char *argv[])
 

Variables

ostream * os_ = 0
 

Function Documentation

§ testParamContainer()

void testParamContainer ( )

Definition at line 38 of file ReferencesTest.cpp.

References MS_reflectron_off, MS_reflectron_on, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), and unit_assert.

Referenced by test().

39 {
40  if (os_) *os_ << "testParamContainer()\n";
41 
42  ParamContainer pc;
43  pc.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg1")));
44  pc.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg2")));
45 
46  MSData msd;
47  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg2")));
48  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg1")));
49  msd.paramGroupPtrs[0]->cvParams.push_back(MS_reflectron_on);
50  msd.paramGroupPtrs[1]->cvParams.push_back(MS_reflectron_off);
51 
52  unit_assert(pc.paramGroupPtrs[0]->cvParams.empty());
53  unit_assert(pc.paramGroupPtrs[1]->cvParams.empty());
54 
55  References::resolve(pc, msd);
56 
57  unit_assert(pc.paramGroupPtrs[0]->cvParams.size() == 1);
58  unit_assert(pc.paramGroupPtrs[0]->cvParams[0] == MS_reflectron_off);
59  unit_assert(pc.paramGroupPtrs[1]->cvParams.size() == 1);
60  unit_assert(pc.paramGroupPtrs[1]->cvParams[0] == MS_reflectron_on);
61 }
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
The base class for elements that may contain cvParams, userParams, or paramGroup references.
Definition: ParamTypes.hpp:244
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
MS_reflectron_on
reflectron on: Reflectron is on.
Definition: cv.hpp:475
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
MS_reflectron_off
reflectron off: Reflectron is off.
Definition: cv.hpp:472
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_

§ testFileDescription()

void testFileDescription ( )

Definition at line 64 of file ReferencesTest.cpp.

References pwiz::msdata::FileDescription::contacts, pwiz::msdata::FileDescription::fileContent, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::FileDescription::sourceFilePtrs, and unit_assert.

Referenced by test().

65 {
66  if (os_) *os_ << "testFileDescription()\n";
67 
68  FileDescription fd;
69  fd.fileContent.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg1")));
70  fd.sourceFilePtrs.push_back(SourceFilePtr(new SourceFile));
71  fd.sourceFilePtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg2")));
72  fd.sourceFilePtrs.push_back(SourceFilePtr(new SourceFile));
73  fd.sourceFilePtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg3")));
74  fd.contacts.push_back(Contact());
75  fd.contacts.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg4")));
76  fd.contacts.push_back(Contact());
77  fd.contacts.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg5")));
78 
79  MSData msd;
80  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg5")));
81  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user5"));
82  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg4")));
83  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user4"));
84  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg3")));
85  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user3"));
86  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg2")));
87  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user2"));
88  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg1")));
89  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user1"));
90 
91  References::resolve(fd, msd);
92 
93  unit_assert(!fd.fileContent.paramGroupPtrs[0]->userParams.empty() &&
94  fd.fileContent.paramGroupPtrs[0]->userParams[0].name == "user1");
95 
96  unit_assert(!fd.sourceFilePtrs[0]->paramGroupPtrs[0]->userParams.empty() &&
97  fd.sourceFilePtrs[0]->paramGroupPtrs[0]->userParams[0].name == "user2");
98 
99  unit_assert(!fd.sourceFilePtrs[1]->paramGroupPtrs[0]->userParams.empty() &&
100  fd.sourceFilePtrs[1]->paramGroupPtrs[0]->userParams[0].name == "user3");
101 
102  unit_assert(!fd.contacts[0].paramGroupPtrs[0]->userParams.empty() &&
103  fd.contacts[0].paramGroupPtrs[0]->userParams[0].name == "user4");
104 
105  unit_assert(!fd.contacts[1].paramGroupPtrs[0]->userParams.empty() &&
106  fd.contacts[1].paramGroupPtrs[0]->userParams[0].name == "user5");
107 }
Structure allowing the use of a controlled (cvParam) or uncontrolled vocabulary (userParam), or a reference to a predefined set of these in this mzML file (paramGroupRef).
Definition: MSData.hpp:79
std::vector< SourceFilePtr > sourceFilePtrs
list and descriptions of the source files this mzML document was generated or derived from...
Definition: MSData.hpp:89
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
Description of the source file, including location and type.
Definition: MSData.hpp:53
FileContent fileContent
this summarizes the different types of spectra that can be expected in the file. This is expected to ...
Definition: MSData.hpp:86
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
Information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
Definition: MSData.hpp:83
std::vector< Contact > contacts
structure allowing the use of a controlled (cvParam) or uncontrolled vocabulary (userParam), or a reference to a predefined set of these in this mzML file (paramGroupRef)
Definition: MSData.hpp:92
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_
boost::shared_ptr< SourceFile > SourceFilePtr
Description of the source file, including location and type.
Definition: MSData.hpp:75

§ testComponentList()

void testComponentList ( )

Definition at line 110 of file ReferencesTest.cpp.

References pwiz::msdata::ComponentList::analyzer(), pwiz::msdata::ComponentType_Analyzer, pwiz::msdata::ComponentType_Detector, pwiz::msdata::ComponentType_Source, pwiz::msdata::ComponentList::detector(), os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::ComponentList::source(), and unit_assert.

Referenced by test().

111 {
112  if (os_) *os_ << "testComponentList()\n";
113 
114  ComponentList componentList;
115  componentList.push_back(Component(ComponentType_Source, 1));
116  componentList.push_back(Component(ComponentType_Analyzer, 2));
117  componentList.push_back(Component(ComponentType_Detector, 3));
118  componentList.source(0).paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
119  componentList.analyzer(0).paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
120  componentList.detector(0).paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
121 
122  MSData msd;
123  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
124  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
125 
126  References::resolve(componentList, msd);
127 
128  unit_assert(!componentList.source(0).paramGroupPtrs[0]->userParams.empty());
129  unit_assert(!componentList.analyzer(0).paramGroupPtrs[0]->userParams.empty());
130  unit_assert(!componentList.detector(0).paramGroupPtrs[0]->userParams.empty());
131 }
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
A component of an instrument corresponding to a source (i.e. ion source), an analyzer (i...
Definition: MSData.hpp:130
Component & source(size_t index)
returns the source component with ordinal <index+1>
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
List with the different components used in the mass spectrometer. At least one source, one mass analyzer and one detector need to be specified.
Definition: MSData.hpp:155
Component & analyzer(size_t index)
returns the analyzer component with ordinal <index+1>
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
Component & detector(size_t index)
returns the detector component with ordinal <index+1>
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_

§ testInstrumentConfiguration()

void testInstrumentConfiguration ( )

Definition at line 134 of file ReferencesTest.cpp.

References pwiz::msdata::InstrumentConfiguration::componentList, pwiz::msdata::ComponentType_Source, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::InstrumentConfiguration::softwarePtr, pwiz::msdata::MSData::softwarePtrs, pwiz::msdata::ComponentList::source(), and unit_assert.

Referenced by test().

135 {
136  if (os_) *os_ << "testInstrumentConfiguration()\n";
137 
138  InstrumentConfiguration instrumentConfiguration;
139  instrumentConfiguration.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
140  instrumentConfiguration.componentList.push_back(Component(ComponentType_Source, 1));
141  instrumentConfiguration.componentList.source(0).paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
142  instrumentConfiguration.softwarePtr = SoftwarePtr(new Software("msdata"));
143 
144  MSData msd;
145  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
146  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
147  msd.softwarePtrs.push_back(SoftwarePtr(new Software("booger")));
148  msd.softwarePtrs.push_back(SoftwarePtr(new Software("msdata")));
149  msd.softwarePtrs[1]->version = "4.20";
150 
151  unit_assert(instrumentConfiguration.softwarePtr->version.empty());
152  unit_assert(instrumentConfiguration.paramGroupPtrs[0]->userParams.empty());
153 
154  References::resolve(instrumentConfiguration, msd);
155 
156  unit_assert(!instrumentConfiguration.paramGroupPtrs[0]->userParams.empty());
157  unit_assert(!instrumentConfiguration.componentList.source(0).paramGroupPtrs[0]->userParams.empty());
158  unit_assert(instrumentConfiguration.softwarePtr->version == "4.20");
159 }
ComponentList componentList
list with the different components used in the mass spectrometer. At least one source, one mass analyzer and one detector need to be specified.
Definition: MSData.hpp:234
boost::shared_ptr< Software > SoftwarePtr
Definition: MSData.hpp:197
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
A component of an instrument corresponding to a source (i.e. ion source), an analyzer (i...
Definition: MSData.hpp:130
SoftwarePtr softwarePtr
reference to a previously defined software element.
Definition: MSData.hpp:237
Component & source(size_t index)
returns the source component with ordinal <index+1>
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
A piece of software.
Definition: MSData.hpp:178
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
Definition: MSData.hpp:228
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
std::vector< SoftwarePtr > softwarePtrs
list and descriptions of software used to acquire and/or process the data in this mzML file...
Definition: MSData.hpp:867
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_

§ testDataProcessing()

void testDataProcessing ( )

Definition at line 162 of file ReferencesTest.cpp.

References os_, pwiz::msdata::MSData::paramGroupPtrs, pwiz::msdata::DataProcessing::processingMethods, pwiz::identdata::References::resolve(), pwiz::msdata::MSData::softwarePtrs, and unit_assert.

Referenced by test().

163 {
164  if (os_) *os_ << "testDataProcessing()\n";
165 
166  DataProcessing dataProcessing;
167  dataProcessing.processingMethods.push_back(ProcessingMethod());
168  dataProcessing.processingMethods.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
169  dataProcessing.processingMethods.back().softwarePtr = SoftwarePtr(new Software("msdata"));
170 
171  MSData msd;
172  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
173  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
174  msd.softwarePtrs.push_back(SoftwarePtr(new Software("booger")));
175  msd.softwarePtrs.push_back(SoftwarePtr(new Software("msdata")));
176  msd.softwarePtrs[1]->version = "4.20";
177 
178  unit_assert(dataProcessing.processingMethods.back().softwarePtr->version.empty());
179  unit_assert(dataProcessing.processingMethods.back().paramGroupPtrs[0]->userParams.empty());
180 
181  References::resolve(dataProcessing, msd);
182 
183  unit_assert(!dataProcessing.processingMethods.back().paramGroupPtrs[0]->userParams.empty());
184  unit_assert(dataProcessing.processingMethods.back().softwarePtr->version == "4.20");
185 }
Description of the way in which a particular software was used.
Definition: MSData.hpp:272
boost::shared_ptr< Software > SoftwarePtr
Definition: MSData.hpp:197
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
std::vector< ProcessingMethod > processingMethods
description of the default peak processing method(s). This element describes the base method used in ...
Definition: MSData.hpp:278
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
Description of the default peak processing method. This element describes the base method used in the...
Definition: MSData.hpp:253
A piece of software.
Definition: MSData.hpp:178
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
std::vector< SoftwarePtr > softwarePtrs
list and descriptions of software used to acquire and/or process the data in this mzML file...
Definition: MSData.hpp:867
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_

§ testScanSettings()

void testScanSettings ( )

Definition at line 188 of file ReferencesTest.cpp.

References pwiz::msdata::MSData::fileDescription, os_, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::FileDescription::sourceFilePtrs, pwiz::msdata::ScanSettings::sourceFilePtrs, pwiz::msdata::ScanSettings::targets, and unit_assert.

Referenced by test().

189 {
190  if (os_) *os_ << "testScanSettings()\n";
191 
192  ScanSettings scanSettings;
193  scanSettings.targets.push_back(Target());
194  scanSettings.targets.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
195  scanSettings.sourceFilePtrs.push_back(SourceFilePtr(new SourceFile("sf2")));
196  scanSettings.sourceFilePtrs.push_back(SourceFilePtr(new SourceFile("sf1")));
197 
198  MSData msd;
199  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
200  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
201  msd.fileDescription.sourceFilePtrs.push_back(SourceFilePtr(new SourceFile("sf1")));
202  msd.fileDescription.sourceFilePtrs.back()->name = "goo1.raw";
203  msd.fileDescription.sourceFilePtrs.push_back(SourceFilePtr(new SourceFile("sf2")));
204  msd.fileDescription.sourceFilePtrs.back()->name = "goo2.raw";
205 
206  unit_assert(scanSettings.targets.back().paramGroupPtrs[0]->userParams.empty());
207  unit_assert(scanSettings.sourceFilePtrs[0]->name.empty());
208  unit_assert(scanSettings.sourceFilePtrs[1]->name.empty());
209 
210  References::resolve(scanSettings, msd);
211 
212  unit_assert(!scanSettings.targets.back().paramGroupPtrs.empty());
213  unit_assert(!scanSettings.targets.back().paramGroupPtrs[0]->userParams.empty());
214  unit_assert(scanSettings.sourceFilePtrs[0]->name == "goo2.raw");
215  unit_assert(scanSettings.sourceFilePtrs[1]->name == "goo1.raw");
216 }
std::vector< SourceFilePtr > sourceFilePtrs
list and descriptions of the source files this mzML document was generated or derived from...
Definition: MSData.hpp:89
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
Description of the source file, including location and type.
Definition: MSData.hpp:53
FileDescription fileDescription
information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
Definition: MSData.hpp:858
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
std::vector< Target > targets
target list (or &#39;inclusion list&#39;) configured prior to the run.
Definition: MSData.hpp:214
std::vector< SourceFilePtr > sourceFilePtrs
container for a list of source file references.
Definition: MSData.hpp:211
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
Description of the acquisition settings of the instrument prior to the start of the run...
Definition: MSData.hpp:205
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_
boost::shared_ptr< SourceFile > SourceFilePtr
Description of the source file, including location and type.
Definition: MSData.hpp:75

§ testPrecursor()

void testPrecursor ( )

Definition at line 219 of file ReferencesTest.cpp.

References pwiz::msdata::Precursor::activation, pwiz::msdata::Precursor::isolationWindow, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::Precursor::selectedIons, and unit_assert.

Referenced by test().

220 {
221  if (os_) *os_ << "testPrecursor()\n";
222 
223  Precursor precursor;
224  precursor.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
225  precursor.selectedIons.resize(1);
226  precursor.selectedIons[0].paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
227  precursor.activation.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
228  precursor.isolationWindow.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
229 
230  MSData msd;
231  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
232  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
233 
234  unit_assert(precursor.paramGroupPtrs[0]->userParams.empty());
235  unit_assert(precursor.selectedIons[0].paramGroupPtrs[0]->userParams.empty());
236  unit_assert(precursor.activation.paramGroupPtrs[0]->userParams.empty());
237  unit_assert(precursor.isolationWindow.paramGroupPtrs[0]->userParams.empty());
238 
239  References::resolve(precursor, msd);
240 
241  unit_assert(!precursor.paramGroupPtrs[0]->userParams.empty());
242  unit_assert(!precursor.selectedIons[0].paramGroupPtrs[0]->userParams.empty());
243  unit_assert(!precursor.activation.paramGroupPtrs[0]->userParams.empty());
244  unit_assert(!precursor.isolationWindow.paramGroupPtrs[0]->userParams.empty());
245 }
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
The method of precursor ion selection and activation.
Definition: MSData.hpp:310
IsolationWindow isolationWindow
this element captures the isolation (or &#39;selection&#39;) window configured to isolate one or more precurs...
Definition: MSData.hpp:325
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
Activation activation
the type and energy level used for activation.
Definition: MSData.hpp:331
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< SelectedIon > selectedIons
this list of precursor ions that were selected.
Definition: MSData.hpp:328
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_

§ testProduct()

void testProduct ( )

Definition at line 248 of file ReferencesTest.cpp.

References pwiz::msdata::Product::isolationWindow, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), and unit_assert.

Referenced by test().

249 {
250  if (os_) *os_ << "testProduct()\n";
251 
252  Product product;
253  product.isolationWindow.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
254 
255  MSData msd;
256  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
257  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
258 
259  unit_assert(product.isolationWindow.paramGroupPtrs[0]->userParams.empty());
260 
261  References::resolve(product, msd);
262 
263  unit_assert(!product.isolationWindow.paramGroupPtrs[0]->userParams.empty());
264 }
IsolationWindow isolationWindow
this element captures the isolation (or &#39;selection&#39;) window configured to isolate one or more precurs...
Definition: MSData.hpp:349
product ion information
Definition: MSData.hpp:346
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_

§ testScan()

void testScan ( )

Definition at line 267 of file ReferencesTest.cpp.

References pwiz::msdata::Scan::instrumentConfigurationPtr, pwiz::msdata::MSData::instrumentConfigurationPtrs, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::Scan::scanWindows, and unit_assert.

Referenced by test().

268 {
269  if (os_) *os_ << "testScan()\n";
270 
271  Scan scan;
272  scan.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
274  scan.scanWindows.push_back(ScanWindow());
275  scan.scanWindows.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
276 
277  MSData msd;
278  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
279  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
280  msd.instrumentConfigurationPtrs.push_back(InstrumentConfigurationPtr(new InstrumentConfiguration("instrumentConfiguration")));
281  msd.instrumentConfigurationPtrs.back()->userParams.push_back(UserParam("user"));
282 
283  unit_assert(scan.paramGroupPtrs[0]->userParams.empty());
284  unit_assert(scan.instrumentConfigurationPtr->userParams.empty());
285  unit_assert(scan.scanWindows.back().paramGroupPtrs.back()->userParams.empty());
286 
287  References::resolve(scan, msd);
288 
289  unit_assert(!scan.paramGroupPtrs[0]->userParams.empty());
290  unit_assert(!scan.instrumentConfigurationPtr->userParams.empty());
291  unit_assert(!scan.scanWindows.back().paramGroupPtrs.back()->userParams.empty());
292 }
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
Scan or acquisition from original raw file used to create this peak list, as specified in sourceFile...
Definition: MSData.hpp:368
std::vector< InstrumentConfigurationPtr > instrumentConfigurationPtrs
list and descriptions of instrument configurations.
Definition: MSData.hpp:873
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
std::vector< ScanWindow > scanWindows
container for a list of select windows.
Definition: MSData.hpp:386
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
InstrumentConfigurationPtr instrumentConfigurationPtr
this attribute MUST reference the &#39;id&#39; attribute of the appropriate instrument configuration.
Definition: MSData.hpp:383
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
Definition: MSData.hpp:228
boost::shared_ptr< InstrumentConfiguration > InstrumentConfigurationPtr
Definition: MSData.hpp:249
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_

§ testScanList()

void testScanList ( )

Definition at line 295 of file ReferencesTest.cpp.

References os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::ScanList::scans, and unit_assert.

Referenced by test().

296 {
297  if (os_) *os_ << "testScanList()\n";
298 
299  ScanList scanList;
300  scanList.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
301 
302  scanList.scans.push_back(Scan());
303  Scan& scan = scanList.scans.back();
304  scan.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
305 
306  MSData msd;
307  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
308  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
309 
310  unit_assert(scanList.paramGroupPtrs[0]->userParams.empty());
311  unit_assert(scan.paramGroupPtrs[0]->userParams.empty());
312 
313  References::resolve(scanList, msd);
314 
315  unit_assert(!scanList.paramGroupPtrs[0]->userParams.empty());
316  unit_assert(!scan.paramGroupPtrs[0]->userParams.empty());
317 }
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
Scan or acquisition from original raw file used to create this peak list, as specified in sourceFile...
Definition: MSData.hpp:368
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
std::vector< Scan > scans
Definition: MSData.hpp:396
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
List and descriptions of scans.
Definition: MSData.hpp:394
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_

§ testBinaryDataArray()

void testBinaryDataArray ( )

Definition at line 320 of file ReferencesTest.cpp.

References pwiz::msdata::BinaryDataArray::dataProcessingPtr, pwiz::msdata::MSData::dataProcessingPtrs, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), and unit_assert.

Referenced by test().

321 {
322  if (os_) *os_ << "testBinaryDataArray()\n";
323 
324  BinaryDataArray binaryDataArray;
325  binaryDataArray.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
326  binaryDataArray.dataProcessingPtr = DataProcessingPtr(new DataProcessing("msdata"));
327 
328  MSData msd;
329  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
330  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
331  msd.dataProcessingPtrs.push_back(DataProcessingPtr(new DataProcessing("msdata")));
332  msd.dataProcessingPtrs.back()->processingMethods.push_back(ProcessingMethod());
333  msd.dataProcessingPtrs.back()->processingMethods.back().softwarePtr = SoftwarePtr(new Software("software"));
334 
335  unit_assert(binaryDataArray.paramGroupPtrs.back()->userParams.empty());
336  unit_assert(binaryDataArray.dataProcessingPtr->processingMethods.empty());
337 
338  References::resolve(binaryDataArray, msd);
339 
340  unit_assert(!binaryDataArray.paramGroupPtrs.back()->userParams.empty());
341  unit_assert(binaryDataArray.dataProcessingPtr->processingMethods.size() == 1);
342  unit_assert(binaryDataArray.dataProcessingPtr->processingMethods.back().softwarePtr.get());
343 }
Description of the way in which a particular software was used.
Definition: MSData.hpp:272
boost::shared_ptr< Software > SoftwarePtr
Definition: MSData.hpp:197
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
boost::shared_ptr< DataProcessing > DataProcessingPtr
Definition: MSData.hpp:287
DataProcessingPtr dataProcessingPtr
this optional attribute may reference the &#39;id&#39; attribute of the appropriate dataProcessing.
Definition: MSData.hpp:406
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
Description of the default peak processing method. This element describes the base method used in the...
Definition: MSData.hpp:253
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
A piece of software.
Definition: MSData.hpp:178
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
Definition: MSData.hpp:403
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
std::vector< DataProcessingPtr > dataProcessingPtrs
list and descriptions of data processing applied to this data.
Definition: MSData.hpp:876
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_

§ testSpectrum()

void testSpectrum ( )

Definition at line 346 of file ReferencesTest.cpp.

References pwiz::msdata::Spectrum::binaryDataArrayPtrs, pwiz::msdata::Spectrum::dataProcessingPtr, pwiz::msdata::MSData::dataProcessingPtrs, pwiz::msdata::MSData::fileDescription, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::msdata::Spectrum::precursors, pwiz::msdata::Spectrum::products, pwiz::identdata::References::resolve(), pwiz::msdata::Spectrum::scanList, pwiz::msdata::Spectrum::sourceFilePtr, pwiz::msdata::FileDescription::sourceFilePtrs, and unit_assert.

Referenced by test().

347 {
348  if (os_) *os_ << "testSpectrum()\n";
349 
350  Spectrum spectrum;
351  spectrum.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
352  spectrum.dataProcessingPtr = DataProcessingPtr(new DataProcessing("dp"));
353  spectrum.sourceFilePtr = SourceFilePtr(new SourceFile("sf"));
354  spectrum.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
355 
356  spectrum.scanList.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
357  spectrum.precursors.push_back(Precursor());
358  spectrum.precursors.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
359  spectrum.products.push_back(Product());
360  spectrum.products.back().isolationWindow.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
361 
362  spectrum.binaryDataArrayPtrs.push_back(BinaryDataArrayPtr(new BinaryDataArray));
363  spectrum.binaryDataArrayPtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
364 
365 
366  MSData msd;
367  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
368  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
369  msd.dataProcessingPtrs.push_back(DataProcessingPtr(new DataProcessing("dp")));
370  msd.dataProcessingPtrs.back()->processingMethods.push_back(ProcessingMethod());
371  msd.dataProcessingPtrs.back()->processingMethods.back().softwarePtr = SoftwarePtr(new Software("software"));
372  msd.fileDescription.sourceFilePtrs.push_back(SourceFilePtr(new SourceFile("sf")));
373  msd.fileDescription.sourceFilePtrs.back()->name = "goo.raw";
374 
375  unit_assert(spectrum.paramGroupPtrs.back()->userParams.empty());
376  unit_assert(spectrum.dataProcessingPtr->processingMethods.empty());
377  unit_assert(spectrum.sourceFilePtr->name.empty());
378  unit_assert(spectrum.paramGroupPtrs.back()->userParams.empty());
379  unit_assert(spectrum.scanList.paramGroupPtrs.back()->userParams.empty());
380  unit_assert(spectrum.precursors.back().paramGroupPtrs.back()->userParams.empty());
381  unit_assert(spectrum.products.back().isolationWindow.paramGroupPtrs.back()->userParams.empty());
382  unit_assert(spectrum.binaryDataArrayPtrs.back()->paramGroupPtrs.back()->userParams.empty());
383 
384  References::resolve(spectrum, msd);
385 
386  unit_assert(!spectrum.paramGroupPtrs.back()->userParams.empty());
387  unit_assert(spectrum.dataProcessingPtr->processingMethods.size() == 1);
388  unit_assert(spectrum.dataProcessingPtr->processingMethods.back().softwarePtr.get());
389  unit_assert(spectrum.sourceFilePtr->name == "goo.raw");
390  unit_assert(!spectrum.paramGroupPtrs.back()->userParams.empty());
391  unit_assert(!spectrum.scanList.paramGroupPtrs.back()->userParams.empty());
392  unit_assert(!spectrum.precursors.back().paramGroupPtrs.back()->userParams.empty());
393  unit_assert(!spectrum.products.back().isolationWindow.paramGroupPtrs.back()->userParams.empty());
394  unit_assert(!spectrum.binaryDataArrayPtrs.back()->paramGroupPtrs.back()->userParams.empty());
395 }
std::vector< Product > products
list and descriptions of product ion information
Definition: MSData.hpp:522
product ion information
Definition: MSData.hpp:346
std::vector< SourceFilePtr > sourceFilePtrs
list and descriptions of the source files this mzML document was generated or derived from...
Definition: MSData.hpp:89
Description of the way in which a particular software was used.
Definition: MSData.hpp:272
ScanList scanList
list of scans
Definition: MSData.hpp:516
boost::shared_ptr< Software > SoftwarePtr
Definition: MSData.hpp:197
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
Description of the source file, including location and type.
Definition: MSData.hpp:53
The method of precursor ion selection and activation.
Definition: MSData.hpp:310
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: MSData.hpp:525
std::vector< Precursor > precursors
list and descriptions of precursors to the spectrum currently being described.
Definition: MSData.hpp:519
boost::shared_ptr< DataProcessing > DataProcessingPtr
Definition: MSData.hpp:287
FileDescription fileDescription
information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
Definition: MSData.hpp:858
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
Description of the default peak processing method. This element describes the base method used in the...
Definition: MSData.hpp:253
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
A piece of software.
Definition: MSData.hpp:178
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
Definition: MSData.hpp:403
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
std::vector< DataProcessingPtr > dataProcessingPtrs
list and descriptions of data processing applied to this data.
Definition: MSData.hpp:876
SourceFilePtr sourceFilePtr
this attribute can optionally reference the &#39;id&#39; of the appropriate sourceFile.
Definition: MSData.hpp:513
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the &#39;id&#39; of the appropriate dataProcessing.
Definition: MSData.hpp:510
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
Definition: MSData.hpp:504
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
Definition: MSData.hpp:416
boost::shared_ptr< SourceFile > SourceFilePtr
Description of the source file, including location and type.
Definition: MSData.hpp:75

§ testChromatogram()

void testChromatogram ( )

Definition at line 398 of file ReferencesTest.cpp.

References pwiz::msdata::Chromatogram::binaryDataArrayPtrs, pwiz::msdata::Chromatogram::dataProcessingPtr, pwiz::msdata::MSData::dataProcessingPtrs, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), and unit_assert.

Referenced by test().

399 {
400  if (os_) *os_ << "testChromatogram()\n";
401 
402  Chromatogram chromatogram;
403  chromatogram.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
404  chromatogram.dataProcessingPtr = DataProcessingPtr(new DataProcessing("dp"));
405  chromatogram.binaryDataArrayPtrs.push_back(BinaryDataArrayPtr(new BinaryDataArray));
406  chromatogram.binaryDataArrayPtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
407 
408  MSData msd;
409  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
410  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
411  msd.dataProcessingPtrs.push_back(DataProcessingPtr(new DataProcessing("dp")));
412  msd.dataProcessingPtrs.back()->processingMethods.push_back(ProcessingMethod());
413  msd.dataProcessingPtrs.back()->processingMethods.back().softwarePtr = SoftwarePtr(new Software("software"));
414 
415  unit_assert(chromatogram.paramGroupPtrs.back()->userParams.empty());
416  unit_assert(chromatogram.dataProcessingPtr->processingMethods.empty());
417  unit_assert(chromatogram.binaryDataArrayPtrs.back()->paramGroupPtrs.back()->userParams.empty());
418 
419  References::resolve(chromatogram, msd);
420 
421  unit_assert(!chromatogram.paramGroupPtrs.back()->userParams.empty());
422  unit_assert(chromatogram.dataProcessingPtr->processingMethods.size() == 1);
423  unit_assert(chromatogram.dataProcessingPtr->processingMethods.back().softwarePtr.get());
424  unit_assert(!chromatogram.binaryDataArrayPtrs.back()->paramGroupPtrs.back()->userParams.empty());
425 }
Description of the way in which a particular software was used.
Definition: MSData.hpp:272
boost::shared_ptr< Software > SoftwarePtr
Definition: MSData.hpp:197
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
boost::shared_ptr< DataProcessing > DataProcessingPtr
Definition: MSData.hpp:287
A single chromatogram.
Definition: MSData.hpp:573
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
Description of the default peak processing method. This element describes the base method used in the...
Definition: MSData.hpp:253
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
A piece of software.
Definition: MSData.hpp:178
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
Definition: MSData.hpp:403
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the &#39;id&#39; of the appropriate dataProcessing.
Definition: MSData.hpp:579
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
std::vector< DataProcessingPtr > dataProcessingPtrs
list and descriptions of data processing applied to this data.
Definition: MSData.hpp:876
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: MSData.hpp:588
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
Definition: MSData.hpp:416

§ testRun()

void testRun ( )

Definition at line 428 of file ReferencesTest.cpp.

References pwiz::msdata::Run::defaultInstrumentConfigurationPtr, pwiz::msdata::Run::defaultSourceFilePtr, pwiz::msdata::MSData::fileDescription, pwiz::msdata::MSData::instrumentConfigurationPtrs, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::Run::samplePtr, pwiz::msdata::MSData::samplePtrs, pwiz::msdata::FileDescription::sourceFilePtrs, and unit_assert.

Referenced by test().

429 {
430  if (os_) *os_ << "testRun()\n";
431 
432  Run run;
433  run.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
435  run.samplePtr = SamplePtr(new Sample("sample"));
437 
438  MSData msd;
439  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
440  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
441  msd.instrumentConfigurationPtrs.push_back(InstrumentConfigurationPtr(new InstrumentConfiguration("instrumentConfiguration")));
442  msd.instrumentConfigurationPtrs.back()->userParams.push_back(UserParam("user"));
443  msd.samplePtrs.push_back(SamplePtr(new Sample("sample")));
444  msd.samplePtrs.back()->name = "sample name";
445  msd.fileDescription.sourceFilePtrs.push_back(SourceFilePtr(new SourceFile("sf1")));
446  msd.fileDescription.sourceFilePtrs.back()->name = "goo1.raw";
447  msd.fileDescription.sourceFilePtrs.push_back(SourceFilePtr(new SourceFile("sf2")));
448  msd.fileDescription.sourceFilePtrs.back()->name = "goo2.raw";
449 
450  unit_assert(run.paramGroupPtrs.back()->userParams.empty());
451  unit_assert(run.defaultInstrumentConfigurationPtr->userParams.empty());
452  unit_assert(run.samplePtr->name.empty());
453  unit_assert(run.defaultSourceFilePtr->name.empty());
454 
455  References::resolve(run, msd);
456 
457  unit_assert(!run.paramGroupPtrs.back()->userParams.empty());
458  unit_assert(!run.defaultInstrumentConfigurationPtr->userParams.empty());
459  unit_assert(run.samplePtr->name == "sample name");
460  unit_assert(run.defaultSourceFilePtr->name == "goo2.raw");
461 }
std::vector< SourceFilePtr > sourceFilePtrs
list and descriptions of the source files this mzML document was generated or derived from...
Definition: MSData.hpp:89
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
Description of the source file, including location and type.
Definition: MSData.hpp:53
std::vector< InstrumentConfigurationPtr > instrumentConfigurationPtrs
list and descriptions of instrument configurations.
Definition: MSData.hpp:873
FileDescription fileDescription
information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
Definition: MSData.hpp:858
SourceFilePtr defaultSourceFilePtr
default source file reference
Definition: MSData.hpp:820
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
A run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument...
Definition: MSData.hpp:805
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
std::vector< SamplePtr > samplePtrs
list and descriptions of samples.
Definition: MSData.hpp:864
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
Definition: MSData.hpp:228
boost::shared_ptr< InstrumentConfiguration > InstrumentConfigurationPtr
Definition: MSData.hpp:249
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
Expansible description of the sample used to generate the dataset, named in sampleName.
Definition: MSData.hpp:100
boost::shared_ptr< Sample > SamplePtr
Definition: MSData.hpp:117
SamplePtr samplePtr
this attribute MUST reference the &#39;id&#39; of the appropriate sample.
Definition: MSData.hpp:814
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_
boost::shared_ptr< SourceFile > SourceFilePtr
Description of the source file, including location and type.
Definition: MSData.hpp:75
InstrumentConfigurationPtr defaultInstrumentConfigurationPtr
this attribute MUST reference the &#39;id&#39; of the default instrument configuration. If a scan does not re...
Definition: MSData.hpp:811

§ testMSData()

void testMSData ( )

Definition at line 464 of file ReferencesTest.cpp.

References pwiz::msdata::MSData::dataProcessingPtrs, pwiz::msdata::FileDescription::fileContent, pwiz::msdata::MSData::fileDescription, pwiz::msdata::MSData::instrumentConfigurationPtrs, os_, pwiz::data::ParamContainer::paramGroupPtrs, pwiz::msdata::MSData::paramGroupPtrs, pwiz::identdata::References::resolve(), pwiz::msdata::MSData::run, pwiz::msdata::MSData::samplePtrs, and unit_assert.

Referenced by test().

465 {
466  if (os_) *os_ << "testMSData()\n";
467 
468  MSData msd;
469 
471  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
472  msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user"));
473  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg1")));
474  msd.paramGroupPtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
475  msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg2")));
476  msd.paramGroupPtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
477  msd.samplePtrs.push_back(SamplePtr(new Sample("sample")));
478  msd.samplePtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
479  msd.instrumentConfigurationPtrs.push_back(InstrumentConfigurationPtr(new InstrumentConfiguration("instrumentConfiguration")));
480  msd.instrumentConfigurationPtrs.back()->paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
481  msd.dataProcessingPtrs.push_back(DataProcessingPtr(new DataProcessing("dp")));
482  msd.dataProcessingPtrs.back()->processingMethods.push_back(ProcessingMethod());
483  msd.dataProcessingPtrs.back()->processingMethods.back().paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
484  msd.run.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg")));
485 
486  unit_assert(msd.paramGroupPtrs[1]->paramGroupPtrs.back()->userParams.empty());
487  unit_assert(msd.paramGroupPtrs[2]->paramGroupPtrs.back()->userParams.empty());
488  unit_assert(msd.samplePtrs.back()->paramGroupPtrs.back()->userParams.empty());
489  unit_assert(msd.instrumentConfigurationPtrs.back()->paramGroupPtrs.back()->userParams.empty());
490  unit_assert(msd.dataProcessingPtrs.back()->processingMethods.back().paramGroupPtrs.back()->userParams.empty());
491  unit_assert(msd.run.paramGroupPtrs.back()->userParams.empty());
492 
493  References::resolve(msd);
494 
495  unit_assert(!msd.paramGroupPtrs[1]->paramGroupPtrs.back()->userParams.empty());
496  unit_assert(!msd.paramGroupPtrs[2]->paramGroupPtrs.back()->userParams.empty());
497  unit_assert(!msd.samplePtrs.back()->paramGroupPtrs.back()->userParams.empty());
498  unit_assert(!msd.instrumentConfigurationPtrs.back()->paramGroupPtrs.back()->userParams.empty());
499  unit_assert(!msd.dataProcessingPtrs.back()->processingMethods.back().paramGroupPtrs.back()->userParams.empty());
500  unit_assert(!msd.run.paramGroupPtrs.back()->userParams.empty());
501 }
Description of the way in which a particular software was used.
Definition: MSData.hpp:272
boost::shared_ptr< ParamGroup > ParamGroupPtr
Definition: ParamTypes.hpp:239
std::vector< InstrumentConfigurationPtr > instrumentConfigurationPtrs
list and descriptions of instrument configurations.
Definition: MSData.hpp:873
boost::shared_ptr< DataProcessing > DataProcessingPtr
Definition: MSData.hpp:287
FileDescription fileDescription
information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
Definition: MSData.hpp:858
FileContent fileContent
this summarizes the different types of spectra that can be expected in the file. This is expected to ...
Definition: MSData.hpp:86
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
Description of the default peak processing method. This element describes the base method used in the...
Definition: MSData.hpp:253
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument...
Definition: MSData.hpp:882
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
std::vector< SamplePtr > samplePtrs
list and descriptions of samples.
Definition: MSData.hpp:864
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
Definition: MSData.hpp:228
boost::shared_ptr< InstrumentConfiguration > InstrumentConfigurationPtr
Definition: MSData.hpp:249
PWIZ_API_DECL void resolve(ContactRole &cr, IdentData &mzid)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
std::vector< DataProcessingPtr > dataProcessingPtrs
list and descriptions of data processing applied to this data.
Definition: MSData.hpp:876
Expansible description of the sample used to generate the dataset, named in sampleName.
Definition: MSData.hpp:100
boost::shared_ptr< Sample > SamplePtr
Definition: MSData.hpp:117
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
#define unit_assert(x)
Definition: unit.hpp:85
ostream * os_

§ test()

void test ( )

Definition at line 504 of file ReferencesTest.cpp.

References testBinaryDataArray(), testChromatogram(), testComponentList(), testDataProcessing(), testFileDescription(), testInstrumentConfiguration(), testMSData(), testParamContainer(), testPrecursor(), testProduct(), testRun(), testScan(), testScanList(), testScanSettings(), and testSpectrum().

505 {
512  testPrecursor();
513  testProduct();
514  testScan();
515  testScanList();
517  testSpectrum();
519  testRun();
520  testMSData();
521 }
void testDataProcessing()
void testInstrumentConfiguration()
void testComponentList()
void testScanList()
void testPrecursor()
void testMSData()
void testBinaryDataArray()
void testFileDescription()
void testParamContainer()
void testSpectrum()
void testScanSettings()
void testRun()
void testProduct()
void testChromatogram()
void testScan()

§ main()

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

Definition at line 524 of file ReferencesTest.cpp.

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

525 {
526  TEST_PROLOG_EX(argc, argv, "_MSData")
527 
528  try
529  {
530  if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
531  test();
532  }
533  catch (exception& e)
534  {
535  TEST_FAILED(e.what())
536  }
537  catch (...)
538  {
539  TEST_FAILED("Caught unknown exception.")
540  }
541 
543 }
#define TEST_EPILOG
Definition: unit.hpp:182
#define TEST_PROLOG_EX(argc, argv, suffix)
Definition: unit.hpp:157
#define TEST_FAILED(x)
Definition: unit.hpp:176
void test()
ostream * os_

Variable Documentation

§ os_

ostream* os_ = 0

Definition at line 35 of file ReferencesTest.cpp.