ProteoWizard
Public Member Functions | List of all members
EvenMS2Predicate Struct Reference
Inheritance diagram for EvenMS2Predicate:
pwiz::analysis::SpectrumList_Filter::Predicate

Public Member Functions

virtual tribool accept (const SpectrumIdentity &spectrumIdentity) const
 return values: true: accept the Spectrum false: reject the Spectrum indeterminate: need to see the full Spectrum object to decide More...
 
virtual tribool accept (const Spectrum &spectrum) const
 return true iff Spectrum is accepted More...
 
- Public Member Functions inherited from pwiz::analysis::SpectrumList_Filter::Predicate
virtual msdata::DetailLevel suggestedDetailLevel () const
 can be overridden in subclasses that know they will need a certain detail level; it must be overridden to return DetailLevel_FullData if binary data is needed More...
 
virtual bool done () const
 return true iff done accepting spectra; this allows early termination of the iteration through the original SpectrumList, possibly using assumptions about the order of the iteration (e.g. More...
 
virtual ~Predicate ()
 

Detailed Description

Definition at line 179 of file SpectrumList_FilterTest.cpp.

Member Function Documentation

§ accept() [1/2]

virtual tribool EvenMS2Predicate::accept ( const SpectrumIdentity spectrumIdentity) const
inlinevirtual

return values: true: accept the Spectrum false: reject the Spectrum indeterminate: need to see the full Spectrum object to decide

Implements pwiz::analysis::SpectrumList_Filter::Predicate.

Definition at line 181 of file SpectrumList_FilterTest.cpp.

References pwiz::msdata::SpectrumIdentity::index.

182  {
183  if (spectrumIdentity.index%2 != 0) return false;
184  return boost::logic::indeterminate;
185  }
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
Definition: MSData.hpp:472

§ accept() [2/2]

virtual tribool EvenMS2Predicate::accept ( const Spectrum spectrum) const
inlinevirtual

return true iff Spectrum is accepted

Reimplemented from pwiz::analysis::SpectrumList_Filter::Predicate.

Definition at line 187 of file SpectrumList_FilterTest.cpp.

References pwiz::data::CVParam::cvid, CVID_Unknown, pwiz::cv::cvIsA(), pwiz::data::ParamContainer::cvParam(), pwiz::data::ParamContainer::cvParamChild(), MS_mass_spectrum, MS_ms_level, MS_spectrum_type, and pwiz::data::CVParam::valueAs().

188  {
189  CVParam param = spectrum.cvParamChild(MS_spectrum_type);
190  if (param.cvid == CVID_Unknown) return boost::logic::indeterminate;
191  if (!cvIsA(param.cvid, MS_mass_spectrum))
192  return true; // MS level filter doesn't affect non-MS spectra
193 
194  param = spectrum.cvParam(MS_ms_level);
195  if (param.cvid == CVID_Unknown) return boost::logic::indeterminate;
196 
197  return (param.valueAs<int>() == 2);
198  }
CVParam cvParam(CVID cvid) const
finds cvid in the container:
MS_mass_spectrum
mass spectrum: A plot of the relative abundance of a beam or other collection of ions as a function o...
Definition: cv.hpp:1291
MS_ms_level
ms level: Stages of ms achieved in a multi stage mass spectrometry experiment.
Definition: cv.hpp:1987
MS_spectrum_type
spectrum type: Spectrum type.
Definition: cv.hpp:2134
CVID_Unknown
Definition: cv.hpp:97
CVParam cvParamChild(CVID cvid) const
finds child of cvid in the container:
value_type valueAs() const
templated value access with type conversion
Definition: ParamTypes.hpp:112
PWIZ_API_DECL bool cvIsA(CVID child, CVID parent)
returns true iff child IsA parent in the CV
represents a tag-value pair, where the tag comes from the controlled vocabulary
Definition: ParamTypes.hpp:44

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