00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // -------------------------------------------------------------------------- 00005 // OpenMS Mass Spectrometry Framework 00006 // -------------------------------------------------------------------------- 00007 // Copyright (C) 2003-2008 -- Oliver Kohlbacher, Knut Reinert 00008 // 00009 // This library is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU Lesser General Public 00011 // License as published by the Free Software Foundation; either 00012 // version 2.1 of the License, or (at your option) any later version. 00013 // 00014 // This library is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 // Lesser General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU Lesser General Public 00020 // License along with this library; if not, write to the Free Software 00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 // 00023 // -------------------------------------------------------------------------- 00024 // $Maintainer: Andreas Bertsch $ 00025 // -------------------------------------------------------------------------- 00026 00027 #ifndef OPENMS_COMPARISON_CLUSTERING_BINNEDREP_H 00028 #define OPENMS_COMPARISON_CLUSTERING_BINNEDREP_H 00029 00030 #include <vector> 00031 #include <OpenMS/KERNEL/StandardTypes.h> 00032 #include <OpenMS/DATASTRUCTURES/SparseVector.h> 00033 00034 00035 namespace OpenMS 00036 { 00037 typedef double intensity; 00052 class BinnedRep 00053 { 00054 public: 00055 typedef SparseVector::const_iterator const_iterator; 00056 typedef SparseVector::iterator iterator; 00057 typedef SparseVector::const_iterator ConstIterator; 00058 typedef SparseVector::iterator Iterator; 00059 00063 00064 BinnedRep(); 00065 00067 BinnedRep(double, uint = 0); 00068 00070 BinnedRep(const PeakSpectrum& spec, double binsize = 1.0, uint binspread = 0); 00071 00073 BinnedRep(const BinnedRep& source); 00074 00076 virtual ~BinnedRep(); 00078 00082 00083 BinnedRep& operator = (const BinnedRep& source); 00084 00086 uint id() const{ return id_;} 00087 00089 double getBinSize() const{ return binsize_;} 00090 00092 double max() const{return end_;} 00093 00095 double min() const{return begin_;} 00096 00098 double getRT() const { return retention_;} 00099 00101 unsigned int getBinSpread() const {return spread_;} 00102 00104 double getParentmz() const { return parent_m_z_;} 00105 00107 unsigned int getPrecursorPeakCharge() const {return precursorpeakcharge_;} 00108 00110 unsigned int size() const {return bins_.size();} 00111 00113 String str() const; 00114 00116 Iterator begin() { return bins_.begin();} 00117 00119 Iterator end() { return bins_.end();} 00120 00122 ConstIterator begin() const{ return bins_.begin();} 00123 00125 ConstIterator end() const{ return bins_.end();} 00126 00128 intensity operator[] (int) const; 00130 // 00132 friend void operator << (BinnedRep& bin_rep, const PeakSpectrum& spec); 00133 00135 void normalize(); 00136 00137 private: 00138 00140 SparseVector bins_; 00141 00143 double binsize_; 00144 00146 unsigned int spread_; 00147 00149 double begin_; 00150 00152 double end_; 00153 00155 unsigned int id_; 00156 00158 double retention_; 00159 00161 double parent_m_z_; 00162 00164 unsigned int precursorpeakcharge_; 00165 00167 void clear_(); 00168 00169 }; 00170 } 00171 00172 #endif //OPENMS_COMPARISON_CLUSTERING_BINNEDREP_H
Generated Tue Apr 1 15:36:33 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |