31 #include "boost/shared_ptr.hpp" 32 #include "boost/iostreams/positioning.hpp" 66 const std::string _name =
"",
67 const std::string _location =
"");
109 Sample(
const std::string _id =
"",
110 const std::string _name =
"");
141 Component(CVID cvid,
int order) { define(cvid, order); }
143 void define(CVID cvid,
int order);
168 const Component& source(
size_t index)
const;
171 const Component& analyzer(
size_t index)
const;
174 const Component& detector(
size_t index)
const;
187 Software(
const std::string& _id =
"");
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);
337 explicit Precursor(
double mz,
int chargeState);
338 explicit Precursor(
double mz,
double intensity,
int chargeState, CVID intensityUnit);
364 ScanWindow(
double low,
double high, CVID unit);
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();
542 void getMZIntensityPairs(std::vector<MZIntensityPair>& output)
const;
547 void getMZIntensityPairs(
MZIntensityPair* output,
size_t expectedSize)
const;
550 BinaryDataArrayPtr getMZArray()
const;
553 BinaryDataArrayPtr getIntensityArray()
const;
556 BinaryDataArrayPtr getArrayByCVID(CVID arrayType)
const;
559 void setMZIntensityPairs(
const std::vector<MZIntensityPair>& input, CVID intensityUnits);
562 void setMZIntensityPairs(
const MZIntensityPair* input,
size_t size, CVID intensityUnits);
565 void setMZIntensityArrays(
const std::vector<double>& mzArray,
const std::vector<double>& intensityArray, CVID intensityUnits);
600 void getTimeIntensityPairs(std::vector<TimeIntensityPair>& output)
const;
605 void getTimeIntensityPairs(
TimeIntensityPair* output,
size_t expectedSize)
const;
608 BinaryDataArrayPtr getTimeArray()
const;
611 BinaryDataArrayPtr getIntensityArray()
const;
614 void setTimeIntensityPairs(
const std::vector<TimeIntensityPair>& input, CVID timeUnits, CVID intensityUnits);
617 void setTimeIntensityPairs(
const TimeIntensityPair* input,
size_t size, CVID timeUnits, 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;
668 virtual bool empty()
const;
674 virtual size_t find(
const std::string&
id)
const;
677 virtual size_t findAbbreviated(
const std::string& abbreviatedId,
char delimiter =
'.')
const;
680 virtual IndexList findNameValue(
const std::string& name,
const std::string&
value)
const;
683 virtual IndexList findSpotID(
const std::string& spotID)
const;
688 virtual SpectrumPtr spectrum(
size_t index,
bool getBinaryData =
false)
const = 0;
693 virtual SpectrumPtr spectrum(
const SpectrumPtr& seed,
bool getBinaryData)
const;
698 virtual SpectrumPtr spectrum(
size_t index,
DetailLevel detailLevel)
const;
702 virtual const boost::shared_ptr<const DataProcessing> dataProcessingPtr()
const;
705 virtual void warn_once(
const char* msg)
const;
719 DataProcessingPtr
dp;
723 virtual size_t size()
const {
return spectra.size();}
724 virtual bool empty()
const {
return spectra.empty() && !dp.get();}
726 virtual SpectrumPtr spectrum(
size_t index,
bool getBinaryData)
const;
727 virtual const boost::shared_ptr<const DataProcessing> dataProcessingPtr()
const;
761 virtual size_t size()
const = 0;
770 virtual size_t find(
const std::string&
id)
const;
775 virtual ChromatogramPtr chromatogram(
size_t index,
bool getBinaryData =
false)
const = 0;
779 virtual const boost::shared_ptr<const DataProcessing> dataProcessingPtr()
const;
793 DataProcessingPtr
dp;
797 virtual size_t size()
const {
return chromatograms.size();}
798 virtual bool empty()
const {
return chromatograms.empty() && !dp.get();}
800 virtual ChromatogramPtr chromatogram(
size_t index,
bool getBinaryData)
const;
801 virtual const boost::shared_ptr<const DataProcessing> dataProcessingPtr()
const;
840 Run& operator=(
const Run&);
844 namespace IO {
struct HandlerMSData;}
883 std::vector<DataProcessingPtr> allDataProcessingPtrs()
const;
895 const std::string& version()
const;
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);
930 : boost::lexical_cast<value_type>(0);
959 #endif // _MSDATA_HPP_
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 ...
The type and energy level used for activation.
Interface for accessing chromatograms, which may be stored in memory or backed by a data file (RAW...
std::string id
a unique identifier for this chromatogram. It should be expected that external files may use this ide...
std::vector< SourceFilePtr > sourceFilePtrs
list and descriptions of the source files this mzML document was generated or derived from...
PWIZ_API_DECL std::string abbreviate(const std::string &id, char delimiter='.')
abbreviates a nativeID ("name1=value1 name2=value2" translates to "value1.value2") ...
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.
virtual size_t size() const
returns the number of spectra
ScanList scanList
list of scans
const size_t IDENTITY_INDEX_NONE
boost::shared_ptr< ProcessingMethod > ProcessingMethodPtr
boost::shared_ptr< Software > SoftwarePtr
Description of the source file, including location and type.
PWIZ_API_DECL std::ostream & operator<<(std::ostream &os, const BinaryDataEncoder::Config &config)
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.
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
SourceFilePtr sourceFilePtr
for precursor spectra that are external to this document, this attribute MUST reference the 'id' attr...
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< ChromatogramList > ChromatogramListPtr
boost::shared_ptr< ScanSettings > ScanSettingsPtr
TimeIntensityPair(double time, double intensity)
std::string name
an optional name for the sample description, mostly intended as a quick mnemonic. ...
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.
ScanSettingsPtr scanSettingsPtr
reference to a scan settings element defining global scan settings used by this configuration ...
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
boost::shared_ptr< DataProcessing > DataProcessingPtr
SoftwarePtr softwarePtr
this attribute MUST reference the 'id' of the appropriate SoftwareType.
size_t defaultArrayLength
default length of binary data arrays contained in this element.
ComponentType type
the type of component (Source, Analyzer, or Detector)
PWIZ_API_DECL CVID getDefaultNativeIDFormat(const MSData &msd)
returns the nativeID format from the defaultSourceFilePtr if set, or from sourceFilePtrs[0] if the li...
std::string id
an identifier for this file.
std::string name
name of the source file, without reference to location (either URI or local path).
std::string externalSpectrumID
for scans that are external to this document, this string must correspond to the 'id' attribute of a ...
boost::shared_ptr< ChromatogramListSimple > ChromatogramListSimplePtr
virtual ~ChromatogramList()
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.
pwiz::util::BinaryData< double > data
the binary data.
FileDescription fileDescription
information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
std::string id
a unique identifier across the samples with which to reference this sample description.
FileContent fileContent
this summarizes the different types of spectra that can be expected in the file. This is expected to ...
Precursor precursor
description of precursor ion information (i.e. Q1 settings)
std::vector< ScanSettingsPtr > scanSettingsPtrs
list with the descriptions of the acquisition settings applied prior to the start of data acquisition...
std::string spectrumID
for scans that are local to this document, this attribute can be used to reference the 'id' attribute...
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.
DataProcessingPtr dataProcessingPtr
this optional attribute may reference the 'id' attribute of the appropriate dataProcessing.
SourceFilePtr defaultSourceFilePtr
default source file reference
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
PWIZ_API_DECL std::map< std::string, std::string > parse(const std::string &id)
parses an id string into a map<string,string>
size_t defaultArrayLength
default length of binary data arrays contained in this element.
std::string location
URI-formatted location where the file was retrieved.
toType lexical_cast(const std::string &str, bool &success)
boost::iostreams::stream_offset sourceFilePosition
for file-based MSData implementations, this attribute may refer to the spectrum's position in the fil...
Description of the default peak processing method. This element describes the base method used in the...
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.
int order
this attributes allows a series of consecutive steps to be placed in the correct order.
The data point type of a mass spectrum.
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.
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.
value_type valueAs(const std::string &id, const std::string &name)
templated convenience function to extract a named value from an id string
virtual bool empty() const
returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)
std::string id
a unique identifier for this data processing that is unique across all DataProcessingTypes.
The base class for elements that may contain cvParams, userParams, or paramGroup references.
Activation activation
the type and energy level used for activation.
bool hasBinaryData() const
returns true iff has nonnull and nonempty BinaryDataArrayPtr
std::string id
a unique identifier for this acquisition setting.
std::vector< ScanWindow > scanWindows
container for a list of select windows.
Product product
description of product ion information (i.e. Q3 settings)
std::string version
the software version.
boost::shared_ptr< SpectrumList > SpectrumListPtr
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)
PWIZ_API_DECL std::vector< CV > defaultCVList()
virtual size_t size() const
returns the number of chromatograms
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
int countFiltersApplied() const
double mz(double neutralMass, int protonDelta, int electronDelta=0, int neutronDelta=0)
std::vector< CV > cvs
container for one or more controlled vocabulary definitions.
The data point type of a chromatogram.
boost::iostreams::stream_offset sourceFilePosition
for file-based MSData implementations, this attribute may refer to the chromatogram's position in the...
std::string startTimeStamp
the optional start timestamp of the run, in UT.
boost::shared_ptr< MSData > MSDataPtr
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.
This element captures the isolation (or 'selection') window configured to isolate one or more precurs...
std::string spotID
the identifier for the spot from which this spectrum was derived, if a MALDI or similar run...
std::vector< SamplePtr > samplePtrs
list and descriptions of samples.
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
boost::shared_ptr< InstrumentConfiguration > InstrumentConfigurationPtr
std::vector< Scan > scans
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
virtual bool empty() const
std::vector< SelectedIon > selectedIons
this list of precursor ions that were selected.
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.
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Identifying information for a spectrum.
std::vector< SpectrumPtr > spectra
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.
List and descriptions of scans.
Component(ComponentType type, int order)
PWIZ_API_DECL bool operator==(const TruncatedLorentzianParameters &t, const TruncatedLorentzianParameters &u)
Expansible description of the sample used to generate the dataset, named in sampleName.
std::string externalSpectrumID
for precursor spectra that are external to this document, this string MUST correspond to the 'id' att...
SourceFilePtr sourceFilePtr
this attribute can optionally reference the 'id' of the appropriate sourceFile.
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
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
MZIntensityPair(double mz, double intensity)
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...
Identifying information for a chromatogram.
Component(CVID cvid, int order)
boost::shared_ptr< Sample > SamplePtr
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.
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.
SourceFilePtr sourceFilePtr
if this attribute is set, it must reference the 'id' attribute of a sourceFile representing the exter...
Simple writeable in-memory implementation of SpectrumList.
boost::shared_ptr< Chromatogram > ChromatogramPtr
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
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...
represents a tag-value pair, where the tag comes from the controlled vocabulary
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...