Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Attributes

BinnedSpectrum Class Reference
[Spectrum Comparison]

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

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

Inheritance diagram for BinnedSpectrum:
MSSpectrum<> RangeManager< 1 > SpectrumSettings PersistentObject MetaInfoInterface

List of all members.

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< Real >
::const_iterator 
const_bin_iterator
typedef SparseVector< Real >
::iterator 
bin_iterator

Public Member Functions

 BinnedSpectrum ()
 default constructor
 BinnedSpectrum (Real size, UInt spread, PeakSpectrum ps)
 detailed constructor
 BinnedSpectrum (const BinnedSpectrum &source)
 copy constructor
virtual ~BinnedSpectrum ()
 destructor
BinnedSpectrumoperator= (const BinnedSpectrum &source)
 assignment operator
BinnedSpectrumoperator= (const PeakSpectrum &source)
 assignment operator for PeakSpectra
bool operator== (const BinnedSpectrum &rhs) const
 equality operator
bool operator!= (const BinnedSpectrum &rhs) const
 inequality operator
bool operator== (const PeakSpectrum &rhs) const
 equality operator for PeakSpectra
bool operator!= (const PeakSpectrum &rhs) const
 inequality operator for PeakSpectra
double getBinSize () const
 get the BinSize
UInt getBinSpread () const
 get the BinSpread
UInt getBinNumber () const
 get the BinNumber, number of Bins
UInt getFilledBinNumber () const
 get the FilledBinNumber, number of filled Bins
const SparseVector< Real > & getBins () const
SparseVector< Real > & getBins ()
const_bin_iterator begin () const
 returns the const begin iterator of the container
const_bin_iterator end () const
 returns the const end iterator of the container
bin_iterator begin ()
 returns the begin iterator of the container
bin_iterator end ()
 returns the end iterator of the container
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

Protected Member Functions

virtual void clearChildIds_ ()
 Clears the persistence id of all sub-objects.

Private Attributes

UInt bin_spread_
Real bin_size_
SparseVector< Realbins_

Detailed Description

This is a binned representation of a PeakSpectrum.

Parameters:
sz the size of the bins and
sp number of neighboring bins to both sides affected by a peak contribution
ps the 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

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

Constructor & Destructor Documentation

BinnedSpectrum (  ) 

default constructor

BinnedSpectrum ( Real  size,
UInt  spread,
PeakSpectrum  ps 
)

detailed constructor

BinnedSpectrum ( const BinnedSpectrum source  ) 

copy constructor

virtual ~BinnedSpectrum (  )  [virtual]

destructor


Member Function Documentation

const_bin_iterator begin (  )  const [inline]

returns the const begin iterator of the container

bin_iterator begin (  )  [inline]

returns the begin iterator of the container

bool checkCompliance ( const BinnedSpectrum bs  )  const

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

virtual void clearChildIds_ (  )  [inline, protected, virtual]

Clears the persistence id of all sub-objects.

Reimplemented from MSSpectrum<>.

bin_iterator end (  )  [inline]

returns the end iterator of the container

const_bin_iterator end (  )  const [inline]

returns the const end iterator of the container

UInt getBinNumber (  )  const [inline]

get the BinNumber, number of Bins

const SparseVector<Real>& getBins (  )  const [inline]

unmutable access to the Bincontainer

Exceptions:
NoSpectrumIntegrated is thrown if no spectrum was integrated

Referenced by BinnedSpectrum::operator=().

SparseVector<Real>& getBins (  )  [inline]

mutable access to the Bincontainer

Exceptions:
NoSpectrumIntegrated is thrown if no spectrum was integrated
double getBinSize (  )  const [inline]

get the BinSize

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

UInt getBinSpread (  )  const [inline]

get the BinSpread

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

UInt getFilledBinNumber (  )  const [inline]

get the FilledBinNumber, number of filled Bins

bool operator!= ( const BinnedSpectrum rhs  )  const [inline]

inequality operator

bool operator!= ( const PeakSpectrum rhs  )  const [inline]

inequality operator for PeakSpectra

BinnedSpectrum& operator= ( const PeakSpectrum source  )  [inline]

assignment operator for PeakSpectra

BinnedSpectrum& operator= ( const BinnedSpectrum source  )  [inline]
bool operator== ( const PeakSpectrum rhs  )  const [inline]

equality operator for PeakSpectra

bool operator== ( const BinnedSpectrum rhs  )  const [inline]
void setBinning (  ) 

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

Exceptions:
NoSpectrumIntegrated is thrown if no spectrum was integrated before
void setBinSize ( double  s  )  [inline]

sets the BinSize_ (and rebinnes)

Parameters:
s defines the size of the bins
Exceptions:
NoSpectrumIntegrated is thrown if no spectrum is integrated
void setBinSpread ( UInt  s  )  [inline]

sets the BinSpread_ (and rebinnes)

Parameters:
s defines the binning spread, given as positive integer
Exceptions:
NoSpectrumIntegrated is thrown if no spec was integrated into the instance

Member Data Documentation

Real bin_size_ [private]
UInt bin_spread_ [private]
SparseVector<Real> bins_ [private]

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:50 using doxygen 1.7.1