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

LmaIsotopeFitter1D.h (Maintainer: Marcel Grunert)

Go to the documentation of this file.
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: Marcel Grunert $
00025 // --------------------------------------------------------------------------
00026 
00027 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_LMAISOTOPEFITTER1D_H
00028 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_LMAISOTOPEFITTER1D_H
00029 
00030 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/LevMarqFitter1D.h>
00031 #include <OpenMS/MATH/STATISTICS/BasicStatistics.h>
00032 #include <OpenMS/MATH/MISC/MathFunctions.h>
00033 #include <OpenMS/CHEMISTRY/IsotopeDistribution.h>
00034 #include <OpenMS/CHEMISTRY/EmpiricalFormula.h>
00035 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/InterpolationModel.h>
00036 
00037 
00038 
00039 namespace OpenMS
00040 {
00048     class LmaIsotopeFitter1D
00049     : public LevMarqFitter1D
00050     {
00051         public:
00052         
00053             enum Averagines{C=0,H,N,O,S,AVERAGINE_NUM};
00054   
00056             LmaIsotopeFitter1D();
00057         
00059             LmaIsotopeFitter1D(const LmaIsotopeFitter1D& source);
00060         
00062             virtual ~LmaIsotopeFitter1D();
00063         
00065             virtual LmaIsotopeFitter1D& operator = (const LmaIsotopeFitter1D& source);
00066     
00068             static Fitter1D* create()
00069             {
00070               return new LmaIsotopeFitter1D();
00071             }
00072             
00074             static const String getProductName()
00075             {
00076               return "LmaIsotopeFitter1D";
00077             }
00078             
00080             QualityType fit1d(const RawDataArrayType& range, InterpolationModel*& model);
00081     
00082   protected:
00083 
00085           struct Data
00086           {
00087             typedef RawDataPoint1D RawDataPointType;
00088             typedef DPeakArray<RawDataPointType > RawDataArrayType;
00089             typedef std::vector < double > ContainerType;
00090             typedef Feature::CoordinateType CoordinateType;
00091       
00092             UInt n;
00093             RawDataArrayType set;
00094             ContainerType isotopes_exact;
00095             CoordinateType isotope_distance;
00096             // bool mono_known;
00097             // CoordinateType monoisotopic_mz;
00098             CoordinateType isotopes_stdev;
00099             CoordinateType sigma;
00100           };
00101     
00103           void setInitialParameters_();
00104  
00106           static Int residual_(const gsl_vector* x, void* params, gsl_vector* f);
00107         
00109           static Int jacobian_(const gsl_vector* x, void* params, gsl_matrix* J);
00110         
00112           static Int evaluate_(const gsl_vector* x, void* params, gsl_vector* f, gsl_matrix* J);
00113         
00118           void printState_(Int iter, gsl_multifit_fdfsolver * s);  
00119 
00121           UInt charge_;
00123           CoordinateType isotope_stdev_;
00125           CoordinateType total_intensity_;  
00127           CoordinateType monoisotopic_mz_;
00129           Int max_isotope_;
00131           DoubleReal trim_right_cutoff_;
00133           DoubleReal isotope_distance_;
00135           CoordinateType mean_;
00137           DoubleReal averagine_[AVERAGINE_NUM];
00139           ContainerType isotopes_exact_;
00141           bool monoisotopic_mass_known_;
00142           
00143           void updateMembers_();
00144   };
00145 }
00146 
00147 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_LMAISOTOPEFITTER1D_H

Generated Tue Apr 1 15:36:35 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1