Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

PeakPickerCWT.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------------
00002 //                   OpenMS -- Open-Source Mass Spectrometry
00003 // --------------------------------------------------------------------------
00004 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
00005 // ETH Zurich, and Freie Universitaet Berlin 2002-2012.
00006 //
00007 // This software is released under a three-clause BSD license:
00008 //  * Redistributions of source code must retain the above copyright
00009 //    notice, this list of conditions and the following disclaimer.
00010 //  * Redistributions in binary form must reproduce the above copyright
00011 //    notice, this list of conditions and the following disclaimer in the
00012 //    documentation and/or other materials provided with the distribution.
00013 //  * Neither the name of any author or any participating institution
00014 //    may be used to endorse or promote products derived from this software
00015 //    without specific prior written permission.
00016 // For a full list of authors, refer to the file AUTHORS.
00017 // --------------------------------------------------------------------------
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00019 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
00022 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00025 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00027 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00028 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // --------------------------------------------------------------------------
00031 // $Maintainer: Alexandra Zerck $
00032 // $Authors: Eva Lange, Alexandra Zerck $
00033 // --------------------------------------------------------------------------
00034 //
00035 #ifndef OPENMS_TRANSFORMATIONS_RAW2PEAK_PEAKPICKERCWT_H
00036 #define OPENMS_TRANSFORMATIONS_RAW2PEAK_PEAKPICKERCWT_H
00037 
00038 #include <OpenMS/KERNEL/MSExperiment.h>
00039 #include <OpenMS/TRANSFORMATIONS/RAW2PEAK/PeakShape.h>
00040 #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
00041 #include <OpenMS/CONCEPT/ProgressLogger.h>
00042 #include <OpenMS/TRANSFORMATIONS/RAW2PEAK/OptimizePeakDeconvolution.h>
00043 #include <OpenMS/TRANSFORMATIONS/RAW2PEAK/ContinuousWaveletTransform.h>
00044 #include <OpenMS/TRANSFORMATIONS/RAW2PEAK/ContinuousWaveletTransformNumIntegration.h>
00045 
00046 //#define DEBUG_PEAK_PICKING
00047 #undef DEBUG_PEAK_PICKING
00048 //#define DEBUG_DECONV
00049 namespace OpenMS
00050 {
00077   class OPENMS_DLLAPI PeakPickerCWT :
00078     public DefaultParamHandler,
00079     public ProgressLogger
00080   {
00081 public:
00083     typedef MSSpectrum<>::iterator PeakIterator;
00085     typedef MSSpectrum<>::const_iterator ConstPeakIterator;
00086 
00088     PeakPickerCWT();
00089 
00091     virtual ~PeakPickerCWT();
00092 
00098     void pick(const MSSpectrum<> & input, MSSpectrum<> & output);
00099 
00107     void pickExperiment(const MSExperiment<> & input, MSExperiment<> & output);
00108 
00119     DoubleReal estimatePeakWidth(const MSExperiment<> & input);
00120 protected:
00121 
00123     float peak_bound_;
00124 
00126     float peak_bound_ms2_level_;
00127 
00129     float signal_to_noise_;
00130 
00132     float fwhm_bound_;
00133 
00135     UInt radius_;
00136 
00138     float scale_;
00139 
00141     float peak_corr_bound_;
00142 
00144     float noise_level_;
00145 
00147     bool optimization_;
00148 
00150     bool deconvolution_;
00151 
00153     bool two_d_optimization_;
00154 
00155 
00156     void updateMembers_();
00157 
00159     void init_();
00160 
00161 
00168     struct OPENMS_DLLAPI PeakArea_
00169     {
00170       typedef MSSpectrum<>::iterator PeakIterator;
00171 
00181       PeakIterator left;
00182       PeakIterator max;
00183       PeakIterator right;
00184       PeakIterator left_behind_centroid;
00186       DPosition<1> centroid_position;
00187     };
00188 
00189 
00191     void getPeakArea_(const PeakArea_ & area, double & area_left, double & area_right);
00192 
00194     PeakShape fitPeakShape_(const PeakArea_ & area, bool enable_centroid_fit);
00195 
00202     double correlate_(const PeakShape & peak, const PeakArea_ & area, Int direction = 0) const;
00203 
00204 
00213     bool getMaxPosition_(PeakIterator first, PeakIterator last, const ContinuousWaveletTransform & wt, PeakArea_ & area, Int distance_from_scan_border, Int ms_level, DoubleReal peak_bound_cwt, DoubleReal peak_bound_ms2_level_cwt, Int direction = 1);
00214 
00215 
00235     bool getPeakEndPoints_(PeakIterator first, PeakIterator last, PeakArea_ & area, Int distance_from_scan_border, Int & peak_left_index, Int & peak_right_index, ContinuousWaveletTransformNumIntegration & wt);
00236 
00237 
00244     void getPeakCentroid_(PeakArea_ & area);
00245 
00247     double lorentz_(double height, double lambda, double pos, double x);
00248 
00258     void initializeWT_(ContinuousWaveletTransformNumIntegration & wt, DoubleReal & peak_bound_cwt, DoubleReal & peak_bound_ms2_level_cwt);
00259 
00263 
00270     bool deconvolutePeak_(PeakShape & shape, std::vector<PeakShape> & peak_shapes, DoubleReal peak_bound_cwt);
00271 
00273     Int getNumberOfPeaks_(ConstPeakIterator first, ConstPeakIterator last, std::vector<double> & peak_values,
00274                           Int direction, DoubleReal resolution, ContinuousWaveletTransformNumIntegration & wt, DoubleReal peak_bound_cwt);
00275 
00277     Int determineChargeState_(std::vector<double> & peak_values);
00278 
00280     void addPeak_(std::vector<PeakShape> & peaks_DC, PeakArea_ & area, double left_width, double right_width, OptimizePeakDeconvolution::Data & data);
00282   };  // end PeakPickerCWT
00283 
00284 } // namespace OpenMS
00285 
00286 #endif

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