![]() |
OpenMS
2.4.0
|
Estimates the signal/noise (S/N) ratio of each data point in a scan based on an iterative scheme which discards high intensities. More...
#include <OpenMS/FILTERING/NOISEESTIMATION/SignalToNoiseEstimatorMeanIterative.h>
Public Types | |
enum | IntensityThresholdCalculation { MANUAL = -1, AUTOMAXBYSTDEV = 0, AUTOMAXBYPERCENT = 1 } |
method to use for estimating the maximal intensity that is used for histogram calculation More... | |
typedef SignalToNoiseEstimator< Container >::PeakIterator | PeakIterator |
typedef SignalToNoiseEstimator< Container >::PeakType | PeakType |
typedef SignalToNoiseEstimator< Container >::GaussianEstimate | GaussianEstimate |
![]() | |
typedef Container::const_iterator | PeakIterator |
typedef PeakIterator::value_type | PeakType |
![]() | |
enum | LogType { CMD, GUI, NONE } |
Possible log types. More... | |
Public Member Functions | |
SignalToNoiseEstimatorMeanIterative () | |
default constructor More... | |
SignalToNoiseEstimatorMeanIterative (const SignalToNoiseEstimatorMeanIterative &source) | |
Copy Constructor. More... | |
![]() | |
SignalToNoiseEstimator () | |
Constructor. More... | |
SignalToNoiseEstimator (const SignalToNoiseEstimator &source) | |
Copy constructor. More... | |
SignalToNoiseEstimator & | operator= (const SignalToNoiseEstimator &source) |
Assignment operator. More... | |
~SignalToNoiseEstimator () override | |
Destructor. More... | |
virtual void | init (const PeakIterator &it_begin, const PeakIterator &it_end) |
Set the start and endpoint of the raw data interval, for which signal to noise ratios will be estimated immediately. More... | |
virtual void | init (const Container &c) |
Set the start and endpoint of the raw data interval, for which signal to noise ratios will be estimated immediately. More... | |
virtual double | getSignalToNoise (const PeakIterator &data_point) |
virtual double | getSignalToNoise (const PeakType &data_point) |
![]() | |
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... | |
![]() | |
ProgressLogger () | |
Constructor. More... | |
~ProgressLogger () | |
Destructor. More... | |
ProgressLogger (const ProgressLogger &other) | |
Copy constructor. More... | |
ProgressLogger & | operator= (const ProgressLogger &other) |
Assignment Operator. More... | |
void | setLogType (LogType type) const |
Sets the progress log that should be used. The default type is NONE! More... | |
LogType | getLogType () const |
Returns the type of progress log being used. More... | |
void | startProgress (SignedSize begin, SignedSize end, const String &label) const |
Initializes the progress display. More... | |
void | setProgress (SignedSize value) const |
Sets the current progress. More... | |
void | endProgress () const |
Ends the progress display. More... | |
void | nextProgress () const |
increment progress by 1 (according to range begin-end) More... | |
Assignment | |
double | max_intensity_ |
maximal intensity considered during binning (values above get discarded) More... | |
double | auto_max_stdev_Factor_ |
parameter for initial automatic estimation of "max_intensity_": a stdev multiplier More... | |
double | auto_max_percentile_ |
parameter for initial automatic estimation of "max_intensity_" percentile or a stdev More... | |
int | auto_mode_ |
determines which method shall be used for estimating "max_intensity_". valid are MANUAL=-1, AUTOMAXBYSTDEV=0 or AUTOMAXBYPERCENT=1 More... | |
double | win_len_ |
range of data points which belong to a window in Thomson More... | |
int | bin_count_ |
number of bins in the histogram More... | |
double | stdev_ |
multiplier for the stdev of intensities More... | |
int | min_required_elements_ |
minimal number of elements a window needs to cover to be used More... | |
double | noise_for_empty_window_ |
SignalToNoiseEstimatorMeanIterative & | operator= (const SignalToNoiseEstimatorMeanIterative &source) |
~SignalToNoiseEstimatorMeanIterative () override | |
Destructor. More... | |
void | computeSTN_ (const PeakIterator &scan_first_, const PeakIterator &scan_last_) override |
void | updateMembers_ () override |
overridden function from DefaultParamHandler to keep members up to date, when a parameter is changed More... | |
Additional Inherited Members | |
![]() | |
GaussianEstimate | estimate_ (const PeakIterator &scan_first_, const PeakIterator &scan_last_) const |
calculate mean & stdev of intensities of a spectrum More... | |
![]() | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. More... | |
![]() | |
static String | logTypeToFactoryName_ (LogType type) |
Return the name of the factory product used for this log type. More... | |
![]() | |
std::map< PeakType, double, typename PeakType::PositionLess > | stn_estimates_ |
stores the noise estimate for each peak More... | |
PeakIterator | first_ |
points to the first raw data point in the interval More... | |
PeakIterator | last_ |
points to the right position next to the last raw data point in the interval More... | |
bool | is_result_valid_ |
flag: set to true if SignalToNoise estimates are calculated and none of the params were changed. otherwise false. 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... | |
![]() | |
LogType | type_ |
time_t | last_invoke_ |
ProgressLoggerImpl * | current_logger_ |
![]() | |
static int | recursion_depth_ |
Estimates the signal/noise (S/N) ratio of each data point in a scan based on an iterative scheme which discards high intensities.
For each datapoint in the given scan, we collect a range of data points around it (param: win_len). The noise for a datapoint is estimated iteratively by discarding peaks which are more than (stdev_mp * StDev) above the mean value. After three iterations, the mean value is considered to be the noise level. If the number of elements in the current window is not sufficient (param: min_required_elements), the noise level is set to a default value (param: noise_for_empty_window).
The whole computation is histogram based, so the user will need to supply a number of bins (param: bin_count), which determines the level of error and runtime. The maximal intensity for a datapoint to be included in the histogram can be either determined automatically (param: auto_mode) by two different methods or can be set directly by the user (param: max_intensity).
Changing any of the parameters will invalidate the S/N values (which will invoke a recomputation on the next request).
typedef SignalToNoiseEstimator<Container>::GaussianEstimate GaussianEstimate |
typedef SignalToNoiseEstimator<Container>::PeakIterator PeakIterator |
typedef SignalToNoiseEstimator<Container>::PeakType PeakType |
|
inline |
default constructor
References DefaultParamHandler::defaults_, DefaultParamHandler::defaultsToParam_(), Param::setMaxFloat(), Param::setMaxInt(), Param::setMinFloat(), Param::setMinInt(), DefaultParamHandler::setName(), and Param::setValue().
|
inline |
Copy Constructor.
References SignalToNoiseEstimatorMeanIterative< Container >::updateMembers_().
|
inlineoverride |
Destructor.
|
inlineoverrideprotectedvirtual |
calculate StN values for all datapoints given, by using a sliding window approach
scan_first_ | first element in the scan |
scan_last_ | last element in the scan (disregarded) |
Throws | Exception::InvalidValue |
Implements SignalToNoiseEstimator< Container >.
References SignalToNoiseEstimatorMeanIterative< Container >::auto_max_percentile_, SignalToNoiseEstimatorMeanIterative< Container >::auto_max_stdev_Factor_, SignalToNoiseEstimatorMeanIterative< Container >::auto_mode_, SignalToNoiseEstimatorMeanIterative< Container >::AUTOMAXBYPERCENT, SignalToNoiseEstimatorMeanIterative< Container >::AUTOMAXBYSTDEV, SignalToNoiseEstimatorMeanIterative< Container >::bin_count_, ProgressLogger::endProgress(), SignalToNoiseEstimator< Container >::estimate_(), SignalToNoiseEstimatorMeanIterative< Container >::max_intensity_, SignalToNoiseEstimator< Container >::GaussianEstimate::mean, SignalToNoiseEstimatorMeanIterative< Container >::min_required_elements_, SignalToNoiseEstimatorMeanIterative< Container >::noise_for_empty_window_, ProgressLogger::setProgress(), ProgressLogger::startProgress(), SignalToNoiseEstimatorMeanIterative< Container >::stdev_, SignalToNoiseEstimator< Container >::stn_estimates_, SignalToNoiseEstimator< Container >::GaussianEstimate::variance, and SignalToNoiseEstimatorMeanIterative< Container >::win_len_.
|
inline |
|
inlineoverrideprotectedvirtual |
overridden function from DefaultParamHandler to keep members up to date, when a parameter is changed
Reimplemented from DefaultParamHandler.
References SignalToNoiseEstimatorMeanIterative< Container >::auto_max_percentile_, SignalToNoiseEstimatorMeanIterative< Container >::auto_max_stdev_Factor_, SignalToNoiseEstimatorMeanIterative< Container >::auto_mode_, SignalToNoiseEstimatorMeanIterative< Container >::bin_count_, Param::getValue(), SignalToNoiseEstimator< Container >::is_result_valid_, SignalToNoiseEstimatorMeanIterative< Container >::max_intensity_, SignalToNoiseEstimatorMeanIterative< Container >::min_required_elements_, SignalToNoiseEstimatorMeanIterative< Container >::noise_for_empty_window_, DefaultParamHandler::param_, SignalToNoiseEstimatorMeanIterative< Container >::stdev_, and SignalToNoiseEstimatorMeanIterative< Container >::win_len_.
Referenced by SignalToNoiseEstimatorMeanIterative< Container >::SignalToNoiseEstimatorMeanIterative().
|
protected |
parameter for initial automatic estimation of "max_intensity_" percentile or a stdev
Referenced by SignalToNoiseEstimatorMeanIterative< Container >::computeSTN_(), and SignalToNoiseEstimatorMeanIterative< Container >::updateMembers_().
|
protected |
parameter for initial automatic estimation of "max_intensity_": a stdev multiplier
Referenced by SignalToNoiseEstimatorMeanIterative< Container >::computeSTN_(), and SignalToNoiseEstimatorMeanIterative< Container >::updateMembers_().
|
protected |
determines which method shall be used for estimating "max_intensity_". valid are MANUAL=-1, AUTOMAXBYSTDEV=0 or AUTOMAXBYPERCENT=1
Referenced by SignalToNoiseEstimatorMeanIterative< Container >::computeSTN_(), and SignalToNoiseEstimatorMeanIterative< Container >::updateMembers_().
|
protected |
number of bins in the histogram
Referenced by SignalToNoiseEstimatorMeanIterative< Container >::computeSTN_(), and SignalToNoiseEstimatorMeanIterative< Container >::updateMembers_().
|
protected |
maximal intensity considered during binning (values above get discarded)
Referenced by SignalToNoiseEstimatorMeanIterative< Container >::computeSTN_(), and SignalToNoiseEstimatorMeanIterative< Container >::updateMembers_().
|
protected |
minimal number of elements a window needs to cover to be used
Referenced by SignalToNoiseEstimatorMeanIterative< Container >::computeSTN_(), and SignalToNoiseEstimatorMeanIterative< Container >::updateMembers_().
|
protected |
used as noise value for windows which cover less than "min_required_elements_" use a very high value if you want to get a low S/N result
Referenced by SignalToNoiseEstimatorMeanIterative< Container >::computeSTN_(), and SignalToNoiseEstimatorMeanIterative< Container >::updateMembers_().
|
protected |
multiplier for the stdev of intensities
Referenced by SignalToNoiseEstimatorMeanIterative< Container >::computeSTN_(), and SignalToNoiseEstimatorMeanIterative< Container >::updateMembers_().
|
protected |
range of data points which belong to a window in Thomson
Referenced by SignalToNoiseEstimatorMeanIterative< Container >::computeSTN_(), and SignalToNoiseEstimatorMeanIterative< Container >::updateMembers_().