00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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
00097
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