OpenMS
Loading...
Searching...
No Matches
FragmentIonLikelihoodModel::PeakLists Class Reference

Compact peak lists of the spectra of one run: per peak only its m/z and its intensity-rank bin. More...

#include <OpenMS/ANALYSIS/ID/FragmentIonLikelihoodModel.h>

Public Member Functions

void reset (Size spectra)
 Remove all peak lists and make room for spectra empty ones.
 
void clear ()
 Remove all peak lists and release their memory.
 
Size size () const
 Number of peak lists (spectra)
 
void assign (Size index, const MSSpectrum &spectrum)
 Store the peaks of spectrum as list index, replacing what was there.
 
Size peaks (Size index) const
 Number of peaks of list index.
 
double mz (Size index, Size peak) const
 m/z of peak peak of list index
 
Size rankBin (Size index, Size peak) const
 Intensity-rank bin (see rankBin()) of peak peak of list index.
 
Int findNearest (Size index, double mz, double tolerance) const
 The peak of list index nearest to mz, if it lies within [mz - tolerance, mz + tolerance].
 
Size totalPeaks () const
 Number of peaks over all lists.
 
Size memoryUsage () const
 Bytes held by the peak lists (peak data, list headers)
 

Private Attributes

std::vector< std::vector< float > > mz_
 m/z per peak, ascending, per spectrum
 
std::vector< std::vector< std::uint8_t > > rank_bins_
 intensity-rank bin per peak, per spectrum
 

Detailed Description

Compact peak lists of the spectra of one run: per peak only its m/z and its intensity-rank bin.

Five bytes per peak (m/z as float, rank bin as byte) instead of a copy of the spectra, so the peak lists of a whole run can be kept from preprocessing until the PSMs are annotated. The float m/z deviates from the double by at most 0.06 ppm, far below any fragment tolerance.

Member Function Documentation

◆ assign()

void assign ( Size  index,
const MSSpectrum &  spectrum 
)

Store the peaks of spectrum as list index, replacing what was there.

The intensity ranks are taken among the peaks of spectrum (1 = most intense; ties by ascending m/z). Different indices may be assigned concurrently.

Exceptions
Exception::IndexOverflowif index is not below size()
Exception::IllegalArgumentif spectrum is not sorted by m/z

Referenced by NuXLIonLikelihood::setSpectra().

◆ clear()

void clear ( )

Remove all peak lists and release their memory.

◆ findNearest()

Int findNearest ( Size  index,
double  mz,
double  tolerance 
) const

The peak of list index nearest to mz, if it lies within [mz - tolerance, mz + tolerance].

Same rule as MSSpectrum::findNearest(mz, tolerance): of two equally near peaks the lower one.

Returns
the peak index, or -1

◆ memoryUsage()

Size memoryUsage ( ) const

Bytes held by the peak lists (peak data, list headers)

◆ mz()

double mz ( Size  index,
Size  peak 
) const
inline

m/z of peak peak of list index

◆ peaks()

Size peaks ( Size  index) const
inline

Number of peaks of list index.

Referenced by NuXLIonLikelihood::matchHypothesis_().

◆ rankBin()

Size rankBin ( Size  index,
Size  peak 
) const
inline

Intensity-rank bin (see rankBin()) of peak peak of list index.

◆ reset()

void reset ( Size  spectra)

Remove all peak lists and make room for spectra empty ones.

Referenced by NuXLIonLikelihood::setSpectra().

◆ size()

Size size ( ) const
inline

Number of peak lists (spectra)

Referenced by NuXLIonLikelihood::matchHypothesis_().

◆ totalPeaks()

Size totalPeaks ( ) const

Number of peaks over all lists.

Member Data Documentation

◆ mz_

std::vector<std::vector<float> > mz_
private

m/z per peak, ascending, per spectrum

◆ rank_bins_

std::vector<std::vector<std::uint8_t> > rank_bins_
private

intensity-rank bin per peak, per spectrum