ProteoWizard
Public Member Functions | Public Attributes | List of all members
pwiz::msdata::Spectrum Struct Reference

The structure that captures the generation of a peak list (including the underlying acquisitions) More...

#include <MSData.hpp>

Inheritance diagram for pwiz::msdata::Spectrum:
pwiz::msdata::SpectrumIdentity pwiz::data::ParamContainer

Public Member Functions

 Spectrum ()
 
bool empty () const
 returns true iff the element contains no params and all members are empty or null More...
 
bool hasBinaryData () const
 returns true iff has nonnull and nonempty BinaryDataArrayPtr More...
 
void getMZIntensityPairs (std::vector< MZIntensityPair > &output) const
 copy binary data arrays into m/z-intensity pair array More...
 
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 allocate own buffer; the client must determine the correct size beforehand, or an exception will be thrown More...
 
BinaryDataArrayPtr getMZArray () const
 get m/z array (may be null) More...
 
BinaryDataArrayPtr getIntensityArray () const
 get intensity array (may be null) More...
 
void setMZIntensityPairs (const std::vector< MZIntensityPair > &input, CVID intensityUnits)
 set binary data arrays More...
 
void setMZIntensityPairs (const MZIntensityPair *input, size_t size, CVID intensityUnits)
 set binary data arrays More...
 
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) More...
 
void swapMZIntensityArrays (std::vector< double > &mzArray, std::vector< double > &intensityArray, CVID intensityUnits)
 set m/z and intensity arrays separately (they must be the same size) by swapping the vector contents this allows for a more nearly zero copy setup. More...
 
- Public Member Functions inherited from pwiz::msdata::SpectrumIdentity
 SpectrumIdentity ()
 
- Public Member Functions inherited from pwiz::data::ParamContainer
CVParam cvParam (CVID cvid) const
 finds cvid in the container: More...
 
CVParam cvParamChild (CVID cvid) const
 finds child of cvid in the container: More...
 
std::vector< CVParamcvParamChildren (CVID cvid) const
 finds all children of cvid in the container: More...
 
bool hasCVParam (CVID cvid) const
 returns true iff cvParams contains exact cvid (recursive) More...
 
bool hasCVParamChild (CVID cvid) const
 returns true iff cvParams contains a child (is_a) of cvid (recursive) More...
 
UserParam userParam (const std::string &) const
 finds UserParam with specified name More...
 
void set (CVID cvid, const std::string &value="", CVID units=CVID_Unknown)
 set/add a CVParam (not recursive) More...
 
void set (CVID cvid, double value, CVID units=CVID_Unknown)
 set/add a CVParam (not recursive) More...
 
void set (CVID cvid, int value, CVID units=CVID_Unknown)
 set/add a CVParam (not recursive) More...
 
template<typename value_type >
void set (CVID cvid, value_type value, CVID units=CVID_Unknown)
 set/add a CVParam (not recursive) More...
 
bool empty () const
 returns true iff the element contains no params or param groups More...
 
void clear ()
 clears the collections More...
 
bool operator== (const ParamContainer &that) const
 returns true iff this and that have the exact same cvParams and userParams More...
 
bool operator!= (const ParamContainer &that) const
 returns !(this==that) More...
 
template<>
void set (CVID cvid, bool value, CVID units)
 special case for bool (outside the class for gcc 3.4, and inline for msvc) More...
 

Public Attributes

size_t defaultArrayLength
 default length of binary data arrays contained in this element. More...
 
DataProcessingPtr dataProcessingPtr
 this attribute can optionally reference the 'id' of the appropriate dataProcessing. More...
 
SourceFilePtr sourceFilePtr
 this attribute can optionally reference the 'id' of the appropriate sourceFile. More...
 
ScanList scanList
 list of scans More...
 
std::vector< Precursorprecursors
 list and descriptions of precursors to the spectrum currently being described. More...
 
std::vector< Productproducts
 list and descriptions of product ion information More...
 
std::vector< BinaryDataArrayPtrbinaryDataArrayPtrs
 list of binary data arrays. More...
 
- Public Attributes inherited from pwiz::msdata::SpectrumIdentity
size_t index
 the zero-based, consecutive index of the spectrum in the SpectrumList. More...
 
std::string id
 a unique identifier for this spectrum. It should be expected that external files may use this identifier together with the mzML filename or accession to reference a particular spectrum. More...
 
std::string spotID
 the identifier for the spot from which this spectrum was derived, if a MALDI or similar run. More...
 
boost::iostreams::stream_offset sourceFilePosition
 for file-based MSData implementations, this attribute may refer to the spectrum's position in the file More...
 
- Public Attributes inherited from pwiz::data::ParamContainer
std::vector< ParamGroupPtrparamGroupPtrs
 a collection of references to ParamGroups More...
 
std::vector< CVParamcvParams
 a collection of controlled vocabulary terms More...
 
std::vector< UserParamuserParams
 a collection of uncontrolled user terms More...
 

Detailed Description

The structure that captures the generation of a peak list (including the underlying acquisitions)

Definition at line 504 of file MSData.hpp.

Constructor & Destructor Documentation

