ProteoWizard
Public Member Functions | Private Attributes | List of all members
pwiz::analysis::SpectrumPeakExtractor Class Reference

Extracts sets of centroided peaks from spectra using a user-defined list of peaks to extract. More...

#include <SpectrumPeakExtractor.hpp>

Public Member Functions

 SpectrumPeakExtractor (const std::vector< double > &peakMzList, const pwiz::chemistry::MZTolerance &massError)
 Generates a SpectrumPeakExtractor. More...
 
void operator() (msdata::Spectrum_const_ptr spectrum, MatrixType &matrix, size_t rowNum, double weight=1.0) const
 Extracts centroided peaks from an input spectrum. More...
 
size_t numPeaks () const
 Returns the number of peaks extracted. More...
 

Private Attributes

boost::shared_array< std::pair< double, double > > _ranges
 defines the set of m/z windows to search, one for each peak in the search list. More...
 
size_t _numPeakBins
 the number of peaks given in the search list peakMzList. This is also the number of centroids that will be output. More...
 
double _maxDelta
 the m/z half-window size to bin around a peak based on the set ppm error. More...
 
double _minValue
 the minimum m/z that will be searched for peaks across the full m/z range. More...
 
double _maxValue
 the maximum m/z that will be searched for peaks across the full m/z range. More...
 

Detailed Description

Extracts sets of centroided peaks from spectra using a user-defined list of peaks to extract.

Definition at line 33 of file SpectrumPeakExtractor.hpp.

Constructor & Destructor Documentation

◆ SpectrumPeakExtractor()

pwiz::analysis::SpectrumPeakExtractor::SpectrumPeakExtractor ( const std::vector< double > &  peakMzList,
const pwiz::chemistry::MZTolerance massError 
)

Generates a SpectrumPeakExtractor.

Parameters
peakMzListThe m/z values around which will be searched to centroid peaks. The size of this list defines how many peak centroids will be output.
ppmErrorThe tolerance that defines how far around a nominal peak to search relative to its m/z.
Precondition
The peakMzList must be sorted from smallest to largest mz values with no duplicates.

Member Function Documentation

◆ operator()()

void pwiz::analysis::SpectrumPeakExtractor::operator() ( msdata::Spectrum_const_ptr  spectrum,
MatrixType matrix,
size_t  rowNum,
double  weight = 1.0 
) const

Extracts centroided peaks from an input spectrum.

The peaks extracted are chosen from the peakMzList provided during initialization of the SpectrumPeakExtractor. Peaks are extracted to a user-defined row of a user-provided matrix.

Parameters
[in]spectrumSpectrum from which peaks are searched and binned.
[out]matrixThe matrix into which peaks will be extracted.
[in]rowNumThe index of the matrix row to extract peaks to.
[in]weightThe relative weight to apply to this row (multiplies the output row by the given scalar).
Precondition
The size of the output matrix row must be the same as the size of the peakMzList given during instantiation.

◆ numPeaks()

size_t pwiz::analysis::SpectrumPeakExtractor::numPeaks ( ) const

Returns the number of peaks extracted.

Referenced by SpectrumPeakExtractorTest::ExtractPeaksTest().

Member Data Documentation

◆ _ranges

boost::shared_array< std::pair<double, double> > pwiz::analysis::SpectrumPeakExtractor::_ranges
private

defines the set of m/z windows to search, one for each peak in the search list.

Definition at line 59 of file SpectrumPeakExtractor.hpp.

◆ _numPeakBins

size_t pwiz::analysis::SpectrumPeakExtractor::_numPeakBins
private

the number of peaks given in the search list peakMzList. This is also the number of centroids that will be output.

Definition at line 61 of file SpectrumPeakExtractor.hpp.

◆ _maxDelta

double pwiz::analysis::SpectrumPeakExtractor::_maxDelta
private

the m/z half-window size to bin around a peak based on the set ppm error.

Definition at line 63 of file SpectrumPeakExtractor.hpp.

◆ _minValue

double pwiz::analysis::SpectrumPeakExtractor::_minValue
private

the minimum m/z that will be searched for peaks across the full m/z range.

Definition at line 65 of file SpectrumPeakExtractor.hpp.

◆ _maxValue

double pwiz::analysis::SpectrumPeakExtractor::_maxValue
private

the maximum m/z that will be searched for peaks across the full m/z range.

Definition at line 67 of file SpectrumPeakExtractor.hpp.


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