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... | |
BinnedSpectrum & | operator= (const BinnedSpectrum &source) |
assignment operator More... | |
BinnedSpectrum & | operator= (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 PeakSpectrum & | getRawSpectrum () const |
Gives access to the underlying raw spectrum. More... | |
Private Attributes | |
UInt | bin_spread_ |
float | bin_size_ |
SparseVector< float > | bins_ |
The computed bins. More... | |
PeakSpectrum | raw_spec_ |
The original raw spectrum. More... | |
This is a binned representation of a PeakSpectrum.
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.
typedef SparseVector<float>::iterator bin_iterator |
typedef SparseVector<float>::const_iterator const_bin_iterator |
BinnedSpectrum | ( | ) |
default constructor
BinnedSpectrum | ( | float | size, |
UInt | spread, | ||
PeakSpectrum | ps | ||
) |
detailed constructor
BinnedSpectrum | ( | const BinnedSpectrum & | source | ) |
copy constructor
|
virtual |
destructor
|
inline |
returns the const begin iterator of the container
References SparseVector< Value >::begin().
|
inline |
returns the begin iterator of the container
References SparseVector< Value >::begin().
bool checkCompliance | ( | const BinnedSpectrum & | bs | ) | const |
function to check comparability of two BinnedSpectrum objects, i.e. if they have equal bin size and spread
|
inline |
returns the const end iterator of the container
References SparseVector< Value >::end().
|
inline |
returns the end iterator of the container
References SparseVector< Value >::end().
|
inline |
get the BinNumber, number of Bins
References SparseVector< Value >::size().
|
inline |
immutable access to the Bincontainer
NoSpectrumIntegrated | is thrown if no spectrum was integrated |
References SparseVector< Value >::empty().
Referenced by BinnedSpectrum::operator=().
|
inline |
mutable access to the Bincontainer
NoSpectrumIntegrated | is thrown if no spectrum was integrated |
References SparseVector< Value >::empty().
|
inline |
get the BinSize
Referenced by BinnedSpectrum::operator=(), and BinnedSpectrum::operator==().
|
inline |
get the BinSpread
Referenced by BinnedSpectrum::operator=(), and BinnedSpectrum::operator==().
|
inline |
get the FilledBinNumber, number of filled Bins
References SparseVector< Value >::nonzero_size().
const PeakSpectrum& getRawSpectrum | ( | ) | const |
Gives access to the underlying raw spectrum.
|
inline |
inequality operator
References KDTree::operator==().
|
inline |
inequality operator for PeakSpectra
References KDTree::operator==().
|
inline |
assignment operator
References BinnedSpectrum::getBins(), BinnedSpectrum::getBinSize(), BinnedSpectrum::getBinSpread(), and BinnedSpectrum::raw_spec_.
|
inline |
assignment operator for PeakSpectra
|
inline |
equality operator
References BinnedSpectrum::getBinSize(), BinnedSpectrum::getBinSpread(), and BinnedSpectrum::raw_spec_.
|
inline |
equality operator for PeakSpectra
void setBinning | ( | ) |
makes the binning: all Peaks of the containing PeakSpectrum are summed up in the bins corresponding to m/z
ranges
NoSpectrumIntegrated | is thrown if no spectrum was integrated before |
|
inline |
sets the BinSize_ (and re-bins)
s | defines the size of the bins |
NoSpectrumIntegrated | is thrown if no spectrum is integrated |
|
inline |
sets the BinSpread_ (and re-bins)
s | defines the binning spread, given as positive integer |
NoSpectrumIntegrated | is thrown if no spec was integrated into the instance |
|
private |
|
private |
|
private |
The computed bins.
|
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 |