Go to the documentation of this file.
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);
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();}
844 namespace IO {
struct HandlerMSData;}
908 friend struct IO::HandlerMSData;
925 template<
typename value_type>
926 value_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);
959 #endif // _MSDATA_HPP_
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
std::string id
a unique identifier across the samples with which to reference this sample description.
virtual size_t size() const
returns the number of spectra
std::string id
a unique identifier for this chromatogram. It should be expected that external files may use this ide...
This element captures the isolation (or 'selection') window configured to isolate one or more precurs...
std::string name
an optional name for the sample description, mostly intended as a quick mnemonic.
const Component & source(size_t index) const
returns the source component with ordinal <index+1>
bool operator==(const MZIntensityPair &that) const
returns true iff mz and intensity are pairwise equal
Simple writeable in-memory implementation of ChromatogramList.
Component & source(size_t index)
returns the source component with ordinal <index+1>
bool operator==(const TimeIntensityPair &that) const
returns true iff time and intensity are pairwise equal
boost::shared_ptr< SpectrumList > SpectrumListPtr
bool empty() const
returns true iff the element contains no params and all members are empty or null
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
ComponentList componentList
list with the different components used in the mass spectrometer. At least one source,...
virtual void warn_once(const char *msg) const
issues a warning once per SpectrumList instance (based on string hash)
Identifying information for a spectrum.
Precursor(double mz, double intensity, int chargeState, CVID intensityUnit)
std::vector< SoftwarePtr > softwarePtrs
list and descriptions of software used to acquire and/or process the data in this mzML file.
The structure that captures the generation of a peak list (including the underlying acquisitions)
PWIZ_API_DECL std::map< std::string, std::string > parse(const std::string &id)
parses an id string into a map<string,string>
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
Description of the default peak processing method. This element describes the base method used in the...
std::string id
an optional id for the mzML document. It is recommended to use LSIDs when possible.
SelectedIon(double mz, int chargeState)
SoftwarePtr softwarePtr
this attribute MUST reference the 'id' of the appropriate SoftwareType.
SelectedIon(double mz, double intensity, CVID intensityUnit)
Description of the source file, including location and type.
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...
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
virtual size_t size() const =0
returns the number of spectra
std::vector< SourceFilePtr > sourceFilePtrs
container for a list of source file references.
Run & operator=(const Run &)
A run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const =0
retrieve a spectrum by index
SourceFile(const std::string _id="", const std::string _name="", const std::string _location="")
size_t defaultArrayLength
default length of binary data arrays contained in this element.
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
boost::shared_ptr< ScanSettings > ScanSettingsPtr
std::string name
name of the source file, without reference to location (either URI or local path).
List and descriptions of scans.
void setTimeIntensityPairs(const std::vector< TimeIntensityPair > &input, CVID timeUnits, CVID intensityUnits)
set binary data arrays
bool empty() const
returns true iff the element contains no params and all members are empty or null
ScanSettings(const std::string &_id="")
InstrumentConfigurationPtr instrumentConfigurationPtr
this attribute MUST reference the 'id' attribute of the appropriate instrument configuration.
boost::iostreams::stream_offset sourceFilePosition
for file-based MSData implementations, this attribute may refer to the spectrum's position in the fil...
virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel) const
retrieve a spectrum by index
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 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...
std::vector< SourceFilePtr > sourceFilePtrs
list and descriptions of the source files this mzML document was generated or derived from.
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)
virtual size_t find(const std::string &id) const
find id in the chromatogram index (returns size() on failure)
std::string accession
an optional accession number for the mzML document.
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const
retrieve a spectrum by index
bool empty() const
returns true iff the element contains no params and all members are empty or null
std::vector< ScanWindow > scanWindows
container for a list of select windows.
bool empty() const
returns true iff the element contains no params and all members are empty or null
SourceFilePtr defaultSourceFilePtr
default source file reference
DataProcessingPtr dataProcessingPtr
this optional attribute may reference the 'id' attribute of the appropriate dataProcessing.
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)
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
std::vector< ProcessingMethod > processingMethods
description of the default peak processing method(s). This element describes the base method used in ...
pwiz::util::BinaryData< double > data
the binary data.
bool empty() const
returns true iff the element contains no params and all members are empty or null
BinaryDataArrayPtr getMZArray() const
get m/z array (may be null)
virtual const SpectrumIdentity & spectrumIdentity(size_t index) const =0
access to a spectrum index
Identifying information for a chromatogram.
std::string spectrumID
reference to the id attribute of the spectrum from which the precursor was selected.
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
virtual const SpectrumIdentity & spectrumIdentity(size_t index) const
access to a spectrum index
std::vector< CV > cvs
container for one or more controlled vocabulary definitions.
List with the different components used in the mass spectrometer. At least one source,...
std::string id
an identifier for this file.
ScanWindow(double low, double high, CVID unit)
ComponentType type
the type of component (Source, Analyzer, or Detector)
InstrumentConfiguration(const std::string &_id="")
The type and energy level used for activation.
boost::shared_ptr< ChromatogramList > ChromatogramListPtr
int order
this attribute MUST be used to indicate the order in which the components are encountered from source...
std::string spectrumID
for scans that are local to this document, this attribute can be used to reference the 'id' attribute...
@ DetailLevel_FullMetadata
bool empty() const
returns true iff the element contains no params and all members are empty or null
SourceFilePtr sourceFilePtr
this attribute can optionally reference the 'id' of the appropriate sourceFile.
virtual const ChromatogramIdentity & chromatogramIdentity(size_t index) const =0
access to a chromatogram index
@ DetailLevel_InstantMetadata
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
std::vector< Target > targets
target list (or 'inclusion list') configured prior to the run.
std::string id
a unique identifier for this data processing that is unique across all DataProcessingTypes.
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
boost::iostreams::stream_offset sourceFilePosition
for file-based MSData implementations, this attribute may refer to the chromatogram's position in the...
Precursor(double mz, double intensity, CVID intensityUnit)
std::string id
a unique identifier for this run.
virtual bool empty() const
returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)
BinaryDataArrayPtr getArrayByCVID(CVID arrayType) const
get array with specified CVParam (may be null)
void getTimeIntensityPairs(std::vector< TimeIntensityPair > &output) const
copy binary data arrays into time-intensity pair array
std::string id
a unique identifier for this acquisition setting.
FileContent fileContent
this summarizes the different types of spectra that can be expected in the file. This is expected to ...
PWIZ_API_DECL std::ostream & operator<<(std::ostream &os, const BinaryDataEncoder::Config &config)
std::string id
an identifier for this instrument configuration.
The base class for elements that may contain cvParams, userParams, or paramGroup references.
FileDescription fileDescription
information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
boost::shared_ptr< MSData > MSDataPtr
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< Sample > SamplePtr
SelectedIon(double mz, double intensity, int chargeState, CVID intensityUnit)
std::string spotID
the identifier for the spot from which this spectrum was derived, if a MALDI or similar run.
bool empty() const
returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)
std::vector< ScanSettingsPtr > scanSettingsPtrs
list with the descriptions of the acquisition settings applied prior to the start of data acquisition...
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
virtual bool empty() const
SourceFilePtr sourceFilePtr
if this attribute is set, it must reference the 'id' attribute of a sourceFile representing the exter...
bool empty() const
returns true iff all members are empty or null
virtual ChromatogramPtr chromatogram(size_t index, bool getBinaryData=false) const =0
retrieve a chromatogram by index
BinaryDataArrayPtr getTimeArray() const
get time array (may be null)
PWIZ_API_DECL std::vector< CV > defaultCVList()
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...
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
Information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
Software(const std::string &_id="")
void setMZIntensityPairs(const std::vector< MZIntensityPair > &input, CVID intensityUnits)
set binary data arrays
std::vector< Product > products
list and descriptions of product ion information
std::string version
the software version.
const Component & analyzer(size_t index) const
returns the analyzer component with ordinal <index+1>
A component of an instrument corresponding to a source (i.e. ion source), an analyzer (i....
bool empty() const
returns true iff the element contains no params and all members are empty or null
bool empty() const
returns true iff the element contains no params and all members are empty or null
boost::shared_ptr< Spectrum > SpectrumPtr
ScanSettingsPtr scanSettingsPtr
reference to a scan settings element defining global scan settings used by this configuration
std::string location
URI-formatted location where the file was retrieved.
Activation activation
the type and energy level used for activation.
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Description of the acquisition settings of the instrument prior to the start of the run.
std::vector< Contact > contacts
structure allowing the use of a controlled (cvParam) or uncontrolled vocabulary (userParam),...
void define(CVID cvid, int order)
int countFiltersApplied() const
Component & detector(size_t index)
returns the detector component with ordinal <index+1>
bool empty() const
returns true iff the element contains no params and all members are empty or null
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.
Simple writeable in-memory implementation of SpectrumList.
The data point type of a chromatogram.
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...
ScanList scanList
list of scans
Scan or acquisition from original raw file used to create this peak list, as specified in sourceFile.
boost::shared_ptr< SourceFile > SourceFilePtr
Description of the source file, including location and type.
virtual ~ChromatogramList()
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here....
TimeIntensityPair(double time, double intensity)
MSData & operator=(const MSData &)
std::vector< Scan > scans
std::string startTimeStamp
the optional start timestamp of the run, in UT.
virtual size_t size() const =0
returns the number of chromatograms
virtual const ChromatogramIdentity & chromatogramIdentity(size_t index) const
access to a chromatogram index
This summarizes the different types of spectra that can be expected in the file. This is expected to ...
Expansible description of the sample used to generate the dataset, named in sampleName.
boost::shared_ptr< DataProcessing > DataProcessingPtr
std::string externalSpectrumID
for precursor spectra that are external to this document, this string MUST correspond to the 'id' att...
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.
@ DetailLevel_FastMetadata
bool empty() const
returns true iff the element contains no params and all members are empty or null
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
boost::shared_ptr< ProcessingMethod > ProcessingMethodPtr
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...
Sample(const std::string _id="", const std::string _name="")
DataProcessing(const std::string &_id="")
Component(CVID cvid, int order)
double mz(double neutralMass, int protonDelta, int electronDelta=0, int neutronDelta=0)
std::vector< DataProcessingPtr > dataProcessingPtrs
list and descriptions of data processing applied to this data.
MZIntensityPair(double mz, double intensity)
void setMZIntensityPairs(const MZIntensityPair *input, size_t size, CVID intensityUnits)
set binary data arrays
void setTimeIntensityPairs(const TimeIntensityPair *input, size_t size, CVID timeUnits, CVID intensityUnits)
set binary data arrays
std::vector< InstrumentConfigurationPtr > instrumentConfigurationPtrs
list and descriptions of instrument configurations.
virtual size_t size() const
returns the number of chromatograms
const size_t IDENTITY_INDEX_NONE
SoftwarePtr softwarePtr
reference to a previously defined software element.
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
std::vector< Precursor > precursors
list and descriptions of precursors to the spectrum currently being described.
virtual IndexList findSpotID(const std::string &spotID) const
find all spectrum indexes with spotID (returns empty vector on failure)
Component(ComponentType type, int order)
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)
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Description of the way in which a particular software was used.
PWIZ_API_DECL std::string abbreviate(const std::string &id, char delimiter='.')
abbreviates a nativeID ("name1=value1 name2=value2" translates to "value1.value2")
bool empty() const
returns true iff the element contains no params and all members are empty or null
bool empty() const
returns true iff all members are empty or null
void getMZIntensityPairs(std::vector< MZIntensityPair > &output) const
copy binary data arrays into m/z-intensity pair array
boost::shared_ptr< Chromatogram > ChromatogramPtr
The data point type of a mass spectrum.
value_type valueAs(const std::string &id, const std::string &name)
templated convenience function to extract a named value from an id string
virtual ChromatogramPtr chromatogram(size_t index, bool getBinaryData) const
retrieve a chromatogram by index
PWIZ_API_DECL CVID getDefaultNativeIDFormat(const MSData &msd)
returns the nativeID format from the defaultSourceFilePtr if set, or from sourceFilePtrs[0] if the li...
bool empty() const
returns true iff the element contains no params and all members are empty or null
SamplePtr samplePtr
this attribute MUST reference the 'id' of the appropriate sample.
std::vector< SelectedIon > selectedIons
this list of precursor ions that were selected.
bool operator==(const Product &that) const
returns true iff this product's isolation window is equal to that product's
Interface for accessing chromatograms, which may be stored in memory or backed by a data file (RAW,...
boost::shared_ptr< InstrumentConfiguration > InstrumentConfigurationPtr
The method of precursor ion selection and activation.
std::string externalSpectrumID
for scans that are external to this document, this string must correspond to the 'id' attribute of a ...
size_t defaultArrayLength
default length of binary data arrays contained in this element.
std::vector< SpectrumPtr > spectra
represents a tag-value pair, where the tag comes from the controlled vocabulary
Precursor precursor
description of precursor ion information (i.e. Q1 settings)
const Component & detector(size_t index) const
returns the detector component with ordinal <index+1>
InstrumentConfigurationPtr defaultInstrumentConfigurationPtr
this attribute MUST reference the 'id' of the default instrument configuration. If a scan does not re...
Component & analyzer(size_t index)
returns the analyzer component with ordinal <index+1>
Interface for accessing spectra, which may be stored in memory or backed by a data file (RAW,...
const std::string & version() const
returns the version of this mzML document; for a document created programmatically,...
bool empty() const
returns true iff the element contains no params and all members are empty or null
virtual IndexList findNameValue(const std::string &name, const std::string &value) const
find all spectrum indexes with specified name/value pair
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
std::vector< ChromatogramPtr > chromatograms
int order
this attributes allows a series of consecutive steps to be placed in the correct order.
size_t index
the zero-based, consecutive index of the chromatogram in the ChromatogramList.
Product product
description of product ion information (i.e. Q3 settings)
ChromatogramListPtr chromatogramListPtr
all chromatograms for this run.
boost::shared_ptr< Software > SoftwarePtr
bool hasBinaryData() const
returns true iff has nonnull and nonempty BinaryDataArrayPtr
SourceFilePtr sourceFilePtr
for precursor spectra that are external to this document, this attribute MUST reference the 'id' attr...
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 ...
Precursor(double mz, int chargeState)
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
boost::shared_ptr< ChromatogramListSimple > ChromatogramListSimplePtr