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...
 
virtual string describe () const
 return a string describing how the predicate filters 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 ()
 

Additional Inherited Members

- Public Types inherited from pwiz::analysis::SpectrumList_Filter::Predicate
enum  FilterMode { FilterMode_Include, FilterMode_Exclude }
 controls whether spectra that pass the predicate are included or excluded from the result More...
 

Detailed Description

Definition at line 211 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 213 of file SpectrumList_FilterTest.cpp.

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

214  {
215  if (spectrumIdentity.index%2 != 0) return false;
216  return boost::logic::indeterminate;
217  }
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
Definition: MSData.hpp:473

◆ 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 219 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().

220  {
221  CVParam param = spectrum.cvParamChild(MS_spectrum_type);
222  if (param.cvid == CVID_Unknown) return boost::logic::indeterminate;
223  if (!cvIsA(param.cvid, MS_mass_spectrum))
224  return false;
225 
226  param = spectrum.cvParam(MS_ms_level);
227  if (param.cvid == CVID_Unknown) return boost::logic::indeterminate;
228 
229  return (param.valueAs<int>() == 2);
230  }
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:1443
MS_ms_level
ms level: Stages of ms achieved in a multi stage mass spectrometry experiment.
Definition: cv.hpp:2139
MS_spectrum_type
spectrum type: Spectrum type.
Definition: cv.hpp:2286
CVID_Unknown
Definition: cv.hpp:114
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

◆ describe()

virtual string EvenMS2Predicate::describe ( ) const
inlinevirtual

return a string describing how the predicate filters

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

Definition at line 232 of file SpectrumList_FilterTest.cpp.

232 { return ""; }

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