ProteoWizard
Public Member Functions | Protected Attributes | List of all members
pwiz::msdata::SpectrumListWrapper Class Referenceabstract

Inheritable pass-through implementation for wrapping a SpectrumList. More...

#include <SpectrumListWrapper.hpp>

Inheritance diagram for pwiz::msdata::SpectrumListWrapper:
pwiz::msdata::SpectrumList pwiz::analysis::SpectrumList_3D pwiz::analysis::SpectrumList_ChargeFromIsotope pwiz::analysis::SpectrumList_ChargeStateCalculator pwiz::analysis::SpectrumList_Demux pwiz::analysis::SpectrumList_Filter pwiz::analysis::SpectrumList_IonMobility pwiz::analysis::SpectrumList_LockmassRefiner pwiz::analysis::SpectrumList_MZRefiner pwiz::analysis::SpectrumList_MZWindow pwiz::analysis::SpectrumList_MetadataFixer pwiz::analysis::SpectrumList_PeakFilter pwiz::analysis::SpectrumList_PeakPicker pwiz::analysis::SpectrumList_PrecursorRecalculator pwiz::analysis::SpectrumList_PrecursorRefine pwiz::analysis::SpectrumList_ScanSummer pwiz::analysis::SpectrumList_Smoother pwiz::analysis::SpectrumList_Sorter pwiz::analysis::SpectrumList_TitleMaker pwiz::analysis::SpectrumList_ZeroSamplesFilter pwiz::msdata::SpectrumListCache

Public Member Functions

 SpectrumListWrapper (const SpectrumListPtr &inner)
 
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 SpectrumIdentityspectrumIdentity (size_t index) const
 access to a spectrum index
 
virtual SpectrumPtr spectrum (size_t index, bool getBinaryData=false) const =0
 retrieve a spectrum by index
 
virtual SpectrumPtr spectrum (size_t index, DetailLevel detailLevel) const
 retrieve a spectrum by index
 
virtual const boost::shared_ptr< const DataProcessingdataProcessingPtr () const
 returns the data processing affecting spectra retrieved through this interface
 
SpectrumListPtr inner () const
 
SpectrumListPtr innermost () const
 
- Public Member Functions inherited from pwiz::msdata::SpectrumList
virtual size_t find (const std::string &id) const
 find id in the spectrum index (returns size() 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 spectrum index (returns size() on failure)
 
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 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 like mzML that can delay loading of binary data
 
virtual void warn_once (const char *msg) const
 issues a warning once per SpectrumList instance (based on string hash)
 
virtual ~SpectrumList ()
 

Protected Attributes

SpectrumListPtr inner_
 
DataProcessingPtr dp_
 

Detailed Description

Inheritable pass-through implementation for wrapping a SpectrumList.

Definition at line 37 of file SpectrumListWrapper.hpp.

Constructor & Destructor Documentation

◆ SpectrumListWrapper()

pwiz::msdata::SpectrumListWrapper::SpectrumListWrapper ( const SpectrumListPtr inner)
inline

Definition at line 41 of file SpectrumListWrapper.hpp.

42 : inner_(inner),
43 dp_(inner->dataProcessingPtr().get() ? new DataProcessing(*inner->dataProcessingPtr())
44 : new DataProcessing("pwiz_Spectrum_Processing"))
45 {
46 if (!inner.get()) throw std::runtime_error("[SpectrumListWrapper] Null SpectrumListPtr.");
47 }

Member Function Documentation

◆ size()

virtual size_t pwiz::msdata::SpectrumListWrapper::size ( ) const
inlinevirtual

returns the number of spectra

Implements pwiz::msdata::SpectrumList.

Reimplemented in pwiz::analysis::SpectrumList_Demux, pwiz::analysis::SpectrumList_Filter, pwiz::analysis::SpectrumList_ScanSummer, and pwiz::analysis::SpectrumList_Sorter.

Definition at line 49 of file SpectrumListWrapper.hpp.

49{return inner_->size();}

Referenced by test().

◆ empty()

virtual bool pwiz::msdata::SpectrumListWrapper::empty ( ) const
inlinevirtual

returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)