§ Spectrum()

pwiz::msdata::Spectrum::Spectrum ( )
inline

Definition at line 528 of file MSData.hpp.

528 : defaultArrayLength(0) {}
size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: MSData.hpp:507

Member Function Documentation

§ empty()

bool pwiz::msdata::Spectrum::empty ( ) const

returns true iff the element contains no params and all members are empty or null

§ hasBinaryData()

bool pwiz::msdata::Spectrum::hasBinaryData ( ) const
inline

returns true iff has nonnull and nonempty BinaryDataArrayPtr

Definition at line 534 of file MSData.hpp.

Referenced by spectrumHasBinaryData(), and verifyScanInfo().

534  {
535  return binaryDataArrayPtrs.size() &&
536  binaryDataArrayPtrs[0] &&
537  !binaryDataArrayPtrs[0]->data.empty();
538  };
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: MSData.hpp:525

§ getMZIntensityPairs() [1/2]

void pwiz::msdata::Spectrum::getMZIntensityPairs ( std::vector< MZIntensityPair > &  output) const

copy binary data arrays into m/z-intensity pair array

Referenced by doSomething().

§ getMZIntensityPairs() [2/2]

void pwiz::msdata::Spectrum::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 allocate own buffer; the client must determine the correct size beforehand, or an exception will be thrown

§ getMZArray()

BinaryDataArrayPtr pwiz::msdata::Spectrum::getMZArray ( ) const

get m/z array (may be null)

Referenced by initializeTinyMGF(), initializeTinyMS1(), initializeTinyMS2(), and verifyScanInfo().

§ getIntensityArray()

BinaryDataArrayPtr pwiz::msdata::Spectrum::getIntensityArray ( ) const

get intensity array (may be null)

Referenced by initializeTinyMGF(), initializeTinyMS1(), and initializeTinyMS2().

§ setMZIntensityPairs() [1/2]

void pwiz::msdata::Spectrum::setMZIntensityPairs ( const std::vector< MZIntensityPair > &  input,
CVID  intensityUnits 
)

set binary data arrays

§ setMZIntensityPairs() [2/2]

void pwiz::msdata::Spectrum::setMZIntensityPairs ( const MZIntensityPair input,
size_t  size,
CVID  intensityUnits 
)

set binary data arrays

§ setMZIntensityArrays()

void pwiz::msdata::Spectrum::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)

Referenced by initializeTinyMGF(), initializeTinyMS1(), and initializeTinyMS2().

§ swapMZIntensityArrays()

void pwiz::msdata::Spectrum::swapMZIntensityArrays ( std::vector< double > &  mzArray,
std::vector< double > &  intensityArray,
CVID  intensityUnits 
)

set m/z and intensity arrays separately (they must be the same size) by swapping the vector contents this allows for a more nearly zero copy setup.

Contents of mzArray and intensityArray are undefined after calling.

Member Data Documentation

§ defaultArrayLength

size_t pwiz::msdata::Spectrum::defaultArrayLength

default length of binary data arrays contained in this element.

Definition at line 507 of file MSData.hpp.

Referenced by initializeTestData(), initializeTinyMGF(), initializeTinyMS1(), initializeTinyMS2(), DefaultArrayLengthSorter::less(), pwiz::msdata::TextWriter::operator()(), and testSpectrum().

§ dataProcessingPtr

DataProcessingPtr pwiz::msdata::Spectrum::dataProcessingPtr

this attribute can optionally reference the 'id' of the appropriate dataProcessing.

Definition at line 510 of file MSData.hpp.

Referenced by pwiz::msdata::TextWriter::operator()(), spectrumHasMetadata(), and testSpectrum().

§ sourceFilePtr

SourceFilePtr pwiz::msdata::Spectrum::sourceFilePtr

this attribute can optionally reference the 'id' of the appropriate sourceFile.

Definition at line 513 of file MSData.hpp.

Referenced by pwiz::msdata::TextWriter::operator()(), spectrumHasMetadata(), and testSpectrum().

§ scanList

ScanList pwiz::msdata::Spectrum::scanList

§ precursors

std::vector<Precursor> pwiz::msdata::Spectrum::precursors

list and descriptions of precursors to the spectrum currently being described.

Definition at line 519 of file MSData.hpp.

Referenced by initializeTestData(), initializeTinyMGF(), initializeTinyMS2(), pwiz::msdata::TextWriter::operator()(), spectrumHasMetadata(), testSpectrum(), verifyPrecursorInfo(), and verifyPrecursorMZ().

§ products

std::vector<Product> pwiz::msdata::Spectrum::products

list and descriptions of product ion information

Definition at line 522 of file MSData.hpp.

Referenced by testSpectrum().

§ binaryDataArrayPtrs

std::vector<BinaryDataArrayPtr> pwiz::msdata::Spectrum::binaryDataArrayPtrs

list of binary data arrays.

Definition at line 525 of file MSData.hpp.

Referenced by HasBinaryDataPredicate::accept(), initializeTestData(), pwiz::msdata::TextWriter::operator()(), testBasic(), and testSpectrum().


The documentation for this struct was generated from the following file: