Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Classes | Public Types | Public Member Functions | Protected 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>

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

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 Types inherited from MSSpectrum<>
typedef Peak1D PeakType
 Peak type. More...
 
typedef PeakType::CoordinateType CoordinateType
 Coordinate (m/z) type. More...
 
typedef std::vector< PeakTypeContainerType
 Spectrum base type. More...
 
typedef std::vector
< FloatDataArray
FloatDataArrays
 Float data array vector type. More...
 
typedef std::vector
< StringDataArray
StringDataArrays
 String data array vector type. More...
 
typedef std::vector
< IntegerDataArray
IntegerDataArrays
 Integer data array vector type. More...
 
typedef ContainerType::iterator Iterator
 Mutable iterator. More...
 
typedef
ContainerType::const_iterator 
ConstIterator
 Non-mutable iterator. More...
 
typedef
ContainerType::reverse_iterator 
ReverseIterator
 Mutable reverse iterator. More...
 
typedef
ContainerType::const_reverse_iterator 
ConstReverseIterator
 Non-mutable reverse iterator. More...
 
- Public Types inherited from RangeManager< 1 >
enum  
 Dimension of the position range. More...
 
typedef DRange< D > PositionRangeType
 Position range type. More...
 
typedef DPosition< D > PositionType
 Position Type. More...
 
typedef DRange< 1 > IntensityRangeType
 Intensity range type. More...
 
- Public Types inherited from SpectrumSettings
enum  SpectrumType { UNKNOWN, PEAKS, RAWDATA, SIZE_OF_SPECTRUMTYPE }
 Spectrum peak type. More...
 

Public Member Functions

 BinnedSpectrum ()
 default constructor More...
 
 BinnedSpectrum (Real 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< Real > & getBins () const
 
SparseVector< Real > & 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...
 
- Public Member Functions inherited from MSSpectrum<>
 MSSpectrum ()
 Constructor. More...
 
 MSSpectrum (const MSSpectrum &source)
 Copy constructor. More...
 
 ~MSSpectrum ()
 Destructor. More...
 
MSSpectrumoperator= (const MSSpectrum &source)
 Assignment operator. More...
 
bool operator== (const MSSpectrum &rhs) const
 Equality operator. More...
 
bool operator!= (const MSSpectrum &rhs) const
 Equality operator. More...
 
virtual void updateRanges ()
 Updates minimum and maximum position/intensity. More...
 
void clear (bool clear_meta_data)
 Clears all data and meta data. More...
 
DoubleReal getRT () const
 
void setRT (DoubleReal rt)
 Sets the absolute retention time (is seconds) More...
 
UInt getMSLevel () const
 Returns the MS level. More...
 
void setMSLevel (UInt ms_level)
 Sets the MS level. More...
 
const StringgetName () const
 Returns the name. More...
 
void setName (const String &name)
 Sets the name. More...
 
const FloatDataArraysgetFloatDataArrays () const
 Returns a const reference to the float meta data arrays. More...
 
FloatDataArraysgetFloatDataArrays ()
 Returns a mutable reference to the float meta data arrays. More...
 
const StringDataArraysgetStringDataArrays () const
 Returns a const reference to the string meta data arrays. More...
 
StringDataArraysgetStringDataArrays ()
 Returns a mutable reference to the string meta data arrays. More...
 
const IntegerDataArraysgetIntegerDataArrays () const
 Returns a const reference to the integer meta data arrays. More...
 
IntegerDataArraysgetIntegerDataArrays ()
 Returns a mutable reference to the integer meta data arrays. More...
 
void sortByIntensity (bool reverse=false)
 Lexicographically sorts the peaks by their intensity. More...
 
void sortByPosition ()
 Lexicographically sorts the peaks by their position. More...
 
bool isSorted () const
 Checks if all peaks are sorted with respect to ascending m/z. More...
 
Size findNearest (CoordinateType mz) const
 Binary search for the peak nearest to a specific m/z. More...
 
Iterator MZBegin (CoordinateType mz)
 Binary search for peak range begin. More...
 
Iterator MZBegin (Iterator begin, CoordinateType mz, Iterator end)
 Binary search for peak range begin. More...
 
ConstIterator MZBegin (CoordinateType mz) const
 Binary search for peak range begin. More...
 
ConstIterator MZBegin (ConstIterator begin, CoordinateType mz, ConstIterator end) const
 Binary search for peak range begin. More...
 
Iterator MZEnd (CoordinateType mz)
 Binary search for peak range end (returns the past-the-end iterator) More...
 
Iterator MZEnd (Iterator begin, CoordinateType mz, Iterator end)
 Binary search for peak range end (returns the past-the-end iterator) More...
 
ConstIterator MZEnd (CoordinateType mz) const
 Binary search for peak range end (returns the past-the-end iterator) More...
 
ConstIterator MZEnd (ConstIterator begin, CoordinateType mz, ConstIterator end) const
 Binary search for peak range end (returns the past-the-end iterator) More...
 
- Public Member Functions inherited from RangeManager< 1 >
 RangeManager ()
 Default constructor. More...
 
 RangeManager (const RangeManager &rhs)
 Copy constructor. More...
 
virtual ~RangeManager ()
 Destructor. More...
 
RangeManageroperator= (const RangeManager &rhs)
 Assignment operator. More...
 
bool operator== (const RangeManager &rhs) const
 Equality operator. More...
 
bool operator!= (const RangeManager &rhs) const
 Equality operator. More...
 
const PositionTypegetMin () const
 Returns the minimum position. More...
 
const PositionTypegetMax () const
 Returns the maximum position. More...
 
DoubleReal getMinInt () const
 Returns the minimum intensity. More...
 
DoubleReal getMaxInt () const
 Returns the maximum intensity. More...
 
void clearRanges ()
 Resets the ranges. More...
 
- Public Member Functions inherited from SpectrumSettings
 SpectrumSettings ()
 Constructor. More...
 
 SpectrumSettings (const SpectrumSettings &source)
 Copy constructor. More...
 
 ~SpectrumSettings ()
 Destructor. More...
 
SpectrumSettingsoperator= (const SpectrumSettings &source)
 
bool operator== (const SpectrumSettings &rhs) const
 Equality operator. More...
 
bool operator!= (const SpectrumSettings &rhs) const
 Equality operator. More...
 
void unify (const SpectrumSettings &rhs)
 merge another spectrum setting into this one (data is usually appended, except for spectrum type which needs to be unambiguous to be kept) More...
 
SpectrumType getType () const
 returns the spectrum type More...
 
void setType (SpectrumType type)
 sets the spectrum type More...
 
const StringgetNativeID () const
 returns the native identifier for the spectrum, used by the acquisition software. More...
 
void setNativeID (const String &native_id)
 sets the native identifier for the spectrum, used by the acquisition software. More...
 
const StringgetComment () const
 returns the free-text comment More...
 
void setComment (const String &comment)
 sets the free-text comment More...
 
const InstrumentSettingsgetInstrumentSettings () const
 returns a const reference to the instrument settings of the current spectrum More...
 
InstrumentSettingsgetInstrumentSettings ()
 returns a mutable reference to the instrument settings of the current spectrum More...
 
void setInstrumentSettings (const InstrumentSettings &instrument_settings)
 sets the instrument settings of the current spectrum More...
 
const AcquisitionInfogetAcquisitionInfo () const
 returns a const reference to the acquisition info More...
 
AcquisitionInfogetAcquisitionInfo ()
 returns a mutable reference to the acquisition info More...
 
void setAcquisitionInfo (const AcquisitionInfo &acquisition_info)
 sets the acquisition info More...
 
const SourceFilegetSourceFile () const
 returns a const reference to the source file More...
 
SourceFilegetSourceFile ()
 returns a mutable reference to the source file More...
 
void setSourceFile (const SourceFile &source_file)
 sets the source file More...
 
const std::vector< Precursor > & getPrecursors () const
 returns a const reference to the precursors More...
 
std::vector< Precursor > & getPrecursors ()
 returns a mutable reference to the precursors More...
 
void setPrecursors (const std::vector< Precursor > &precursors)
 sets the precursors More...
 
const std::vector< Product > & getProducts () const
 returns a const reference to the products More...
 
std::vector< Product > & getProducts ()
 returns a mutable reference to the products More...
 
void setProducts (const std::vector< Product > &products)
 sets the products More...
 
const std::vector
< PeptideIdentification > & 
getPeptideIdentifications () const
 returns a const reference to the PeptideIdentification vector More...
 
std::vector
< PeptideIdentification > & 
getPeptideIdentifications ()
 returns a mutable reference to the PeptideIdentification vector More...
 
void setPeptideIdentifications (const std::vector< PeptideIdentification > &identifications)
 sets the PeptideIdentification vector More...
 
const std::vector
< DataProcessing > & 
getDataProcessing () const
 returns a const reference to the description of the applied processing More...
 
std::vector< DataProcessing > & getDataProcessing ()
 returns a mutable reference to the description of the applied processing More...
 
void setDataProcessing (const std::vector< DataProcessing > &data_processing)
 sets the description of the applied processing More...
 
- Public Member Functions inherited from MetaInfoInterface
 MetaInfoInterface ()
 constructor More...
 
 MetaInfoInterface (const MetaInfoInterface &rhs)
 copy constructor More...
 
 ~MetaInfoInterface ()
 destructor More...
 
MetaInfoInterfaceoperator= (const MetaInfoInterface &rhs)
 assignment operator More...
 
bool operator== (const MetaInfoInterface &rhs) const
 Equality operator. More...
 
bool operator!= (const MetaInfoInterface &rhs) const
 Equality operator. More...
 
const DataValuegetMetaValue (const String &name) const
 returns the value corresponding to a string More...
 
const DataValuegetMetaValue (UInt index) const
 returns the value corresponding to an index More...
 
bool metaValueExists (const String &name) const
 returns if this MetaInfo is set More...
 
bool metaValueExists (UInt index) const
 returns if this MetaInfo is set More...
 
void setMetaValue (const String &name, const DataValue &value)
 sets the DataValue corresponding to a name More...
 
void setMetaValue (UInt index, const DataValue &value)
 sets the DataValue corresponding to an index More...
 
void removeMetaValue (const String &name)
 Removes the DataValue corresponding to name if it exists. More...
 
void removeMetaValue (UInt index)
 Removes the DataValue corresponding to index if it exists. More...
 
void getKeys (std::vector< String > &keys) const
 fills the given vector with a list of all keys for which a value is set More...
 
void getKeys (std::vector< UInt > &keys) const
 fills the given vector with a list of all keys for which a value is set More...
 
bool isMetaEmpty () const
 returns if the MetaInfo is empty More...
 
void clearMetaInfo ()
 removes all meta values More...
 
- Public Member Functions inherited from PersistentObject
 PersistentObject ()
 Default constructor. More...
 
virtual ~PersistentObject ()
 Destructor. More...
 
PersistentObjectoperator= (const PersistentObject &rhs)
 Assignment operator. More...
 
const UIDgetPersistenceId () const
 Returns the persistence id. More...
 
void setPersistenceId (const UID &persistence_id)
 Sets the persistence id. More...
 
void clearId (bool deep=true)
 Clears the persistence id. More...
 

Protected Member Functions

virtual void clearChildIds_ ()
 Clears the persistence id of all sub-objects. More...
 
- Protected Member Functions inherited from RangeManager< 1 >
void updateRanges_ (const PeakIteratorType &begin, const PeakIteratorType &end)
 Updates the range using data points in the iterator range. More...
 
- Protected Member Functions inherited from MetaInfoInterface
void createIfNotExists_ ()
 creates the MetaInfo object if it does not exist More...
 

Private Attributes

UInt bin_spread_
 
Real bin_size_
 
SparseVector< Realbins_
 

Additional Inherited Members

- Static Public Member Functions inherited from MetaInfoInterface
static MetaInfoRegistrymetaRegistry ()
 retuns a reference to the MetaInfoRegistry More...
 
- Public Attributes inherited from vector< T >
elements
 STL member. More...
 
- Static Public Attributes inherited from SpectrumSettings
static const std::string NamesOfSpectrumType [SIZE_OF_SPECTRUMTYPE]
 Names of spectrum types. More...
 
- Protected Attributes inherited from MSSpectrum<>
DoubleReal retention_time_
 Retention time. More...
 
UInt ms_level_
 MS level. More...
 
String name_
 Name. More...
 
FloatDataArrays float_data_arrays_
 Float data arrays. More...
 
StringDataArrays string_data_arrays_
 String data arrays. More...
 
IntegerDataArrays integer_data_arrays_
 Intager data arrays. More...
 
- Protected Attributes inherited from RangeManager< 1 >
IntensityRangeType int_range_
 Intensity range (1-dimensional) More...
 
PositionRangeType pos_range_
 Position range (D-dimensional) More...
 
- Protected Attributes inherited from SpectrumSettings
SpectrumType type_
 
String native_id_
 
String comment_
 
InstrumentSettings instrument_settings_
 
SourceFile source_file_
 
AcquisitionInfo acquisition_info_
 
std::vector< Precursorprecursors_
 
std::vector< Productproducts_
 
std::vector
< PeptideIdentification
identification_
 
std::vector< DataProcessingdata_processing_
 
- Protected Attributes inherited from MetaInfoInterface
MetaInfometa_
 pointer to the MetaInfo object. 0 by default More...
 
- Protected Attributes inherited from PersistentObject
UID persistence_id_
 A persistence id used to refer the data back to the source. 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

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

Constructor & Destructor Documentation

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_ ( )
inlineprotectedvirtual

Clears the persistence id of all sub-objects.

Reimplemented from MSSpectrum<>.

const_bin_iterator end ( ) const
inline

returns the const end iterator of the container

bin_iterator end ( )
inline

returns the 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
NoSpectrumIntegratedis thrown if no spectrum was integrated

Referenced by BinnedSpectrum::operator=().

SparseVector<Real>& getBins ( )
inline

mutable access to the Bincontainer

Exceptions
NoSpectrumIntegratedis 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 BinnedSpectrum source)
inline
BinnedSpectrum& operator= ( const PeakSpectrum source)
inline

assignment operator for PeakSpectra

References MSSpectrum< PeakT >::operator=().

bool operator== ( const BinnedSpectrum rhs) const
inline
bool operator== ( const PeakSpectrum rhs) const
inline

equality operator for PeakSpectra

References MSSpectrum< PeakT >::operator==().

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
void setBinSize ( double  s)
inline

sets the BinSize_ (and rebinnes)

Parameters
sdefines the size of the bins
Exceptions
NoSpectrumIntegratedis thrown if no spectrum is integrated
void setBinSpread ( UInt  s)
inline

sets the BinSpread_ (and rebinnes)

Parameters
sdefines the binning spread, given as positive integer
Exceptions
NoSpectrumIntegratedis 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.11.1 Documentation generated on Thu Nov 14 2013 11:19:28 using doxygen 1.8.5