Go to the documentation of this file.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
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_FEATUREFINDERALGORITHM_H
00036 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_FEATUREFINDERALGORITHM_H
00037
00038 #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
00039 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/FeatureFinder.h>
00040 #include <OpenMS/KERNEL/MSExperiment.h>
00041 #include <OpenMS/KERNEL/FeatureMap.h>
00042
00043 namespace OpenMS
00044 {
00045
00046
00047 class FeatureFinder;
00048
00050 struct OPENMS_DLLAPI Summary
00051 {
00052 std::map<String, UInt> exception;
00053 UInt no_exceptions;
00054 std::map<String, UInt> mz_model;
00055 std::map<float, UInt> mz_stdev;
00056 std::vector<UInt> charge;
00057 DoubleReal corr_mean, corr_max, corr_min;
00058
00060 Summary() :
00061 no_exceptions(0),
00062 corr_mean(0),
00063 corr_max(0),
00064 corr_min(1)
00065 {}
00066
00067 };
00068
00073 template <class PeakType, class FeatureType>
00074 class FeatureFinderAlgorithm :
00075 public DefaultParamHandler
00076 {
00077 public:
00079 typedef MSExperiment<PeakType> MapType;
00081 typedef typename MapType::CoordinateType CoordinateType;
00083 typedef typename MapType::IntensityType IntensityType;
00085 typedef FeatureMap<FeatureType> FeatureMapType;
00086
00088 FeatureFinderAlgorithm() :
00089 DefaultParamHandler("FeatureFinderAlgorithm"),
00090 map_(0),
00091 features_(0),
00092 ff_(0)
00093 {
00094 }
00095
00097 virtual ~FeatureFinderAlgorithm()
00098 {
00099 }
00100
00102 static void registerChildren();
00103
00105 virtual void run() = 0;
00106
00112 virtual Param getDefaultParameters() const
00113 {
00114 return this->defaults_;
00115 }
00116
00118 void setData(const MapType & map, FeatureMapType & features, FeatureFinder & ff)
00119 {
00120 map_ = ↦
00121 features_ = &features;
00122 ff_ = &ff;
00123 }
00124
00130 virtual void setSeeds(const FeatureMapType & seeds)
00131 {
00132 if (seeds.size() != 0)
00133 {
00134 throw Exception::IllegalArgument(__FILE__, __LINE__, __PRETTY_FUNCTION__, "The used feature detection algorithm does not support user-specified seed lists!");
00135 }
00136 }
00137
00138 protected:
00139
00141 const MapType * map_;
00142
00144 FeatureMapType * features_;
00145
00147 FeatureFinder * ff_;
00148
00149 private:
00150
00152 FeatureFinderAlgorithm & operator=(const FeatureFinderAlgorithm &);
00153
00155 FeatureFinderAlgorithm(const FeatureFinderAlgorithm &);
00156
00157 };
00158 }
00159
00160 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_FEATUREFINDERALGORITHM_H