![]() |
OpenMS
2.4.0
|
FeatureFinderAlgorithm for picked peaks. More...
#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/FeatureFinderAlgorithmPicked.h>
Public Types | |
Type definitions | |
typedef FeatureFinderAlgorithm::MapType | MapType |
typedef MapType::SpectrumType | SpectrumType |
typedef SpectrumType::FloatDataArrays | FloatDataArrays |
![]() | |
typedef PeakMap | MapType |
Input map type. More... | |
typedef MapType::CoordinateType | CoordinateType |
Coordinate/Position type of peaks. More... | |
typedef MapType::IntensityType | IntensityType |
Intensity type of peaks. 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 | |
FeatureFinderAlgorithmPicked () | |
default constructor More... | |
void | setSeeds (const FeatureMap &seeds) override |
Sets a reference to the calling FeatureFinder. More... | |
void | run () override |
Main method for actual FeatureFinder. More... | |
![]() | |
FeatureFinderAlgorithm () | |
default constructor More... | |
~FeatureFinderAlgorithm () override | |
destructor More... | |
virtual Param | getDefaultParameters () const |
Returns the default parameters. Reimplement. More... | |
void | setData (const MapType &map, FeatureMap &features, FeatureFinder &ff) |
Sets a reference to the calling FeatureFinder. 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... | |
Static Public Member Functions | |
static FeatureFinderAlgorithm * | create () |
static const String | getProductName () |
![]() | |
static void | registerChildren () |
register all derived classes here (see FeatureFinderAlgorithm_impl.h) More... | |
Protected Member Functions | |
void | updateMembers_ () override |
This method is used to update extra member variables at the end of the setParameters() method. More... | |
void | abort_ (const Seed &seed, const String &reason) |
Writes the abort reason to the log file and counts occurrences for each reason. More... | |
double | intersection_ (const Feature &f1, const Feature &f2) const |
const TheoreticalIsotopePattern & | getIsotopeDistribution_ (double mass) const |
Returns the isotope distribution for a certain mass window. More... | |
double | findBestIsotopeFit_ (const Seed ¢er, UInt charge, IsotopePattern &best_pattern) const |
Finds the best fitting position of the isotopic pattern estimate defined by center . More... | |
void | extendMassTraces_ (const IsotopePattern &pattern, MassTraces &traces, Size meta_index_overall) const |
void | extendMassTrace_ (MassTrace &trace, SignedSize spectrum_index, double mz, bool increase_rt, Size meta_index_overall, double min_rt=0.0, double max_rt=0.0) const |
Extends a single mass trace in one RT direction. More... | |
Size | nearest_ (double pos, const MSSpectrum &spec, Size start) const |
Returns the index of the peak nearest to m/z pos in spectrum spec (linear search starting from index start ) More... | |
void | findIsotope_ (double pos, Size spectrum_index, IsotopePattern &pattern, Size pattern_index, Size &peak_index) const |
Searches for an isotopic peak in the current spectrum and the adjacent spectra. More... | |
double | positionScore_ (double pos1, double pos2, double allowed_deviation) const |
Calculates a score between 0 and 1 for the m/z deviation of two peaks. More... | |
double | isotopeScore_ (const TheoreticalIsotopePattern &isotopes, IsotopePattern &pattern, bool consider_mz_distances) const |
Calculates a score between 0 and 1 for the correlation between theoretical and found isotope pattern. More... | |
double | intensityScore_ (Size spectrum, Size peak) const |
Compute the intensity score for the peak peak in spectrum spectrum . More... | |
TraceFitter * | chooseTraceFitter_ (double &tau) |
Choose a the best trace fitter for the current mass traces based on the user parameter (symmetric, asymmetric) or based on an inspection of the mass trace (auto) More... | |
double | intensityScore_ (Size rt_bin, Size mz_bin, double intensity) const |
Handling of fitted mass traces | |
Methods to handle the results of the mass trace fitting process. | |
void | cropFeature_ (TraceFitter *fitter, const MassTraces &traces, MassTraces &new_traces) |
Creates new mass traces new_traces based on the fitting result and the original traces traces . More... | |
bool | checkFeatureQuality_ (TraceFitter *fitter, MassTraces &feature_traces, const double &seed_mz, const double &min_feature_score, String &error_msg, double &fit_score, double &correlation, double &final_score) |
Checks the feature based on different score thresholds and model constraints. More... | |
void | writeFeatureDebugInfo_ (TraceFitter *fitter, const MassTraces &traces, const MassTraces &new_traces, bool feature_ok, const String error_msg, const double final_score, const Int plot_nr, const PeakType &peak, const String path="debug/features/") |
Creates several files containing plots and viewable data of the fitted mass trace. More... | |
![]() | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. More... | |
Protected Attributes | |
MapType | map_ |
editable copy of the map More... | |
std::ofstream | log_ |
Output stream for log/debug info. More... | |
bool | debug_ |
debug flag More... | |
std::map< String, UInt > | aborts_ |
Array of abort reasons. More... | |
std::map< Seed, String > | abort_reasons_ |
Array of abort reasons. More... | |
FeatureMap | seeds_ |
User-specified seed list. More... | |
std::vector< TheoreticalIsotopePattern > | isotope_distributions_ |
Vector of precalculated isotope distributions for several mass windows. More... | |
Members for parameters often needed in methods | |
double | pattern_tolerance_ |
Stores mass_trace:mz_tolerance. More... | |
double | trace_tolerance_ |
Stores isotopic_pattern:mz_tolerance. More... | |
UInt | min_spectra_ |
Number of spectra that have to show the same mass (for finding a mass trace) More... | |
UInt | max_missing_trace_peaks_ |
Stores mass_trace:max_missing. More... | |
double | slope_bound_ |
Max slope of mass trace intensities. More... | |
double | intensity_percentage_ |
Isotope pattern intensity contribution of required peaks. More... | |
double | intensity_percentage_optional_ |
Isotope pattern intensity contribution of optional peaks. More... | |
double | optional_fit_improvement_ |
Minimal improvement for leaving out optional isotope. More... | |
double | mass_window_width_ |
Width of the isotope pattern mass bins. More... | |
UInt | intensity_bins_ |
Number of bins (in RT and MZ) for intensity significance estimation. More... | |
double | min_isotope_fit_ |
Minimum isotope pattern fit for a feature. More... | |
double | min_trace_score_ |
Minimum quality of a traces. More... | |
double | min_rt_span_ |
Minimum RT range that has to be left after the fit. More... | |
double | max_rt_span_ |
Maximum RT range the model is allowed to span. More... | |
double | max_feature_intersection_ |
Maximum allowed feature intersection (if larger, that one of the feature is removed) More... | |
String | reported_mz_ |
The mass type that is reported for features. 'maximum' returns the m/z value of the highest mass trace. 'average' returns the intensity-weighted average m/z value of all contained peaks. 'monoisotopic' returns the monoisotopic m/z value derived from the fitted isotope model. More... | |
Members for intensity significance estimation | |
double | intensity_rt_step_ |
RT bin width. More... | |
double | intensity_mz_step_ |
m/z bin width More... | |
std::vector< std::vector< std::vector< double > > > | intensity_thresholds_ |
Precalculated intensity 20-quantiles (binned) More... | |
![]() | |
const MapType * | map_ |
Input data pointer. More... | |
FeatureMap * | features_ |
Output data pointer. More... | |
FeatureFinder * | ff_ |
Pointer to the calling FeatureFinder that is used to access the feature flags. 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 | |
FeatureFinderAlgorithmPicked & | operator= (const FeatureFinderAlgorithmPicked &) |
Not implemented. More... | |
FeatureFinderAlgorithmPicked (const FeatureFinderAlgorithmPicked &) | |
Not implemented. More... | |
FeatureFinderAlgorithm for picked peaks.
RT model with tailing/fronting (Marc)
More general MZ model - e.g. based on co-elution or with sulfur-averagines (Marc)
Fix output in parallel mode, change assignment of charges to threads, add parallel TOPP test (Marc)
Implement user-specified seed lists support (Marc)
|
protected |
|
protected |
|
protected |
|
protected |
typedef MapType::SpectrumType SpectrumType |
|
protected |
default constructor
|
private |
Not implemented.
Writes the abort reason to the log file and counts occurrences for each reason.
|
protected |
Checks the feature based on different score thresholds and model constraints.
Feature can get invalid for following reasons:
fitter | The TraceFitter containing the results from the rt profile fitting step. |
feature_traces | Cropped feature mass traces. |
seed_mz | Mz of the seed |
min_feature_score | Minimal required feature score |
error_msg | Will be filled with the error message, if the feature is invalid |
fit_score | Will be filled with the fit score |
correlation | Will be filled with correlation between feature and model |
final_score | Will be filled with the final score |
|
protected |
Choose a the best trace fitter for the current mass traces based on the user parameter (symmetric, asymmetric) or based on an inspection of the mass trace (auto)
|
static |
|
protected |
Creates new mass traces new_traces
based on the fitting result and the original traces traces
.
fitter | The TraceFitter containing the results from the rt profile fitting step. |
traces | Original mass traces found in the experiment. |
new_traces | Mass traces created by cropping the original mass traces. |
|
protected |
Extends a single mass trace in one RT direction.
How to use this method:
trace
increase_rt
whether to extend in downstream or upstream directiontrace | The trace that should be extended |
spectrum_index | The index of the spectrum from which on the mass trace should be extended |
mz | The mz location (center) of the trace |
increase_rt | Indicator whether the extension is done in forward or backward direction (with respect to the current spectrum) |
meta_index_overall | The index of the overall score |
min_rt | The rt minimum up to which the trace will be extended. |
max_rt | The rt maximum up to which the trace will be extended. |
min_rt
or max_rt
are set to 0.0 no boundary is assumed in the respective direction.
|
protected |
Extends all mass traces of an isotope pattern in one step
pattern | The IsotopePattern that should be extended. |
traces | The MassTraces datastructure where the extended mass traces will be stored in. |
meta_index_overall | The index of the data array where the quality scores for the given charge are stored. |
|
protected |
Finds the best fitting position of the isotopic pattern estimate defined by center
.
center | the maximum peak of the isotope distribution (contains charge as well) |
charge | The charge of the pattern |
best_pattern | Returns the indices of the isotopic peaks. If a isotopic peak is missing -1 is returned. |
|
protected |
Searches for an isotopic peak in the current spectrum and the adjacent spectra.
pos | m/z position of the searched for peak |
spectrum_index | index of the central spectrum |
pattern | IsotopePattern to store found peaks |
pattern_index | index of the isotope in the pattern |
peak_index | starting index of the search (to avoid multiple binary searches) |
|
protected |
Returns the isotope distribution for a certain mass window.
|
static |
Compute the intensity score for the peak peak
in spectrum spectrum
.
The intensity score is computed by interpolating the score between the 4 nearest intensity bins. The scores from the different bins are weighted by the distance of the bin center to the peak.
spectrum | Index of the spectrum we are currently looking at |
peak | Index of the peak that should be scored inside the spectrum spectrum |
Calculates the intersection between features. The value is normalized by the size of the smaller feature, so it ranges from 0 to 1.
|
protected |
Calculates a score between 0 and 1 for the correlation between theoretical and found isotope pattern.
|
protected |
Returns the index of the peak nearest to m/z pos
in spectrum spec
(linear search starting from index start
)
|
private |
Not implemented.
Calculates a score between 0 and 1 for the m/z deviation of two peaks.
|
overridevirtual |
Main method for actual FeatureFinder.
Implements FeatureFinderAlgorithm.
|
overridevirtual |
Sets a reference to the calling FeatureFinder.
Exception::IllegalArgument | is thrown if the algorithm does not support user-specified seed lists |
Reimplemented from FeatureFinderAlgorithm.
|
overrideprotectedvirtual |
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.
|
protected |
Creates several files containing plots and viewable data of the fitted mass trace.
fitter | The TraceFitter containing the results from the rt profile fitting step. |
traces | Original mass traces found in the spectra |
new_traces | Cropped feature mass traces |
feature_ok | Status of the feature |
error_msg | If the feature is invalid, error_msg contains the reason |
final_score | Final score of the feature |
plot_nr | Index of the feature |
peak | The Seed Peak |
path | The path where to put the debug files (default is debug/features) |
|
protected |
debug flag
|
protected |
Number of bins (in RT and MZ) for intensity significance estimation.
|
protected |
m/z bin width
|
protected |
Isotope pattern intensity contribution of required peaks.
|
protected |
Isotope pattern intensity contribution of optional peaks.
|
protected |
RT bin width.
|
protected |
Precalculated intensity 20-quantiles (binned)
|
protected |
Vector of precalculated isotope distributions for several mass windows.
|
mutableprotected |
Output stream for log/debug info.
|
protected |
editable copy of the map
|
protected |
Width of the isotope pattern mass bins.
|
protected |
Maximum allowed feature intersection (if larger, that one of the feature is removed)
|
protected |
Stores mass_trace:max_missing.
|
protected |
Maximum RT range the model is allowed to span.
|
protected |
Minimum isotope pattern fit for a feature.
|
protected |
Minimum RT range that has to be left after the fit.
|
protected |
Number of spectra that have to show the same mass (for finding a mass trace)
|
protected |
Minimum quality of a traces.
|
protected |
Minimal improvement for leaving out optional isotope.
|
protected |
Stores mass_trace:mz_tolerance.
|
protected |
The mass type that is reported for features. 'maximum' returns the m/z value of the highest mass trace. 'average' returns the intensity-weighted average m/z value of all contained peaks. 'monoisotopic' returns the monoisotopic m/z value derived from the fitted isotope model.
|
protected |
User-specified seed list.
|
protected |
Max slope of mass trace intensities.
|
protected |
Stores isotopic_pattern:mz_tolerance.