Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
BinnedSpectrum Class Reference

This is a binned representation of a PeakSpectrum. More...

#include <OpenMS/COMPARISON/SPECTRA/BinnedSpectrum.h>

Classes

class  NoSpectrumIntegrated
 Exception which is thrown if BinnedSpectrum bins are accessed and no PeakSpektrum has been integrated yet i.e. bins_ is empty. More...
 

Public Types

typedef SparseVector< float >::const_iterator const_bin_iterator
 
typedef SparseVector< float >::iterator bin_iterator
 

Public Member Functions

 BinnedSpectrum ()
 default constructor More...
 
 BinnedSpectrum (float size, UInt spread, PeakSpectrum ps)
 detailed constructor More...
 
 BinnedSpectrum (const BinnedSpectrum &source)
 copy constructor More...
 
virtual ~BinnedSpectrum ()
 destructor More...
 
BinnedSpectrumoperator= (const BinnedSpectrum &source)
 assignment operator More...
 
BinnedSpectrumoperator= (const PeakSpectrum &source)
 assignment operator for PeakSpectra More...
 
bool operator== (const BinnedSpectrum &rhs) const
 equality operator More...
 
bool operator!= (const BinnedSpectrum &rhs) const
 inequality operator More...
 
bool operator== (const PeakSpectrum &rhs) const
 equality operator for PeakSpectra More...
 
bool operator!= (const PeakSpectrum &rhs) const
 inequality operator for PeakSpectra More...
 
double getBinSize () const
 get the BinSize More...
 
UInt getBinSpread () const
 get the BinSpread More...
 
UInt getBinNumber () const
 get the BinNumber, number of Bins More...
 
UInt getFilledBinNumber () const
 get the FilledBinNumber, number of filled Bins More...
 
const SparseVector< float > & getBins () const
 
SparseVector< float > & getBins ()
 
const_bin_iterator begin () const
 returns the const begin iterator of the container More...
 
const_bin_iterator end () const
 returns the const end iterator of the container More...
 
bin_iterator begin ()
 returns the begin iterator of the container More...
 
bin_iterator end ()
 returns the end iterator of the container More...
 
void setBinSize (double s)
 
void setBinSpread (UInt s)
 
void setBinning ()
 
bool checkCompliance (const BinnedSpectrum &bs) const
 function to check comparability of two BinnedSpectrum objects, i.e. if they have equal bin size and spread More...
 
const PeakSpectrumgetRawSpectrum () const
 Gives access to the underlying raw spectrum. More...
 

Private Attributes

UInt bin_spread_
 
float bin_size_
 
SparseVector< floatbins_
 The computed bins. More...
 
PeakSpectrum raw_spec_
 The original raw spectrum. More...
 

Detailed Description

This is a binned representation of a PeakSpectrum.

Parameters
szthe size of the bins and
spnumber of neighboring bins to both sides affected by a peak contribution
psthe peakspectrum, that shall be represented

sz denotes the size of a bin in Th, thereby deciding the number of bins(all of size sz) the spectrum is discretized to. Each bin will represent a certain Th range and the peaks will be put in the respective bins and sum up inside. sp denotes the number of neighboring bins to the left and the number of neighboring bins to the right a peak is also added to. E.g. a BinnedSpectrum with binsize of 0.5 Th will have a peak at 100 Th in bin no. 200, a peak at 100.1 Th will be in bin no. 201. If the binspread is 1, the peak at 100 Th will be added to bin no. 199, 200 and 201. If the binspread is 2, the peak at 100 Th will also be added to bin no. 198 and 202, and so on.

Member Typedef Documentation

◆ bin_iterator

typedef SparseVector<float>::iterator bin_iterator

◆ const_bin_iterator

typedef SparseVector<float>::const_iterator const_bin_iterator

Constructor & Destructor Documentation

◆ BinnedSpectrum() [1/3]

default constructor

◆ BinnedSpectrum() [2/3]

BinnedSpectrum ( float  size,
UInt  spread,
PeakSpectrum  ps 
)

detailed constructor

◆ BinnedSpectrum() [3/3]

BinnedSpectrum ( const BinnedSpectrum source)

copy constructor

