35 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_FEATUREFINDERALGORITHMSIMPLE_H
36 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_FEATUREFINDERALGORITHMSIMPLE_H
61 template <
class PeakType,
class FeatureType>
82 tmp.
setSectionDescription(
"seeder",
"Settings for the seeder (Determines potential feature regions)");
86 tmp.
setSectionDescription(
"extender",
"Settings for the extender (Collects all peaks belonging to a feature)");
90 tmp.
setSectionDescription(
"fitter",
"Settings for the modefitter (Fits a model to the data determinging the probapility that they represent a feature.)");
97 #ifdef DEBUG_FEATUREFINDER
109 params.
setValue(
"fit_algorithm",
"simple");
119 #ifdef DEBUG_FEATUREFINDER
120 std::cout <<
"===============================" << std::endl;
121 std::cout <<
"### Seeder (seed # " << ++seed_nr <<
")..." << std::endl;
125 #ifdef DEBUG_FEATUREFINDER
126 std::cout <<
"seed ... " << seed.first <<
" - " << seed.second << std::endl;
127 std::cout <<
"### Extender..." << std::endl;
130 index_set.insert(seed);
132 extender.
extend(index_set, region);
134 #ifdef DEBUG_FEATUREFINDER
135 std::cout <<
"### ModelFitter..." << std::endl;
153 if (ch >= summary.
charge.size())
155 summary.
charge.resize(ch + 1);
175 for (IndexSet::const_iterator it = region.begin(); it != region.end(); ++it)
197 std::cout << size <<
" features were found. " << std::endl;
202 std::cout <<
"FeatureFinder summary:\n"
203 <<
"Correlation:\n\tminimum: " << summary.
corr_min <<
"\n\tmean: " << summary.
corr_mean
204 <<
"\n\tmaximum: " << summary.
corr_max << std::endl;
206 std::cout <<
"Exceptions:\n";
207 for (std::map<String, UInt>::const_iterator it = summary.
exception.begin(); it != summary.
exception.end(); ++it)
209 std::cout <<
"\t" << it->first <<
": " << it->second * 100 / summary.
no_exceptions <<
"% (" << it->second <<
")\n";
212 std::cout <<
"Chosen mz models:\n";
213 for (std::map<String, UInt>::const_iterator it = summary.
mz_model.begin(); it != summary.
mz_model.end(); ++it)
215 std::cout <<
"\t" << it->first <<
": " << it->second * 100 / size <<
"% (" << it->second <<
")\n";
218 std::cout <<
"Chosen mz stdevs:\n";
219 for (std::map<float, UInt>::const_iterator it = summary.
mz_stdev.begin(); it != summary.
mz_stdev.end(); ++it)
221 std::cout <<
"\t" << it->first <<
": " << it->second * 100 / (size - summary.
charge[0]) <<
"% (" << it->second <<
")\n";
224 std::cout <<
"Charges:\n";
225 for (
Size i = 1; i < summary.
charge.size(); ++i)
227 if (summary.
charge[i] != 0)
229 std::cout <<
"\t+" << i <<
": " << summary.
charge[i] * 100 / (size - summary.
charge[0]) <<
"% (" << summary.
charge[i] <<
")\n";
255 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_FEATUREFINDERALGORITHMSIMPLE_H
UInt no_exceptions
Definition: FeatureFinderAlgorithm.h:53
const ChargeType & getCharge() const
Non-mutable access to charge state.
void extend(const ChargedIndexSet &seed_region, ChargedIndexSet &result_region)
return next seed
Definition: SimpleExtender.h:127
virtual Param getDefaultParameters() const
Returns the default parameters. Reimplment.
Definition: FeatureFinderAlgorithmSimple.h:76
IsotopeCluster::IndexPair IndexPair
Index to peak consisting of two UInts (scan index / peak index)
Definition: FeatureFinderDefs.h:54
FeatureMapType * features_
Output data pointer.
Definition: FeatureFinderAlgorithm.h:144
Param defaults_
Container for default parameters. This member should be filled in the constructor of derived classes!...
Definition: DefaultParamHandler.h:155
void setValue(const String &key, const DataValue &value, const String &description="", const StringList &tags=StringList())
Sets a value.
A more convenient string class.
Definition: String.h:56
const ModelDescription< 2 > & getModelDescription() const
Non-mutable access to the model description.
void insert(const String &prefix, const Param ¶m)
FeatureFinder * ff_
Pointer to the calling FeatureFinder that is used to access the feature flags.
Definition: FeatureFinderAlgorithm.h:147
A 2-dimensional raw data point or peak.
Definition: Peak2D.h:55
QualityType getOverallQuality() const
Non-mutable access to the overall quality.
Definition: FeatureFinderDefs.h:63
DoubleReal corr_mean
Definition: FeatureFinderAlgorithm.h:57
const MapType * map_
Input data pointer.
Definition: FeatureFinderAlgorithm.h:141
std::map< String, UInt > mz_model
Definition: FeatureFinderAlgorithm.h:54
static const DataValue EMPTY
Empty data value for comparisons.
Definition: DataValue.h:63
Abstract base class for FeatureFinder algorithms.
Definition: FeatureFinderAlgorithm.h:74
void setSectionDescription(const String &key, const String &description)
Sets a description for an existing section.
std::map< float, UInt > mz_stdev
Definition: FeatureFinderAlgorithm.h:55
IndexPair nextSeed()
return the next seed
Definition: SimpleSeeder.h:94
void setParameters(const Param ¶m)
Sets the parameters.
The purpose of this struct is to provide definitions of classes and typedefs which are used throughou...
Definition: FeatureFinderDefs.h:51
static FeatureFinderAlgorithm< PeakType, FeatureType > * create()
Definition: FeatureFinderAlgorithmSimple.h:235
DoubleReal corr_max
Definition: FeatureFinderAlgorithm.h:57
static const String getProductName()
Definition: FeatureFinderAlgorithmSimple.h:240
void endProgress() const
Ends the progress display.
const DataValue & getValue(const String &key) const
Returns a value of a parameter.
FeatureFinderAlgorithm implementation using the Simple* modules.
Definition: FeatureFinderAlgorithmSimple.h:62
std::map< String, UInt > exception
Definition: FeatureFinderAlgorithm.h:52
const char * getName() const
Returns the name of the exception.
void setDefaults(const Param &defaults, const String &prefix="", bool showMessage=false)
Insert all values of defaults and adds the prefix prefix, if the values are not already set...
std::vector< UInt > charge
Definition: FeatureFinderAlgorithm.h:56
Summary of fitting results.
Definition: FeatureFinderAlgorithm.h:50
Simple feature extension algorithm.
Definition: SimpleExtender.h:79
Tests a group of data points in an LC-MS map for goodness-of-fit with a 2D averagine model...
Definition: ModelFitter.h:77
bool exists(const String &key) const
Tests if a parameter is set (expecting its fully qualified name, e.g., TextExporter:1:proteins_only) ...
Exception that is thrown if a method an invalid IndexPair is given.
Definition: FeatureFinderDefs.h:66
An LC-MS feature.
Definition: Feature.h:66
FeatureFinderAlgorithmSimple()
default constructor
Definition: FeatureFinderAlgorithmSimple.h:69
Management and storage of parameters / INI files.
Definition: Param.h:69
DoubleReal corr_min
Definition: FeatureFinderAlgorithm.h:57
Exception used if an error occurred while fitting a model to a given dataset.
Definition: Exception.h:662
index set with associated charge estimate
Definition: IsotopeCluster.h:53
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:144
const Param & getParam() const
Non-mutable access to model parameters.
Definition: ModelDescription.h:127
bool check_defaults_
If this member is set to false no checking if parameters in done;.
Definition: DefaultParamHandler.h:174
const Flag & getPeakFlag(const IndexPair &index) const
Returns a non-mutable reference to a peak flag.
Definition: FeatureFinder.h:91
Simple seeding class that uses the strongest peak as next seed.
Definition: SimpleSeeder.h:61
Feature fit(const ChargedIndexSet &index_set)
Return next feature.
Definition: ModelFitter.h:226
const Param & getParameters() const
Non-mutable access to the parameters.
FeatureFinderAlgorithmSimple & operator=(const FeatureFinderAlgorithmSimple &)
Not implemented.
virtual void run()
Main method that implements the actual algorithm.
Definition: FeatureFinderAlgorithmSimple.h:95