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

FeatureFinderAlgorithm.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: Clemens Groepl $
00032 // $Authors: $
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   // forward declaration
00047   class FeatureFinder;
00048 
00050   struct OPENMS_DLLAPI Summary
00051   {
00052     std::map<String, UInt> exception;    //count exceptions
00053     UInt no_exceptions;
00054     std::map<String, UInt> mz_model;    //count used mz models
00055     std::map<float, UInt> mz_stdev;    //count used mz standard deviations
00056     std::vector<UInt> charge;     //count used charges
00057     DoubleReal corr_mean, corr_max, corr_min;       //boxplot for correlation
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_ = &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

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