◆ ~BinnedSpectrum()

virtual ~BinnedSpectrum ( )
virtual

destructor

Member Function Documentation

◆ begin() [1/2]

const_bin_iterator begin ( ) const
inline

returns the const begin iterator of the container

References SparseVector< Value >::begin().

◆ begin() [2/2]

bin_iterator begin ( )
inline

returns the begin iterator of the container

References SparseVector< Value >::begin().

◆ checkCompliance()

bool checkCompliance ( const BinnedSpectrum bs) const

function to check comparability of two BinnedSpectrum objects, i.e. if they have equal bin size and spread

◆ end() [1/2]

const_bin_iterator end ( ) const
inline

returns the const end iterator of the container

References SparseVector< Value >::end().

◆ end() [2/2]

bin_iterator end ( )
inline

returns the end iterator of the container

References SparseVector< Value >::end().

◆ getBinNumber()

UInt getBinNumber ( ) const
inline

get the BinNumber, number of Bins

References SparseVector< Value >::size().

◆ getBins() [1/2]

const SparseVector<float>& getBins ( ) const
inline

immutable access to the Bincontainer

Exceptions
NoSpectrumIntegratedis thrown if no spectrum was integrated

References SparseVector< Value >::empty().

Referenced by BinnedSpectrum::operator=().

◆ getBins() [2/2]

SparseVector<float>& getBins ( )
inline

mutable access to the Bincontainer

Exceptions
NoSpectrumIntegratedis thrown if no spectrum was integrated

References SparseVector< Value >::empty().

◆ getBinSize()

double getBinSize ( ) const
inline

get the BinSize

Referenced by BinnedSpectrum::operator=(), and BinnedSpectrum::operator==().

◆ getBinSpread()

UInt getBinSpread ( ) const
inline

get the BinSpread

Referenced by BinnedSpectrum::operator=(), and BinnedSpectrum::operator==().

◆ getFilledBinNumber()

UInt getFilledBinNumber ( ) const
inline

get the FilledBinNumber, number of filled Bins

References SparseVector< Value >::nonzero_size().

◆ getRawSpectrum()

const PeakSpectrum& getRawSpectrum ( ) const

Gives access to the underlying raw spectrum.

◆ operator!=() [1/2]

bool operator!= ( const BinnedSpectrum rhs) const
inline

inequality operator

References KDTree::operator==().

◆ operator!=() [2/2]

bool operator!= ( const PeakSpectrum rhs) const
inline

inequality operator for PeakSpectra

References KDTree::operator==().

◆ operator=() [1/2]

BinnedSpectrum& operator= ( const BinnedSpectrum source)
inline

◆ operator=() [2/2]

BinnedSpectrum& operator= ( const PeakSpectrum source)
inline

assignment operator for PeakSpectra

◆ operator==() [1/2]

bool operator== ( const BinnedSpectrum rhs) const
inline

◆ operator==() [2/2]

bool operator== ( const PeakSpectrum rhs) const
inline

equality operator for PeakSpectra

◆ setBinning()

void setBinning ( )

makes the binning: all Peaks of the containing PeakSpectrum are summed up in the bins corresponding to m/z ranges

Exceptions
NoSpectrumIntegratedis thrown if no spectrum was integrated before

◆ setBinSize()

void setBinSize ( double  s)
inline

sets the BinSize_ (and re-bins)

Parameters
sdefines the size of the bins
Exceptions
NoSpectrumIntegratedis thrown if no spectrum is integrated

◆ setBinSpread()

void setBinSpread ( UInt  s)
inline

sets the BinSpread_ (and re-bins)

Parameters
sdefines the binning spread, given as positive integer
Exceptions
NoSpectrumIntegratedis thrown if no spec was integrated into the instance

Member Data Documentation

◆ bin_size_

float bin_size_
private

◆ bin_spread_

UInt bin_spread_
private

◆ bins_

SparseVector<float> bins_
private

The computed bins.

◆ raw_spec_

PeakSpectrum raw_spec_
private

The original raw spectrum.

Referenced by BinnedSpectrum::operator=(), and BinnedSpectrum::operator==().


OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:07 using doxygen 1.8.13