43 if (
os_) *
os_ <<
"testFileContent()\n";
56 if (
os_) *
os_ << diff << endl;
68 if (
os_) *
os_ <<
"testSourceFile()\n";
70 SourceFile a(
"id1",
"name1",
"location1"), b(
"id1",
"name1",
"location1");
71 a.userParams.push_back(
UserParam(
"common"));
79 if (
os_) *
os_ << diff << endl;
86 if (
os_) *
os_ <<
"testFileDescription()\n";
93 Contact contact1, contact2, contact3, contact4;
123 if (
os_) *
os_ << diff << endl;
140 if (
os_) *
os_ <<
"testSample()\n";
142 Sample a(
"id1",
"name1"), b(
"id1",
"name1");
143 a.userParams.push_back(
UserParam(
"common"));
151 if (
os_) *
os_ << diff << endl;
158 if (
os_) *
os_ <<
"testComponent()\n";
170 if (
os_) *
os_ << diff << endl;
177 if (
os_) *
os_ <<
"testSource()\n";
189 if (
os_) *
os_ << diff << endl;
196 if (
os_) *
os_ <<
"testComponentList()\n";
207 a[0].userParams.push_back(
UserParam(
"common"));
208 b[0].userParams.push_back(
UserParam(
"common"));
213 a[1].userParams.push_back(
UserParam(
"common"));
214 b[1].userParams.push_back(
UserParam(
"common"));
215 a[1].userParams.push_back(
UserParam(
"a only"));
216 b[1].userParams.push_back(
UserParam(
"b only"));
218 a[2].userParams.push_back(
UserParam(
"a only"));
219 b[2].userParams.push_back(
UserParam(
"b only"));
222 if (
os_) *
os_ << diff << endl;
229 if (
os_) *
os_ <<
"testSoftware()\n";
244 if (
os_) *
os_ << diff << endl;
276 if (
os_) *
os_ << diff << endl;
283 if (
os_) *
os_ <<
"testProcessingMethod()\n";
295 if (
os_) *
os_ << diff << endl;
300 if (
os_) *
os_ << diff << endl;
306 if (
os_) *
os_ << diff << endl;
313 if (
os_) *
os_ <<
"testDataProcessing()\n";
344 if (
os_) *
os_ << diff << endl;
351 if (
os_) *
os_ <<
"testScanSettings()\n";
366 if (
os_) *
os_ << diff << endl;
377 if (
os_) *
os_ <<
"testPrecursor()\n";
398 if (
os_) *
os_ << diff << endl;
409 if (
os_) *
os_ <<
"testProduct()\n";
423 if (
os_) *
os_ << diff << endl;
432 if (
os_) *
os_ <<
"testScan()\n";
450 if (
os_) *
os_ << diff << endl;
458 if (
os_) *
os_ <<
"testScanList()\n";
470 a.
scans.push_back(a1);
471 a.
scans.push_back(a2);
472 b.
scans.push_back(a2);
473 b.
scans.push_back(a1);
482 if (
os_) *
os_ << diff << endl;
489 if (
os_) *
os_ <<
"testBinaryDataArray()\n";
492 for (
int i=0; i<10; i++) data.push_back(i);
502 a.
data[9] = 1.00001e10;
503 b.
data[9] = 1.00000e10;
509 if (diff &&
os_) *
os_ << diff << endl;
512 b.
data[9] = 1.0002e10;
516 if (diff &&
os_) *
os_ << diff << endl;
523 if (
os_) *
os_ <<
"testSpectrum()\n";
542 if (diff) cout <<
diff;
561 if (
os_) *
os_ << diff << endl;
567 unit_assert(diff.a_b.dataProcessingPtr->id ==
"msdata 2");
575 unit_assert(diff.b_a.dataProcessingPtr->id ==
"msdata");
584 b.binaryDataArrayPtrs[0]->data.resize(6);
587 b.binaryDataArrayPtrs[0]->data[0] = 420 + 1e-12;
590 if (
os_ && diff) *
os_ << diff << endl;
593 b.binaryDataArrayPtrs[0]->data[0] += 1e-3;
595 if (
os_ && diff) *
os_ << diff << endl;
602 if (
os_) *
os_ <<
"testChromatogram()\n";
617 if (diff) cout <<
diff;
627 if (
os_ && diff) *
os_ << diff << endl;
632 if (
os_ && diff) *
os_ << diff << endl;
639 if (
os_) *
os_ <<
"testSpectrumList()\n";
644 spectrum1a->id =
"420";
647 spectrum1b->id =
"420";
649 aSimple.
spectra.push_back(spectrum1a);
650 bSimple.
spectra.push_back(spectrum1b);
665 config_ignore.ignoreDataProcessing =
true;
676 spectrum2->id =
"421";
677 aSimple.
spectra.push_back(spectrum2);
680 if (
os_) *
os_ << diff << endl;
688 spectrum3->id =
"422";
689 bSimple.
spectra.push_back(spectrum3);
692 if (
os_) *
os_ << diff << endl;
701 spectrum3->id =
"421";
706 for (
int i=0; i<10; i++)
707 b1->data[i] = b2->data[i] = i;
709 spectrum2->binaryDataArrayPtrs.push_back(b1);
710 spectrum3->binaryDataArrayPtrs.push_back(b2);
720 if (
os_) *
os_ << diffNarrow << endl;
727 if (
os_) *
os_ <<
"testChromatogramList()\n";
732 chromatogram1a->id =
"420";
735 chromatogram1b->id =
"420";
745 config_ignore.ignoreChromatograms =
true;
758 config_ignore_dp.ignoreDataProcessing =
true;
769 chromatogram2->id =
"421";
773 if (
os_) *
os_ << diff << endl;
779 if (
os_) *
os_ << diffIgnore << endl;
785 chromatogram3->id =
"422";
789 if (
os_) *
os_ << diff << endl;
801 chromatogram3->id =
"421";
806 for (
int i=0; i<10; i++)
807 b1->data[i] = b2->data[i] = i;
809 chromatogram2->binaryDataArrayPtrs.push_back(b1);
810 chromatogram3->binaryDataArrayPtrs.push_back(b2);
820 if (
os_) *
os_ << diffNarrow << endl;
830 if (
os_) *
os_ <<
"testRun()\n";
846 spectrumList1->spectra.back()->id =
"spectrum1";
851 chromatogramList1->chromatograms.back()->id =
"chromatogram1";
862 if (
os_) *
os_ << diff << endl;
890 if (
os_) *
os_ <<
"testMSData()\n";
902 a.
cvs.push_back(
CV());
913 if (
os_) *
os_ << diff << endl;
968 for (vector<BinaryDataArrayPtr>::const_iterator it=from->binaryDataArrayPtrs.begin();
969 it!=from->binaryDataArrayPtrs.end(); ++it)
973 to->binaryDataArrayPtrs.back()->data = (*it)->data;
978 to->defaultArrayLength = from->defaultArrayLength;
979 to->scanList = from->scanList;
981 to->precursors.resize(from->precursors.size());
982 for (
size_t precursorIndex=0; precursorIndex<from->precursors.size(); ++precursorIndex)
984 Precursor& precursorTo = to->precursors[precursorIndex];
985 Precursor& precursorFrom = from->precursors[precursorIndex];
996 for (vector<BinaryDataArrayPtr>::const_iterator it=from->binaryDataArrayPtrs.begin();
997 it!=from->binaryDataArrayPtrs.end(); ++it)
1001 to->binaryDataArrayPtrs.back()->data = (*it)->data;
1006 to->defaultArrayLength = from->defaultArrayLength;
1019 config.ignoreMetadata =
true;
1020 config.ignoreIdentity =
true;
1023 if (
os_ && diff_data) *
os_ << diff_data << endl;
1031 template <
typename list_type>
1034 if (list.dp.get() &&
1035 !list.dp->processingMethods.empty() &&
1047 *
os_ <<
"testMaxPrecisionDiff()\n";
1059 std::vector<double> data1;
1060 std::vector<double> data2;
1062 data1.push_back(3.0);
1063 data2.push_back(3.0000001);
1076 data1.push_back(2.0);
1077 data2.push_back(2.0001);
1082 data1.push_back(1.0);
1083 data2.push_back(1.001);
1093 if(
os_) *
os_<<diff<<endl;
1101 if(
os_) *
os_<<diff2<<endl;
1124 spa->binaryDataArrayPtrs.push_back(a);
1125 spb->binaryDataArrayPtrs.push_back(b);
1126 spc->binaryDataArrayPtrs.push_back(c);
1127 spd->binaryDataArrayPtrs.push_back(d);
1129 sls_a->spectra.push_back(spa);
1130 sls_a->spectra.push_back(spc);
1131 sls_b->spectra.push_back(spb);
1132 sls_b->spectra.push_back(spc);
1142 cpa->binaryDataArrayPtrs.push_back(a);
1143 cpb->binaryDataArrayPtrs.push_back(b);
1144 cpc->binaryDataArrayPtrs.push_back(c);
1145 cpd->binaryDataArrayPtrs.push_back(d);
1147 cls_a->chromatograms.push_back(cpa);
1148 cls_a->chromatograms.push_back(cpc);
1149 cls_b->chromatograms.push_back(cpb);
1150 cls_b->chromatograms.push_back(cpd);
1215 if(
os_) *
os_<<diff_run<<endl;
1263 if(
os_) *
os_<<
"testMSDiffUpdate()"<<endl;
1277 tiny1.
run.
id=
"superego";
1284 tiny1_s0->id =
"tiny1";
1285 tiny2_s1->id =
"tiny2";
1291 tiny1_c0->id=
"zumas";
1298 if(
os_) *
os_<<diff_changed<<endl;
1305 if(
os_) *
os_<<diff_changed_changed<<endl;
1346 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
1349 catch (exception& e)
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
std::vector< Product > products
list and descriptions of product ion information
This summarizes the different types of spectra that can be expected in the file. This is expected to ...
int main(int argc, char *argv[])
Interface for accessing chromatograms, which may be stored in memory or backed by a data file (RAW...
double getMaxPrecisionDiff(const list_type &list)
std::string id
a unique identifier for this chromatogram. It should be expected that external files may use this ide...
CVParam cvParam(CVID cvid) const
finds cvid in the container:
std::vector< SourceFilePtr > sourceFilePtrs
list and descriptions of the source files this mzML document was generated or derived from...
Description of the way in which a particular software was used.
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.
ScanList scanList
list of scans
boost::shared_ptr< Software > SoftwarePtr
boost::shared_ptr< ParamGroup > ParamGroupPtr
Scan or acquisition from original raw file used to create this peak list, as specified in sourceFile...
std::vector< InstrumentConfigurationPtr > instrumentConfigurationPtrs
list and descriptions of instrument configurations.
The method of precursor ion selection and activation.
ChromatogramListPtr chromatogramListPtr
all chromatograms for this run.
void testFileDescription()
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
void testBinaryDataArray()
void testProcessingMethod()
A component of an instrument corresponding to a source (i.e. ion source), an analyzer (i...
SoftwarePtr softwarePtr
reference to a previously defined software element.
std::vector< ChromatogramPtr > chromatograms
boost::shared_ptr< Spectrum > SpectrumPtr
boost::shared_ptr< ScanSettings > ScanSettingsPtr
std::string value
the value for the parameter, where appropriate.
MS_scan_start_time
scan start time: The time that an analyzer started a scan, relative to the start of the MS run...
Calculate diffs of objects in a ProteoWizard data model hierarchy.
std::vector< ProcessingMethod > processingMethods
description of the default peak processing method(s). This element describes the base method used in ...
std::vector< Precursor > precursors
list and descriptions of precursors to the spectrum currently being described.
#define unit_assert_equal(x, y, epsilon)
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
MS_nanoelectrospray
nanoelectrospray: Electrospray ionization at a flow rate less than ~25 nL/min. Nanoelectrospray is sy...
boost::shared_ptr< DataProcessing > DataProcessingPtr
SoftwarePtr softwarePtr
this attribute MUST reference the 'id' of the appropriate SoftwareType.
MS_Thermo_RAW_format
Thermo RAW format: Thermo Scientific RAW file format.
MS_electron_multiplier
electron multiplier: A device to amplify the current of a beam or packet of charged particles or phot...
Information about an ontology or CV source and a short 'lookup' tag to refer to.
void version(const string &v)
boost::shared_ptr< ChromatogramListSimple > ChromatogramListSimplePtr
int order
this attribute MUST be used to indicate the order in which the components are encountered from source...
size_t index
the zero-based, consecutive index of the chromatogram in the ChromatogramList.
FileDescription fileDescription
information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
FileContent fileContent
this summarizes the different types of spectra that can be expected in the file. This is expected to ...
MS_LCQ_Deca
LCQ Deca: ThermoFinnigan LCQ Deca.
std::vector< ScanSettingsPtr > scanSettingsPtrs
list with the descriptions of the acquisition settings applied prior to the start of data acquisition...
float lexical_cast(const std::string &str)
Interface for accessing spectra, which may be stored in memory or backed by a data file (RAW...
std::string id
an optional id for the mzML document. It is recommended to use LSIDs when possible.
std::string id
a unique identifier for this run.
UserParam userParam(const std::string &) const
finds UserParam with specified name
MS_filter_string
filter string: A string unique to Thermo instrument describing instrument settings for the scan...
MS_peak_intensity
peak intensity: Intensity of ions as measured by the height or area of a peak in a mass spectrum...
Component & source(size_t index)
returns the source component with ordinal <index+1>
DataProcessingPtr dataProcessingPtr
this optional attribute may reference the 'id' attribute of the appropriate dataProcessing.
void diff(const string &filename1, const string &filename2)
MS_instrument_serial_number
instrument serial number: Serial Number of the instrument.
SourceFilePtr defaultSourceFilePtr
default source file reference
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.
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
void testMaxPrecisionDiff()
size_t defaultArrayLength
default length of binary data arrays contained in this element.
Description of the default peak processing method. This element describes the base method used in the...
std::vector< UserParam > userParams
a collection of uncontrolled user terms
void testInstrumentConfiguration()
Information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
std::string spectrumID
reference to the id attribute of the spectrum from which the precursor was selected.
bool empty() const
returns true iff all members are empty or null
int order
this attributes allows a series of consecutive steps to be placed in the correct order.
A run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument...
Simple writeable in-memory implementation of ChromatogramList.
MS_m_z
m/z: Three-character symbol m/z is used to denote the quantity formed by dividing the mass of an ion ...
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument...
std::string accession
an optional accession number for the mzML document.
std::vector< Target > targets
target list (or 'inclusion list') configured prior to the run.
MS_ionization_type
ionization type: The method by which gas phase ions are generated from the sample.
std::string id
a unique identifier for this data processing that is unique across all DataProcessingTypes.
Activation activation
the type and energy level used for activation.
std::string id
a unique identifier for this acquisition setting.
std::vector< ScanWindow > scanWindows
container for a list of select windows.
std::string version
the software version.
std::vector< CVParam > cvParams
a collection of controlled vocabulary terms
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)
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
std::vector< CV > cvs
container for one or more controlled vocabulary definitions.
std::string startTimeStamp
the optional start timestamp of the run, in UT.
MS_reflectron_on
reflectron on: Reflectron is on.
Implementation of the SampleType from the mzIdentML schema.
InstrumentConfigurationPtr instrumentConfigurationPtr
this attribute MUST reference the 'id' attribute of the appropriate instrument configuration.
List with the different components used in the mass spectrometer. At least one source, one mass analyzer and one detector need to be specified.
std::vector< SourceFilePtr > sourceFilePtrs
container for a list of source file references.
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
UO_minute
minute: A time unit which is equal to 60 seconds.
std::vector< SamplePtr > samplePtrs
list and descriptions of samples.
std::vector< double > data
the binary data.
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
boost::shared_ptr< InstrumentConfiguration > InstrumentConfigurationPtr
void testDataProcessing()
std::vector< Scan > scans
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
std::vector< SelectedIon > selectedIons
this list of precursor ions that were selected.
Implementation of SourceFileType from the mzIdentML schema.
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here. Subsidiary data arrays are also both described and attached here.
#define TEST_PROLOG_EX(argc, argv, suffix)
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
std::vector< SpectrumPtr > spectra
PWIZ_API_DECL void initializeTiny(IdentData &mzid)
std::vector< SoftwarePtr > softwarePtrs
list and descriptions of software used to acquire and/or process the data in this mzML file...
Description of the acquisition settings of the instrument prior to the start of the run...
std::vector< DataProcessingPtr > dataProcessingPtrs
list and descriptions of data processing applied to this data.
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
void testBinaryDataOnly()
List and descriptions of scans.
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
MS_quadrupole_ion_trap
quadrupole ion trap: Quadrupole Ion Trap mass analyzer captures the ions in a three dimensional ion t...
SourceFilePtr sourceFilePtr
this attribute can optionally reference the 'id' of the appropriate sourceFile.
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
Component & detector(size_t index)
returns the detector component with ordinal <index+1>
boost::shared_ptr< Sample > SamplePtr
MS_reflectron_off
reflectron off: Reflectron is off.
MS_contact_name
contact name: Name of the contact person or organization.
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
SamplePtr samplePtr
this attribute MUST reference the 'id' of the appropriate sample.
void testChromatogramList()
value_type valueAs() const
templated value access with type conversion
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
std::string id
an identifier for this instrument configuration.
static const char * userParamName_MaxBinaryDataArrayDifference_
Simple writeable in-memory implementation of SpectrumList.
boost::shared_ptr< Chromatogram > ChromatogramPtr
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
represents a tag-value pair, where the tag comes from the controlled vocabulary
PWIZ_API_DECL void diff(const std::string &a, const std::string &b, std::string &a_b, std::string &b_a, const BaseDiffConfig &config)
std::string id
an identifier for this software that is unique across all SoftwareTypes.
boost::shared_ptr< SourceFile > SourceFilePtr
Description of the source file, including location and type.
InstrumentConfigurationPtr defaultInstrumentConfigurationPtr
this attribute MUST reference the 'id' of the default instrument configuration. If a scan does not re...