Simple feature extension algorithm. More...
#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/SimpleExtender.h>
Classes | |
struct | IndexWithPriority |
A helper structure to sort indizes by their priority. More... | |
Public Types | |
typedef FeaFiModule< PeakType, FeatureType > | Base |
typedef Base::IntensityType | IntensityType |
Intensity of a data point. More... | |
typedef Base::CoordinateType | CoordinateType |
Coordinates of a point (m/z and rt) More... | |
typedef DoubleReal | ProbabilityType |
Priority of a point (see below) More... | |
![]() | |
typedef FeatureMap< FeatureType > | FeatureMapType |
Output feature map type. More... | |
typedef MSExperiment< PeakType > | MapType |
Input map type. More... | |
typedef MapType::SpectrumType | SpectrumType |
Input spectrum type. More... | |
typedef PeakType::IntensityType | IntensityType |
Input intensity type. More... | |
typedef PeakType::CoordinateType | CoordinateType |
Input coordinate type. More... | |
![]() | |
enum | Flag { UNUSED, USED } |
Flags that indicate if a peak is already used in a feature. More... | |
typedef IsotopeCluster::IndexPair | IndexPair |
Index to peak consisting of two UInts (scan index / peak index) More... | |
typedef IsotopeCluster::ChargedIndexSet | ChargedIndexSet |
Index to peak consisting of two UInts (scan index / peak index) with charge information. More... | |
typedef IsotopeCluster::IndexSet | IndexSet |
A set of peak indices. More... | |
Public Member Functions | |
SimpleExtender (const MSExperiment< PeakType > *map, FeatureMap< FeatureType > *features, FeatureFinder *ff) | |
Constructor. More... | |
virtual | ~SimpleExtender () |
destructor More... | |
void | extend (const ChargedIndexSet &seed_region, ChargedIndexSet &result_region) |
return next seed More... | |
![]() | |
FeaFiModule (const MSExperiment< PeakType > *map, FeatureMap< FeatureType > *features, FeatureFinder *ff) | |
Constructor. More... | |
virtual | ~FeaFiModule () |
destructor More... | |
IntensityType | getPeakIntensity (const FeatureFinderDefs::IndexPair &index) const |
Returns the intensity of a peak. More... | |
CoordinateType | getPeakMz (const FeatureFinderDefs::IndexPair &index) const |
Returns the m/z of a peak. More... | |
CoordinateType | getPeakRt (const FeatureFinderDefs::IndexPair &index) const |
Returns the retention time of a peak. More... | |
void | getNextMz (FeatureFinderDefs::IndexPair &index) const |
fills index with the index of next peak in m/z dimension More... | |
void | getPrevMz (FeatureFinderDefs::IndexPair &index) const |
fills index with the index of previous peak in m/z dimension More... | |
void | getNextRt (FeatureFinderDefs::IndexPair &index) |
fills index with the index of the nearest peak in the next scan More... | |
void | getPrevRt (FeatureFinderDefs::IndexPair &index) |
fills index with the index of the nearest peak in the previous scan More... | |
void | addConvexHull (const FeatureFinderDefs::IndexSet &set, Feature &feature) const |
Calculates the convex hull of a index set and adds it to the feature . More... | |
![]() | |
DefaultParamHandler (const String &name) | |
Constructor with name that is displayed in error messages. More... | |
DefaultParamHandler (const DefaultParamHandler &rhs) | |
Copy constructor. More... | |
virtual | ~DefaultParamHandler () |
Destructor. More... | |
virtual DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
Assignment operator. More... | |
virtual bool | operator== (const DefaultParamHandler &rhs) const |
Equality operator. More... | |
void | setParameters (const Param ¶m) |
Sets the parameters. More... | |
const Param & | getParameters () const |
Non-mutable access to the parameters. More... | |
const Param & | getDefaults () const |
Non-mutable access to the default parameters. More... | |
const String & | getName () const |
Non-mutable access to the name. More... | |
void | setName (const String &name) |
Mutable access to the name. More... | |
const std::vector< String > & | getSubsections () const |
Non-mutable access to the registered subsections. More... | |
Protected Member Functions | |
virtual void | updateMembers_ () |
This method is used to update extra member variables at the end of the setParameters() method. More... | |
void | writeDebugFile_ (const std::vector< IndexPair > &peaks, UInt nr_feat) |
write DTA2D debug file for the feature with index nr_feat More... | |
bool | isTooFarFromCentroid_ (const IndexPair &index) |
Checks if the current peak is too far from the centroid. More... | |
void | moveMzUp_ (const IndexPair &index) |
Extends the seed into positive m/z direction. More... | |
void | moveMzDown_ (const IndexPair &index) |
Extends the seed into negative m/z direction. More... | |
void | moveRtUp_ (const IndexPair &index) |
Extension into positive rt dimension. More... | |
void | moveRtDown_ (const IndexPair &index) |
Extends the seed into negative retention time direction. More... | |
ProbabilityType | computePeakPriority_ (const IndexPair &index) |
Computes the priority of a peak as function of intensity and distance from seed. More... | |
void | checkNeighbour_ (const IndexPair &index) |
Checks the neighbours of the current for insertion into the boundary. More... | |
![]() | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. More... | |
Protected Attributes | |
Math::AveragePosition< 2 > | running_avg_ |
keeps an running average of the peak coordinates weighted by the intensities More... | |
std::map< IndexPair, ProbabilityType > | priorities_ |
Keeps track of peaks already included in the boundary (value is priority of peak) More... | |
DPosition< 2 > | last_pos_extracted_ |
Position of last peak extracted from the boundary (used to compute the priority of neighbouring peaks) More... | |
std::priority_queue < IndexWithPriority, std::vector< IndexWithPriority > , typename IndexWithPriority::PriorityLess > | boundary_ |
Represents the boundary of a feature. More... | |
IntensityType | intensity_threshold_ |
Mininum intensity of a boundary point. Calculated from 'intensity_factor' and the seed intensity. More... | |
CoordinateType | dist_mz_up_ |
Maximum distance to seed in positive m/z. More... | |
CoordinateType | dist_mz_down_ |
Maximum distance to seed in negative m/z. More... | |
CoordinateType | dist_rt_up_ |
Maximum distance to seed in positive retention time. More... | |
CoordinateType | dist_rt_down_ |
Maximum distance to seed in negative retention time. More... | |
ProbabilityType | priority_threshold_ |
Minium priority for points in the feature region (priority is function of intensity and distance to seed) More... | |
ChargedIndexSet | region_ |
charged index set More... | |
![]() | |
const MapType * | map_ |
Input data pointer. More... | |
FeatureMapType * | features_ |
Output data pointer. More... | |
FeatureFinder * | ff_ |
Pointer to the calling FeatureFinder that is used to access the feature flags and report progress. More... | |
![]() | |
Param | param_ |
Container for current parameters. More... | |
Param | defaults_ |
Container for default parameters. This member should be filled in the constructor of derived classes! More... | |
std::vector< String > | subsections_ |
Container for registered subsections. This member should be filled in the constructor of derived classes! More... | |
String | error_name_ |
Name that is displayed in error messages during the parameter checking. More... | |
bool | check_defaults_ |
If this member is set to false no checking if parameters in done;. More... | |
bool | warn_empty_defaults_ |
If this member is set to false no warning is emitted when defaults are empty;. More... | |
Private Member Functions | |
SimpleExtender () | |
Not implemented. More... | |
SimpleExtender & | operator= (const SimpleExtender &) |
Not implemented. More... | |
SimpleExtender (const SimpleExtender &) | |
Not implemented. More... | |
Simple feature extension algorithm.
This algorithm implements the extension phase of the FeatureFinder as described by Groepl et al. (2005)
We want to determine a region around a seed that is provided by the seeder. Initially, this region is empty. The boundary of this region is implemented using a MutablePriorityQueue which contains only the seed at the beginning.
At each step, we choose a data point from the boundary, move it into the region and explore the neigbourhood of this point in a cross-wise manner (m/z up, m/z down, rt up and rt down). During this exploration we compute the priority of all encountered points as a function of the distance from the extracted point. If this priority exceeds a threshold, we insert the corresponding point into the boundary and proceed.
We stop the extension phase if all peaks contained in the boundary have an intensity lower than a threshold or are too distant from the centroid of the feature.
Name | Type | Default | Restrictions | Description |
---|---|---|---|---|
dist_mz_up | float | 6 | min: 0 | Maximum high m/z distance of peak in the region/boundary from the seed. |
dist_mz_down | float | 2 | min: 0 | Maximum low m/z distance of peak in the region/boundary from the seed. |
dist_rt_up | float | 5 | min: 0 | Maximum high RT distance of peak in the region/boundary from the seed. |
dist_rt_down | float | 5 | min: 0 | Maximum low RT distance of peak in the region/boundary from the seed. |
priority_thr | float | -0.1 | Minimum priority for data points to be included into the boundary of the feature (default 0.0). The priority of a data point is a function of its intensity and its distance to the last point included into the feature region. Setting this threshold to zero or a very small value is usually a good idea. | |
intensity_factor | float | 0.03 | min: 0 max: 1 | Influences for intensity (ion count) threshold in the feature extension. We include only raw data points into this region if their intensity is larger than [intensity_factor * (intensity of the seed)]. |
typedef FeaFiModule<PeakType, FeatureType> Base |
typedef Base::CoordinateType CoordinateType |
Coordinates of a point (m/z and rt)
typedef Base::IntensityType IntensityType |
Intensity of a data point.
typedef DoubleReal ProbabilityType |
Priority of a point (see below)
|
inline |
|
inlinevirtual |
destructor
|
private |
Not implemented.
|
private |
Not implemented.
|
inlineprotected |
Checks the neighbours of the current for insertion into the boundary.
References SimpleExtender< PeakType, FeatureType >::boundary_, SimpleExtender< PeakType, FeatureType >::computePeakPriority_(), FeaFiModule< PeakType, FeatureType >::ff_, FeatureFinder::getPeakFlag(), FeaFiModule< PeakType, FeatureType >::getPeakIntensity(), SimpleExtender< PeakType, FeatureType >::intensity_threshold_, OPENMS_PRECONDITION, SimpleExtender< PeakType, FeatureType >::priorities_, SimpleExtender< PeakType, FeatureType >::priority_threshold_, FeatureFinderDefs::UNUSED, and FeatureFinderDefs::USED.
Referenced by SimpleExtender< PeakType, FeatureType >::moveMzDown_(), SimpleExtender< PeakType, FeatureType >::moveMzUp_(), SimpleExtender< PeakType, FeatureType >::moveRtDown_(), and SimpleExtender< PeakType, FeatureType >::moveRtUp_().
|
inlineprotected |
Computes the priority of a peak as function of intensity and distance from seed.
References FeaFiModule< PeakType, FeatureType >::map_.
Referenced by SimpleExtender< PeakType, FeatureType >::checkNeighbour_(), and SimpleExtender< PeakType, FeatureType >::extend().
|
inline |
return next seed
References AveragePosition< D >::add(), SimpleExtender< PeakType, FeatureType >::boundary_, IsotopeCluster::ChargedIndexSet::charge, AveragePosition< D >::clear(), SimpleExtender< PeakType, FeatureType >::computePeakPriority_(), FeaFiModule< PeakType, FeatureType >::ff_, FeatureFinder::getPeakFlag(), FeaFiModule< PeakType, FeatureType >::getPeakIntensity(), FeaFiModule< PeakType, FeatureType >::getPeakMz(), FeaFiModule< PeakType, FeatureType >::getPeakRt(), SimpleExtender< PeakType, FeatureType >::intensity_threshold_, SimpleExtender< PeakType, FeatureType >::last_pos_extracted_, SimpleExtender< PeakType, FeatureType >::moveMzDown_(), SimpleExtender< PeakType, FeatureType >::moveMzUp_(), SimpleExtender< PeakType, FeatureType >::moveRtDown_(), SimpleExtender< PeakType, FeatureType >::moveRtUp_(), Peak2D::MZ, OPENMS_PRECONDITION, DefaultParamHandler::param_, SimpleExtender< PeakType, FeatureType >::priorities_, Peak2D::RT, SimpleExtender< PeakType, FeatureType >::running_avg_, FeatureFinderDefs::USED, and SimpleExtender< PeakType, FeatureType >::writeDebugFile_().
Referenced by FeatureFinderAlgorithmSimplest< PeakType, FeatureType >::run(), and FeatureFinderAlgorithmSimple< PeakType, FeatureType >::run().
|
inlineprotected |
Checks if the current peak is too far from the centroid.
References SimpleExtender< PeakType, FeatureType >::dist_mz_down_, SimpleExtender< PeakType, FeatureType >::dist_mz_up_, SimpleExtender< PeakType, FeatureType >::dist_rt_down_, SimpleExtender< PeakType, FeatureType >::dist_rt_up_, FeaFiModule< PeakType, FeatureType >::getPeakMz(), FeaFiModule< PeakType, FeatureType >::getPeakRt(), AveragePosition< D >::getPosition(), Peak2D::MZ, OPENMS_PRECONDITION, Peak2D::RT, and SimpleExtender< PeakType, FeatureType >::running_avg_.
Referenced by SimpleExtender< PeakType, FeatureType >::moveMzDown_(), SimpleExtender< PeakType, FeatureType >::moveMzUp_(), SimpleExtender< PeakType, FeatureType >::moveRtDown_(), and SimpleExtender< PeakType, FeatureType >::moveRtUp_().
|
inlineprotected |
Extends the seed into negative m/z direction.
References SimpleExtender< PeakType, FeatureType >::checkNeighbour_(), FeaFiModule< PeakType, FeatureType >::getPrevMz(), and SimpleExtender< PeakType, FeatureType >::isTooFarFromCentroid_().
Referenced by SimpleExtender< PeakType, FeatureType >::extend().
|
inlineprotected |
Extends the seed into positive m/z direction.
References SimpleExtender< PeakType, FeatureType >::checkNeighbour_(), FeaFiModule< PeakType, FeatureType >::getNextMz(), and SimpleExtender< PeakType, FeatureType >::isTooFarFromCentroid_().
Referenced by SimpleExtender< PeakType, FeatureType >::extend().
|
inlineprotected |
Extends the seed into negative retention time direction.
References SimpleExtender< PeakType, FeatureType >::checkNeighbour_(), FeaFiModule< PeakType, FeatureType >::getPrevRt(), and SimpleExtender< PeakType, FeatureType >::isTooFarFromCentroid_().
Referenced by SimpleExtender< PeakType, FeatureType >::extend().
|
inlineprotected |
Extension into positive rt dimension.
References SimpleExtender< PeakType, FeatureType >::checkNeighbour_(), FeaFiModule< PeakType, FeatureType >::getNextRt(), and SimpleExtender< PeakType, FeatureType >::isTooFarFromCentroid_().
Referenced by SimpleExtender< PeakType, FeatureType >::extend().
|
private |
Not implemented.
|
inlineprotectedvirtual |
This method is used to update extra member variables at the end of the setParameters() method.
Also call it at the end of the derived classes' copy constructor and assignment operator.
The default implementation is empty.
Reimplemented from DefaultParamHandler.
References SimpleExtender< PeakType, FeatureType >::dist_mz_down_, SimpleExtender< PeakType, FeatureType >::dist_mz_up_, SimpleExtender< PeakType, FeatureType >::dist_rt_down_, SimpleExtender< PeakType, FeatureType >::dist_rt_up_, Param::getValue(), DefaultParamHandler::param_, and SimpleExtender< PeakType, FeatureType >::priority_threshold_.
write DTA2D debug file for the feature with index nr_feat
References String::fillLeft(), FeaFiModule< PeakType, FeatureType >::getPeakMz(), and FeaFiModule< PeakType, FeatureType >::getPeakRt().
Referenced by SimpleExtender< PeakType, FeatureType >::extend().
|
protected |
Represents the boundary of a feature.
Referenced by SimpleExtender< PeakType, FeatureType >::checkNeighbour_(), and SimpleExtender< PeakType, FeatureType >::extend().
|
protected |
Maximum distance to seed in negative m/z.
Referenced by SimpleExtender< PeakType, FeatureType >::isTooFarFromCentroid_(), and SimpleExtender< PeakType, FeatureType >::updateMembers_().
|
protected |
Maximum distance to seed in positive m/z.
Referenced by SimpleExtender< PeakType, FeatureType >::isTooFarFromCentroid_(), and SimpleExtender< PeakType, FeatureType >::updateMembers_().
|
protected |
Maximum distance to seed in negative retention time.
Referenced by SimpleExtender< PeakType, FeatureType >::isTooFarFromCentroid_(), and SimpleExtender< PeakType, FeatureType >::updateMembers_().
|
protected |
Maximum distance to seed in positive retention time.
Referenced by SimpleExtender< PeakType, FeatureType >::isTooFarFromCentroid_(), and SimpleExtender< PeakType, FeatureType >::updateMembers_().
|
protected |
Mininum intensity of a boundary point. Calculated from 'intensity_factor' and the seed intensity.
Referenced by SimpleExtender< PeakType, FeatureType >::checkNeighbour_(), and SimpleExtender< PeakType, FeatureType >::extend().
|
protected |
Position of last peak extracted from the boundary (used to compute the priority of neighbouring peaks)
Referenced by SimpleExtender< PeakType, FeatureType >::extend().
|
protected |
Keeps track of peaks already included in the boundary (value is priority of peak)
Referenced by SimpleExtender< PeakType, FeatureType >::checkNeighbour_(), and SimpleExtender< PeakType, FeatureType >::extend().
|
protected |
Minium priority for points in the feature region (priority is function of intensity and distance to seed)
Referenced by SimpleExtender< PeakType, FeatureType >::checkNeighbour_(), and SimpleExtender< PeakType, FeatureType >::updateMembers_().
|
protected |
charged index set
|
protected |
keeps an running average of the peak coordinates weighted by the intensities
Referenced by SimpleExtender< PeakType, FeatureType >::extend(), and SimpleExtender< PeakType, FeatureType >::isTooFarFromCentroid_().
OpenMS / TOPP release 1.11.1 | Documentation generated on Thu Nov 14 2013 11:19:34 using doxygen 1.8.5 |