31#include "boost/shared_ptr.hpp"
32#include "boost/iostreams/positioning.hpp"
66 const std::string _name =
"",
67 const std::string _location =
"");
110 const std::string _name =
"");
141 Component(CVID cvid,
int order) { define(cvid, order); }
191 const std::string& _version);
300 explicit SelectedIon(
double mz,
double intensity, CVID intensityUnit);
302 explicit SelectedIon(
double mz,
double intensity,
int chargeState, CVID intensityUnit);
336 explicit Precursor(
double mz,
double intensity, CVID intensityUnit);
338 explicit Precursor(
double mz,
double intensity,
int chargeState, CVID intensityUnit);
428 : mz(0), intensity(0)
432 : mz(mz), intensity(intensity)
452 : time(0), intensity(0)
456 : time(time), intensity(intensity)
536 return binaryDataArrayPtrs.size() &&
537 binaryDataArrayPtrs[0] &&
538 !binaryDataArrayPtrs[0]->data.empty();
565 void setMZIntensityArrays(
const std::vector<double>& mzArray,
const std::vector<double>& intensityArray, CVID intensityUnits);
620 void setTimeIntensityArrays(
const std::vector<double>& timeArray,
const std::vector<double>& intensityArray, CVID timeUnits, CVID intensityUnits);
665 virtual size_t size()
const = 0;
674 virtual size_t find(
const std::string&
id)
const;
677 virtual size_t findAbbreviated(
const std::string& abbreviatedId,
char delimiter =
'.')
const;
723 virtual size_t size()
const {
return spectra.size();}
724 virtual bool empty()
const {
return spectra.empty() && !dp.get();}
761 virtual size_t size()
const = 0;
770 virtual size_t find(
const std::string&
id)
const;
797 virtual size_t size()
const {
return chromatograms.size();}
798 virtual bool empty()
const {
return chromatograms.empty() && !dp.get();}
844namespace IO {
struct HandlerMSData;}
908 friend struct IO::HandlerMSData;
925template<
typename value_type>
926value_type
valueAs(
const std::string&
id,
const std::string& name)
928 std::string result =
value(
id, name);
929 return !result.empty() ? boost::lexical_cast<value_type>(result)
930 : boost::lexical_cast<value_type>(0);
Interface for accessing chromatograms, which may be stored in memory or backed by a data file (RAW,...
virtual ~ChromatogramList()
virtual size_t size() const =0
returns the number of chromatograms
virtual ChromatogramPtr chromatogram(size_t index, bool getBinaryData=false) const =0
retrieve a chromatogram by index
virtual size_t find(const std::string &id) const
find id in the chromatogram index (returns size() on failure)
virtual const ChromatogramIdentity & chromatogramIdentity(size_t index) const =0
access to a chromatogram index
bool empty() const
returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
Interface for accessing spectra, which may be stored in memory or backed by a data file (RAW,...
virtual SpectrumPtr spectrum(const SpectrumPtr &seed, bool getBinaryData) const
get a copy of the seed spectrum, optionally with its binary data populated this is useful for formats...
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
virtual void warn_once(const char *msg) const
issues a warning once per SpectrumList instance (based on string hash)
virtual IndexList findNameValue(const std::string &name, const std::string &value) const
find all spectrum indexes with specified name/value pair
virtual IndexList findSpotID(const std::string &spotID) const
find all spectrum indexes with spotID (returns empty vector on failure)
virtual size_t findAbbreviated(const std::string &abbreviatedId, char delimiter='.') const
find an abbreviated id (e.g. "1.1.123.2" for "sample=1 period=1 cycle=123 experiment=2") in the spect...
virtual size_t size() const =0
returns the number of spectra
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const =0
retrieve a spectrum by index
virtual size_t find(const std::string &id) const
find id in the spectrum index (returns size() on failure)
virtual bool empty() const
returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)
virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel) const
retrieve a spectrum by index
virtual const SpectrumIdentity & spectrumIdentity(size_t index) const =0
access to a spectrum index
A custom vector class that can store its contents in either a std::vector or a cli::array (when compi...
std::ostream & operator<<(std::ostream &os, const Diff< object_type, config_type > &diff)
stream insertion of Diff results
PWIZ_API_DECL std::string translateScanNumberToNativeID(CVID nativeIDFormat, const std::string &scanNumber)
translates a "scan number" to a string that is correct for the given nativeID format; semantic validi...
PWIZ_API_DECL std::map< std::string, std::string > parse(const std::string &id)
parses an id string into a map<string,string>
PWIZ_API_DECL std::string abbreviate(const std::string &id, char delimiter='.')
abbreviates a nativeID ("name1=value1 name2=value2" translates to "value1.value2")
PWIZ_API_DECL std::string value(const std::string &id, const std::string &name)
convenience function to extract a named value from an id string
PWIZ_API_DECL CVID getDefaultNativeIDFormat(const MSData &msd)
returns the nativeID format from the defaultSourceFilePtr if set, or from sourceFilePtrs[0] if the li...
value_type valueAs(const std::string &id, const std::string &name)
templated convenience function to extract a named value from an id string
PWIZ_API_DECL std::string translateNativeIDToScanNumber(CVID nativeIDFormat, const std::string &id)
translates a nativeID in the given nativeID format to a simple integer "scan number"; some nativeID f...
boost::shared_ptr< DataProcessing > DataProcessingPtr
boost::shared_ptr< Software > SoftwarePtr
boost::shared_ptr< SpectrumList > SpectrumListPtr
boost::shared_ptr< ScanSettings > ScanSettingsPtr
boost::shared_ptr< Sample > SamplePtr
boost::shared_ptr< Chromatogram > ChromatogramPtr
boost::shared_ptr< MSData > MSDataPtr
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< ChromatogramList > ChromatogramListPtr
PWIZ_API_DECL std::vector< CV > defaultCVList()
boost::shared_ptr< SourceFile > SourceFilePtr
Description of the source file, including location and type.
const size_t IDENTITY_INDEX_NONE
boost::shared_ptr< ProcessingMethod > ProcessingMethodPtr
@ DetailLevel_FastMetadata
@ DetailLevel_FullMetadata
@ DetailLevel_InstantMetadata
represents a tag-value pair, where the tag comes from the controlled vocabulary
The base class for elements that may contain cvParams, userParams, or paramGroup references.
The type and energy level used for activation.
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
bool empty() const
returns true iff the element contains no params and all members are empty or null
DataProcessingPtr dataProcessingPtr
this optional attribute may reference the 'id' attribute of the appropriate dataProcessing.
pwiz::util::BinaryData< double > data
the binary data.
void getTimeIntensityPairs(std::vector< TimeIntensityPair > &output) const
copy binary data arrays into time-intensity pair array
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
BinaryDataArrayPtr getTimeArray() const
get time array (may be null)
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
void setTimeIntensityPairs(const std::vector< TimeIntensityPair > &input, CVID timeUnits, CVID intensityUnits)
set binary data arrays
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Precursor precursor
description of precursor ion information (i.e. Q1 settings)
size_t defaultArrayLength
default length of binary data arrays contained in this element.
void setTimeIntensityArrays(const std::vector< double > &timeArray, const std::vector< double > &intensityArray, CVID timeUnits, CVID intensityUnits)
set time and intensity arrays separately (they must be the same size)
void setTimeIntensityPairs(const TimeIntensityPair *input, size_t size, CVID timeUnits, CVID intensityUnits)
set binary data arrays
Product product
description of product ion information (i.e. Q3 settings)
bool empty() const
returns true iff the element contains no params and all members are empty or null
void getTimeIntensityPairs(TimeIntensityPair *output, size_t expectedSize) const
copy binary data arrays into time-intensity pair array note: this overload is to allow client to allo...
Identifying information for a chromatogram.
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.
boost::iostreams::stream_offset sourceFilePosition
for file-based MSData implementations, this attribute may refer to the chromatogram's position in the...
Simple writeable in-memory implementation of ChromatogramList.
virtual ChromatogramPtr chromatogram(size_t index, bool getBinaryData) const
retrieve a chromatogram by index
virtual const ChromatogramIdentity & chromatogramIdentity(size_t index) const
access to a chromatogram index
std::vector< ChromatogramPtr > chromatograms
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
virtual size_t size() const
returns the number of chromatograms
virtual bool empty() const
A component of an instrument corresponding to a source (i.e. ion source), an analyzer (i....
Component(CVID cvid, int order)
ComponentType type
the type of component (Source, Analyzer, or Detector)
Component(ComponentType type, int order)
bool empty() const
returns true iff the element contains no params and all members are empty or null
int order
this attribute MUST be used to indicate the order in which the components are encountered from source...
void define(CVID cvid, int order)
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>
const Component & analyzer(size_t index) const
returns the analyzer component with ordinal <index+1>
const Component & detector(size_t index) const
returns the detector component with ordinal <index+1>
const Component & source(size_t index) const
returns the source component with ordinal <index+1>
Component & source(size_t index)
returns the source component with ordinal <index+1>
Component & analyzer(size_t index)
returns the analyzer component with ordinal <index+1>
Description of the way in which a particular software was used.
DataProcessing(const std::string &_id="")
std::vector< ProcessingMethod > processingMethods
description of the default peak processing method(s). This element describes the base method used in ...
bool empty() const
returns true iff the element contains no params and all members are empty or null
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 ...
bool empty() const
returns true iff all members are empty or null
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,...
bool empty() const
returns true iff the element contains no params and all members are empty or null
std::string id
an identifier for this instrument configuration.
InstrumentConfiguration(const std::string &_id="")
SoftwarePtr softwarePtr
reference to a previously defined software element.
ScanSettingsPtr scanSettingsPtr
reference to a scan settings element defining global scan settings used by this configuration
This element captures the isolation (or 'selection') window configured to isolate one or more precurs...
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.
int countFiltersApplied() const
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.
MSData & operator=(const MSData &)
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< DataProcessingPtr > allDataProcessingPtrs() const
return dataProcessingPtrs augmented by the dataProcessingPtr() set in SpectrumList and/or Chromatogra...
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 data point type of a mass spectrum.
MZIntensityPair(double mz, double intensity)
bool operator==(const MZIntensityPair &that) const
returns true iff mz and intensity are pairwise equal
The method of precursor ion selection and activation.
bool empty() const
returns true iff the element contains no params and all members are empty or null
SourceFilePtr sourceFilePtr
for precursor spectra that are external to this document, this attribute MUST reference the 'id' attr...
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.
Precursor(double mz, int chargeState)
Precursor(double mz, double intensity, CVID intensityUnit)
std::string externalSpectrumID
for precursor spectra that are external to this document, this string MUST correspond to the 'id' att...
Precursor(double mz, double intensity, int chargeState, CVID intensityUnit)
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.
bool empty() const
returns true iff the element contains no params and all members are empty or null
SoftwarePtr softwarePtr
this attribute MUST reference the 'id' of the appropriate SoftwareType.
bool empty() const
returns true iff the element contains no params and all members are empty or null
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
bool operator==(const Product &that) const
returns true iff this product's isolation window is equal to that product's
A run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
Run & operator=(const Run &)
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....
Expansible description of the sample used to generate the dataset, named in sampleName.
std::string name
an optional name for the sample description, mostly intended as a quick mnemonic.
std::string id
a unique identifier across the samples with which to reference this sample description.
Sample(const std::string _id="", const std::string _name="")
bool empty() const
returns true iff the element contains no params and all members are empty or null
Scan or acquisition from original raw file used to create this peak list, as specified in sourceFile.
std::string spectrumID
for scans that are local to this document, this attribute can be used to reference the 'id' attribute...
std::string externalSpectrumID
for scans that are external to this document, this string must correspond to the 'id' attribute of a ...
InstrumentConfigurationPtr instrumentConfigurationPtr
this attribute MUST reference the 'id' attribute of the appropriate instrument configuration.
bool empty() const
returns true iff the element contains no params and all members are empty or null
SourceFilePtr sourceFilePtr
if this attribute is set, it must reference the 'id' attribute of a sourceFile representing the exter...
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.
ScanSettings(const std::string &_id="")
bool empty() const
returns true iff the element contains no params and all members are empty or null
std::vector< SourceFilePtr > sourceFilePtrs
container for a list of source file references.
ScanWindow(double low, double high, CVID unit)
SelectedIon(double mz, double intensity, CVID intensityUnit)
SelectedIon(double mz, double intensity, int chargeState, CVID intensityUnit)
SelectedIon(double mz, int chargeState)
Software(const std::string &_id, const CVParam &_param, const std::string &_version)
std::string id
an identifier for this software that is unique across all SoftwareTypes.
std::string version
the software version.
bool empty() const
returns true iff all members are empty or null
Software(const std::string &_id="")
Description of the source file, including location and type.
std::string name
name of the source file, without reference to location (either URI or local path).
SourceFile(const std::string _id="", const std::string _name="", const std::string _location="")
bool empty() const
returns true iff the element contains no params and all members are empty or null
std::string location
URI-formatted location where the file was retrieved.
std::string id
an identifier for this file.
The structure that captures the generation of a peak list (including the underlying acquisitions)
void getMZIntensityPairs(MZIntensityPair *output, size_t expectedSize) const
copy binary data arrays into m/z-intensity pair array note: this overload is to allow client to alloc...
SourceFilePtr sourceFilePtr
this attribute can optionally reference the 'id' of the appropriate sourceFile.
std::vector< Product > products
list and descriptions of product ion information
void setMZIntensityArrays(const std::vector< double > &mzArray, const std::vector< double > &intensityArray, CVID intensityUnits)
set m/z and intensity arrays separately (they must be the same size)
void swapMZIntensityArrays(pwiz::util::BinaryData< double > &mzArray, pwiz::util::BinaryData< double > &intensityArray, CVID intensityUnits)
set m/z and intensity arrays separately (they must be the same size) by swapping the vector contents ...
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
bool hasBinaryData() const
returns true iff has nonnull and nonempty BinaryDataArrayPtr
void setMZIntensityPairs(const std::vector< MZIntensityPair > &input, CVID intensityUnits)
set binary data arrays
size_t defaultArrayLength
default length of binary data arrays contained in this element.
BinaryDataArrayPtr getMZArray() const
get m/z array (may be null)
ScanList scanList
list of scans
void getMZIntensityPairs(std::vector< MZIntensityPair > &output) const
copy binary data arrays into m/z-intensity pair array
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
bool empty() const
returns true iff the element contains no params and all members are empty or null
void setMZIntensityPairs(const MZIntensityPair *input, size_t size, CVID intensityUnits)
set binary data arrays
BinaryDataArrayPtr getArrayByCVID(CVID arrayType) const
get array with specified CVParam (may be null)
std::vector< Precursor > precursors
list and descriptions of precursors to the spectrum currently being described.
Identifying information for a spectrum.
boost::iostreams::stream_offset sourceFilePosition
for file-based MSData implementations, this attribute may refer to the spectrum's position in the fil...
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
std::string spotID
the identifier for the spot from which this spectrum was derived, if a MALDI or similar run.
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
Simple writeable in-memory implementation of SpectrumList.
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const
retrieve a spectrum by index
virtual size_t size() const
returns the number of spectra
virtual bool empty() const
returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
virtual const SpectrumIdentity & spectrumIdentity(size_t index) const
access to a spectrum index
std::vector< SpectrumPtr > spectra
The data point type of a chromatogram.
bool operator==(const TimeIntensityPair &that) const
returns true iff time and intensity are pairwise equal
TimeIntensityPair(double time, double intensity)