Reimplemented from pwiz::msdata::SpectrumList.

Definition at line 50 of file SpectrumListWrapper.hpp.

50{return size() == 0;}
virtual size_t size() const
returns the number of spectra

◆ spectrumIdentity()

virtual const SpectrumIdentity & pwiz::msdata::SpectrumListWrapper::spectrumIdentity ( size_t  index) const
inlinevirtual

access to a spectrum index

Implements pwiz::msdata::SpectrumList.

Reimplemented in pwiz::analysis::SpectrumList_Demux, pwiz::analysis::SpectrumList_Filter, pwiz::analysis::SpectrumList_ScanSummer, and pwiz::analysis::SpectrumList_Sorter.

Definition at line 51 of file SpectrumListWrapper.hpp.

51{return inner_->spectrumIdentity(index);}

◆ spectrum() [1/2]

virtual SpectrumPtr pwiz::msdata::SpectrumListWrapper::spectrum ( size_t  index,
bool  getBinaryData = false 
) const
pure virtual

◆ spectrum() [2/2]

virtual SpectrumPtr pwiz::msdata::SpectrumListWrapper::spectrum ( size_t  index,
DetailLevel  detailLevel 
) const
inlinevirtual

retrieve a spectrum by index

  • detailLevel determines what fields are guaranteed present on the spectrum after the call
  • client may assume the underlying Spectrum* is valid

Reimplemented from pwiz::msdata::SpectrumList.

Reimplemented in pwiz::analysis::SpectrumList_Demux, pwiz::analysis::SpectrumList_Filter, pwiz::analysis::SpectrumList_LockmassRefiner, pwiz::analysis::SpectrumList_PeakPicker, pwiz::analysis::SpectrumList_PeakFilter, and pwiz::analysis::SpectrumList_ScanSummer.

Definition at line 56 of file SpectrumListWrapper.hpp.

56{return spectrum(index, detailLevel == DetailLevel_FullData);}
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const =0
retrieve a spectrum by index
@ DetailLevel_FullData
Definition MSData.hpp:635

References pwiz::msdata::DetailLevel_FullData, and spectrum().

Referenced by spectrum().

◆ dataProcessingPtr()

virtual const boost::shared_ptr< const DataProcessing > pwiz::msdata::SpectrumListWrapper::dataProcessingPtr ( ) const
inlinevirtual

returns the data processing affecting spectra retrieved through this interface

  • may return a null shared pointer

Reimplemented from pwiz::msdata::SpectrumList.

Definition at line 58 of file SpectrumListWrapper.hpp.

58{return dp_;}

◆ inner()

SpectrumListPtr pwiz::msdata::SpectrumListWrapper::inner ( ) const
inline

Definition at line 60 of file SpectrumListWrapper.hpp.

60{return inner_;}

◆ innermost()

SpectrumListPtr pwiz::msdata::SpectrumListWrapper::innermost ( ) const
inline

Definition at line 62 of file SpectrumListWrapper.hpp.

63 {
64 if(dynamic_cast<SpectrumListWrapper*>(&*inner_))
65 return dynamic_cast<SpectrumListWrapper*>(&*inner_)->innermost();
66 else
67 return inner();
68 }
SpectrumListWrapper(const SpectrumListPtr &inner)

Member Data Documentation

◆ inner_

SpectrumListPtr pwiz::msdata::SpectrumListWrapper::inner_
protected

Definition at line 72 of file SpectrumListWrapper.hpp.

◆ dp_

DataProcessingPtr pwiz::msdata::SpectrumListWrapper::dp_
protected

Definition at line 73 of file SpectrumListWrapper.hpp.


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