43 if (
os_) *
os_ <<
"testFileContent()\n";
68 if (
os_) *
os_ <<
"testSourceFile()\n";
70 SourceFile a(
"id1",
"name1",
"location1"), b(
"id1",
"name1",
"location1");
71 a.userParams.push_back(
UserParam(
"common"));
86 if (
os_) *
os_ <<
"testFileDescription()\n";
93 Contact contact1, contact2, contact3, contact4;
140 if (
os_) *
os_ <<
"testSample()\n";
142 Sample a(
"id1",
"name1"), b(
"id1",
"name1");
143 a.userParams.push_back(
UserParam(
"common"));
158 if (
os_) *
os_ <<
"testComponent()\n";
177 if (
os_) *
os_ <<
"testSource()\n";
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"));
229 if (
os_) *
os_ <<
"testSoftware()\n";
283 if (
os_) *
os_ <<
"testProcessingMethod()\n";
313 if (
os_) *
os_ <<
"testDataProcessing()\n";
351 if (
os_) *
os_ <<
"testScanSettings()\n";
377 if (
os_) *
os_ <<
"testPrecursor()\n";
409 if (
os_) *
os_ <<
"testProduct()\n";
432 if (
os_) *
os_ <<
"testScan()\n";
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);
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;
512 b.
data[9] = 1.0002e10;
523 if (
os_) *
os_ <<
"testSpectrum()\n";
602 if (
os_) *
os_ <<
"testChromatogram()\n";
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);
688 spectrum3->id =
"422";
689 bSimple.
spectra.push_back(spectrum3);
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";
779 if (
os_) *
os_ << diffIgnore << endl;
785 chromatogram3->id =
"422";
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";
866 unit_assert(
diff.a_b.spectrumListPtr->spectrum(0)->userParams.size() == 1);
870 unit_assert(
diff.a_b.chromatogramListPtr->chromatogram(0)->userParams.size() == 1);
890 if (
os_) *
os_ <<
"testMSData()\n";
902 a.
cvs.push_back(
CV());
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;
1031template <
typename list_type>
1034 if (list.dp.get() &&
1035 !list.dp->processingMethods.empty() &&
1047 *
os_ <<
"testMaxPrecisionDiff()\n";
1050 double epsilon = numeric_limits<double>::epsilon();
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);
1101 if(
os_) *
os_<<diff2<<endl;
1108 double maxBin_a_b=boost::lexical_cast<double>(
diff.a_b.userParam(
"Binary data array difference").value);
1109 double maxBin_b_a=boost::lexical_cast<double>(
diff.a_b.userParam(
"Binary data array difference").value);
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);
1175 double maxSpecList_a_b=boost::lexical_cast<double>(diff_run.
a_b.userParam(
"Spectrum binary data array difference").value);
1176 double maxSpecList_b_a=boost::lexical_cast<double>(diff_run.
b_a.userParam(
"Spectrum binary data array difference").value);
1178 double maxChrList_a_b=boost::lexical_cast<double>(diff_run.
a_b.userParam(
"Chromatogram binary data array difference").value);
1179 double maxChrList_b_a=boost::lexical_cast<double>(diff_run.
b_a.userParam(
"Chromatogram binary data array difference").value);
1189 unit_assert(!diff_run.
a_b.spectrumListPtr->spectrum(0)->userParams.empty());
1190 unit_assert(!diff_run.
b_a.spectrumListPtr->spectrum(0)->userParams.empty());
1194 double maxSpec_a_b=boost::lexical_cast<double>(diff_run.
a_b.spectrumListPtr->spectrum(0)->userParam(
"Binary data array difference").value);
1195 double maxSpec_b_a=boost::lexical_cast<double>(diff_run.
b_a.spectrumListPtr->spectrum(0)->userParam(
"Binary data array difference").value);
1204 unit_assert(!diff_run.
a_b.chromatogramListPtr->chromatogram(0)->userParams.empty());
1205 unit_assert(!diff_run.
b_a.chromatogramListPtr->chromatogram(0)->userParams.empty());
1209 double maxChr_a_b=boost::lexical_cast<double>(diff_run.
a_b.chromatogramListPtr->chromatogram(0)->userParam(
"Binary data array difference").value);
1210 double maxChr_b_a=boost::lexical_cast<double>(diff_run.
b_a.chromatogramListPtr->chromatogram(0)->userParam(
"Binary data array difference").value);
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)
Interface for accessing chromatograms, which may be stored in memory or backed by a data file (RAW,...
Interface for accessing spectra, which may be stored in memory or backed by a data file (RAW,...
MS_instrument_serial_number
instrument serial number: Serial Number of the instrument.
MS_Thermo_RAW_format
Thermo RAW format: Thermo Scientific RAW file format.
UO_minute
minute: A time unit which is equal to 60 seconds.
MS_quadrupole_ion_trap
quadrupole ion trap: Quadrupole Ion Trap mass analyzer captures the ions in a three dimensional ion t...
MS_reflectron_on
reflectron on: Reflectron is on.
MS_nanoelectrospray
nanoelectrospray: Electrospray ionization at a flow rate less than ~25 nL/min. Nanoelectrospray is sy...
MS_filter_string
filter string: A string unique to Thermo instrument describing instrument settings for the scan.
MS_m_z
m/z: Three-character symbol m/z is used to denote the quantity formed by dividing the mass of an ion ...
MS_scan_start_time
scan start time: The time that an analyzer started a scan, relative to the start of the MS run.
MS_LCQ_Deca
LCQ Deca: ThermoFinnigan LCQ Deca.
MS_electron_multiplier
electron multiplier: A device to amplify the current of a beam or packet of charged particles or phot...
MS_ionization_type
ionization type: The method by which gas phase ions are generated from the sample.
MS_contact_name
contact name: Name of the contact person or organization.
MS_reflectron_off
reflectron off: Reflectron is off.
MS_peak_intensity
peak intensity: Intensity of ions as measured by the height or area of a peak in a mass spectrum.
void testMaxPrecisionDiff()
int main(int argc, char *argv[])
void testProcessingMethod()
void testChromatogramList()
void testBinaryDataOnly()
double getMaxPrecisionDiff(const list_type &list)
void testFileDescription()
void testInstrumentConfiguration()
static const char * userParamName_MaxBinaryDataArrayDifference_
void testDataProcessing()
void testBinaryDataArray()
PWIZ_API_DECL void diff(const std::string &a, const std::string &b, std::string &a_b, std::string &b_a, const BaseDiffConfig &config)
boost::shared_ptr< ParamGroup > ParamGroupPtr
PWIZ_API_DECL void initializeTiny(IdentData &mzid)
boost::shared_ptr< DataProcessing > DataProcessingPtr
boost::shared_ptr< Software > SoftwarePtr
boost::shared_ptr< ScanSettings > ScanSettingsPtr
boost::shared_ptr< Sample > SamplePtr
boost::shared_ptr< Chromatogram > ChromatogramPtr
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
boost::shared_ptr< Spectrum > SpectrumPtr
boost::shared_ptr< InstrumentConfiguration > InstrumentConfigurationPtr
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
boost::shared_ptr< ChromatogramListSimple > ChromatogramListSimplePtr
boost::shared_ptr< SourceFile > SourceFilePtr
Description of the source file, including location and type.
void version(const string &v)
Information about an ontology or CV source and a short 'lookup' tag to refer to.
represents a tag-value pair, where the tag comes from the controlled vocabulary
Calculate diffs of objects in a ProteoWizard data model hierarchy.
void set(CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
set/add a CVParam (not recursive)
std::vector< CVParam > cvParams
a collection of controlled vocabulary terms
std::vector< UserParam > userParams
a collection of uncontrolled user terms
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Uncontrolled user parameters (essentially allowing free text). Before using these,...
Implementation of the SampleType from the mzIdentML schema.
Implementation of SourceFileType from the mzIdentML schema.
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
DataProcessingPtr dataProcessingPtr
this optional attribute may reference the 'id' attribute of the appropriate dataProcessing.
pwiz::util::BinaryData< double > data
the binary data.
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
std::string id
a unique identifier for this chromatogram. It should be expected that external files may use this ide...
size_t index
the zero-based, consecutive index of the chromatogram in the ChromatogramList.
Simple writeable in-memory implementation of ChromatogramList.
std::vector< ChromatogramPtr > chromatograms
A component of an instrument corresponding to a source (i.e. ion source), an analyzer (i....
int order
this attribute MUST be used to indicate the order in which the components are encountered from source...
List with the different components used in the mass spectrometer. At least one source,...
Component & detector(size_t index)
returns the detector component with ordinal <index+1>
Component & source(size_t index)
returns the source component with ordinal <index+1>
Description of the way in which a particular software was used.
std::vector< ProcessingMethod > processingMethods
description of the default peak processing method(s). This element describes the base method used in ...
std::string id
a unique identifier for this data processing that is unique across all DataProcessingTypes.
This summarizes the different types of spectra that can be expected in the file. This is expected to ...
Information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
std::vector< Contact > contacts
structure allowing the use of a controlled (cvParam) or uncontrolled vocabulary (userParam),...
FileContent fileContent
this summarizes the different types of spectra that can be expected in the file. This is expected to ...
std::vector< SourceFilePtr > sourceFilePtrs
list and descriptions of the source files this mzML document was generated or derived from.
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
ComponentList componentList
list with the different components used in the mass spectrometer. At least one source,...
std::string id
an identifier for this instrument configuration.
SoftwarePtr softwarePtr
reference to a previously defined software element.
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
std::vector< ScanSettingsPtr > scanSettingsPtrs
list with the descriptions of the acquisition settings applied prior to the start of data acquisition...
const std::string & version() const
returns the version of this mzML document; for a document created programmatically,...
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
std::vector< SoftwarePtr > softwarePtrs
list and descriptions of software used to acquire and/or process the data in this mzML file.
std::string accession
an optional accession number for the mzML document.
std::string id
an optional id for the mzML document. It is recommended to use LSIDs when possible.
FileDescription fileDescription
information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
std::vector< InstrumentConfigurationPtr > instrumentConfigurationPtrs
list and descriptions of instrument configurations.
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
std::vector< SamplePtr > samplePtrs
list and descriptions of samples.
std::vector< DataProcessingPtr > dataProcessingPtrs
list and descriptions of data processing applied to this data.
std::vector< CV > cvs
container for one or more controlled vocabulary definitions.
The method of precursor ion selection and activation.
std::vector< SelectedIon > selectedIons
this list of precursor ions that were selected.
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
Activation activation
the type and energy level used for activation.
std::string spectrumID
reference to the id attribute of the spectrum from which the precursor was selected.
Description of the default peak processing method. This element describes the base method used in the...
int order
this attributes allows a series of consecutive steps to be placed in the correct order.
SoftwarePtr softwarePtr
this attribute MUST reference the 'id' of the appropriate SoftwareType.
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
A run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
SourceFilePtr defaultSourceFilePtr
default source file reference
std::string id
a unique identifier for this run.
std::string startTimeStamp
the optional start timestamp of the run, in UT.
InstrumentConfigurationPtr defaultInstrumentConfigurationPtr
this attribute MUST reference the 'id' of the default instrument configuration. If a scan does not re...
SamplePtr samplePtr
this attribute MUST reference the 'id' of the appropriate sample.
ChromatogramListPtr chromatogramListPtr
all chromatograms for this run.
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here....
Scan or acquisition from original raw file used to create this peak list, as specified in sourceFile.
InstrumentConfigurationPtr instrumentConfigurationPtr
this attribute MUST reference the 'id' attribute of the appropriate instrument configuration.
std::vector< ScanWindow > scanWindows
container for a list of select windows.
List and descriptions of scans.
std::vector< Scan > scans
Description of the acquisition settings of the instrument prior to the start of the run.
std::vector< Target > targets
target list (or 'inclusion list') configured prior to the run.
std::string id
a unique identifier for this acquisition setting.
std::vector< SourceFilePtr > sourceFilePtrs
container for a list of source file references.
std::string id
an identifier for this software that is unique across all SoftwareTypes.
std::string version
the software version.
The structure that captures the generation of a peak list (including the underlying acquisitions)
SourceFilePtr sourceFilePtr
this attribute can optionally reference the 'id' of the appropriate sourceFile.
std::vector< Product > products
list and descriptions of product ion information
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
size_t defaultArrayLength
default length of binary data arrays contained in this element.
ScanList scanList
list of scans
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
std::vector< Precursor > precursors
list and descriptions of precursors to the spectrum currently being described.
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
Simple writeable in-memory implementation of SpectrumList.
std::vector< SpectrumPtr > spectra
#define TEST_PROLOG_EX(argc, argv, suffix)
#define unit_assert_equal(x, y, epsilon)