![]() |
OpenMS
|
Estimates the signal/noise (S/N) ratio of each data point in a scan by using the median (histogram based) More...
#include <OpenMS/PROCESSING/NOISEESTIMATION/SignalToNoiseEstimatorMedian.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 |
Public Types inherited from SignalToNoiseEstimator< Container > | |
| typedef Container::const_iterator | PeakIterator |
| typedef PeakIterator::value_type | PeakType |
Public Types inherited from ProgressLogger | |
| enum | LogType { CMD , GUI , NONE } |
| Possible log types. More... | |
Public Member Functions | |
| SignalToNoiseEstimatorMedian () | |
| default constructor | |
| SignalToNoiseEstimatorMedian (const SignalToNoiseEstimatorMedian &source) | |
| Copy Constructor. | |
Public Member Functions inherited from SignalToNoiseEstimator< Container > | |
| SignalToNoiseEstimator () | |
| Constructor. | |
| SignalToNoiseEstimator (const SignalToNoiseEstimator &source) | |
| Copy constructor. | |
| SignalToNoiseEstimator & | operator= (const SignalToNoiseEstimator &source) |
| Assignment operator. | |
| ~SignalToNoiseEstimator () override | |
| Destructor. | |
| 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. | |
| virtual double | getSignalToNoise (const Size index) const |
Public Member Functions inherited from DefaultParamHandler | |
| DefaultParamHandler (const std::string &name) | |
| Constructor with name that is displayed in error messages. | |
| DefaultParamHandler (const DefaultParamHandler &rhs) | |
| Copy constructor. | |
| virtual | ~DefaultParamHandler () |
| Destructor. | |
| DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
| Assignment operator. | |
| virtual bool | operator== (const DefaultParamHandler &rhs) const |
| Equality operator. | |
| void | setParameters (const Param ¶m) |
| Sets the parameters. | |
| const Param & | getParameters () const |
| Non-mutable access to the parameters. | |
| const Param & | getDefaults () const |
| Non-mutable access to the default parameters. | |
| const std::string & | getName () const |
| Non-mutable access to the name. | |
| void | setName (const std::string &name) |
| Mutable access to the name. | |
| const std::vector< std::string > & | getSubsections () const |
| Non-mutable access to the registered subsections. | |
Public Member Functions inherited from ProgressLogger | |
| ProgressLogger () | |
| Constructor. | |
| virtual | ~ProgressLogger () |
| Destructor. | |
| ProgressLogger (const ProgressLogger &other) | |
| Copy constructor. | |
| ProgressLogger & | operator= (const ProgressLogger &other) |
| Assignment Operator. | |
| void | setLogType (LogType type) const |
| Sets the progress log that should be used. The default type is NONE! | |
| LogType | getLogType () const |
| Returns the type of progress log being used. | |
| void | setLogger (ProgressLoggerImpl *logger) |
| Sets the logger to be used for progress logging. | |
| void | startProgress (SignedSize begin, SignedSize end, const std::string &label) const |
| Initializes the progress display. | |
| void | setProgress (SignedSize value) const |
| Sets the current progress. | |
| void | endProgress (UInt64 bytes_processed=0) const |
| void | nextProgress () const |
| increment progress by 1 (according to range begin-end) | |
Assignment | |
| double | max_intensity_ |
| maximal intensity considered during binning (values above get discarded) | |
| double | auto_max_stdev_Factor_ |
| parameter for initial automatic estimation of "max_intensity_": a stdev multiplier | |
| double | auto_max_percentile_ |
| parameter for initial automatic estimation of "max_intensity_" percentile or a stdev | |
| int | auto_mode_ |
| determines which method shall be used for estimating "max_intensity_". valid are MANUAL=-1, AUTOMAXBYSTDEV=0 or AUTOMAXBYPERCENT=1 | |
| double | win_len_ |
| range of data points which belong to a window in Thomson | |
| int | bin_count_ |
| number of bins in the histogram | |
| int | min_required_elements_ |
| minimal number of elements a window needs to cover to be used | |
| double | noise_for_empty_window_ |
| bool | write_log_messages_ |
| double | sparse_window_percent_ |
| double | histogram_oob_percent_ |
| SignalToNoiseEstimatorMedian & | operator= (const SignalToNoiseEstimatorMedian &source) |
| ~SignalToNoiseEstimatorMedian () override | |
| Destructor. | |
| double | getSparseWindowPercent () const |
| Returns how many percent of the windows were sparse. | |
| double | getHistogramRightmostPercent () const |
| Returns the percentage where the median was found in the rightmost bin. | |
| void | computeSTN_ (const Container &c) override |
| void | updateMembers_ () override |
| overridden function from DefaultParamHandler to keep members up to date, when a parameter is changed | |
Additional Inherited Members | |
Static Public Member Functions inherited from DefaultParamHandler | |
| static void | writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const std::string &key_prefix="") |
| Writes all parameters to meta values. | |
Protected Member Functions inherited from SignalToNoiseEstimator< Container > | |
| GaussianEstimate | estimate_ (const PeakIterator &scan_first_, const PeakIterator &scan_last_) const |
| calculate mean & stdev of intensities of a spectrum | |
Protected Member Functions inherited from DefaultParamHandler | |
| void | defaultsToParam_ () |
| Updates the parameters after the defaults have been set in the constructor. | |
Protected Attributes inherited from SignalToNoiseEstimator< Container > | |
| std::vector< double > | stn_estimates_ |
| stores the noise estimate for each peak | |
Protected Attributes inherited from DefaultParamHandler | |
| Param | param_ |
| Container for current parameters. | |
| Param | defaults_ |
| Container for default parameters. This member should be filled in the constructor of derived classes! | |
| std::vector< std::string > | subsections_ |
| Container for registered subsections. This member should be filled in the constructor of derived classes! | |
| std::string | error_name_ |
| Name that is displayed in error messages during the parameter checking. | |
| bool | check_defaults_ |
| If this member is set to false no checking if parameters in done;. | |
| bool | warn_empty_defaults_ |
| If this member is set to false no warning is emitted when defaults are empty;. | |
Protected Attributes inherited from ProgressLogger | |
| LogType | type_ |
| time_t | last_invoke_ |
| ProgressLoggerImpl * | current_logger_ |
Static Protected Attributes inherited from ProgressLogger | |
| static int | recursion_depth_ |
Estimates the signal/noise (S/N) ratio of each data point in a scan by using the median (histogram based)
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 to be the median of the intensities of the current window. If the number of elements in the current window is not sufficient (param: MinReqElements), 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 (params: AutoMaxIntensity, auto_mode) by two different methods or can be set directly by the user (param: max_intensity). Within the histogram bin that contains the median, the noise value is linearly interpolated between that bin's edges (assuming a uniform distribution of points within the bin), rather than using the bin's center. This keeps the estimate close to continuous as the underlying data changes, instead of only ever taking one of bin_count discrete values. If the (estimated) max_intensity value is too low and the median is found to be in the last (&highest) bin, a warning will be given. In this case you should increase max_intensity (and optionally the bin_count).
Changing any of the parameters will invalidate the S/N values (which will invoke a recomputation on the next request).
@htmlinclude OpenMS_SignalToNoiseEstimatorMedian.parameters
| typedef SignalToNoiseEstimator<Container>::GaussianEstimate GaussianEstimate |
| typedef SignalToNoiseEstimator<Container>::PeakIterator PeakIterator |
| typedef SignalToNoiseEstimator<Container>::PeakType PeakType |
| enum IntensityThresholdCalculation |
|
inline |
|
inline |
Copy Constructor.
References SignalToNoiseEstimatorMedian< Container >::updateMembers_().
|
inlineoverride |
Destructor.
|
inlineoverrideprotectedvirtual |
Calculate signal-to-noise values for all data points given, by using a sliding window approach
| [in] | c | Raw data, usually an MSSpectrum |
| Throws | Exception::InvalidValue |
start progress estimation
Implements SignalToNoiseEstimator< Container >.
References SignalToNoiseEstimatorMedian< Container >::auto_max_percentile_, SignalToNoiseEstimatorMedian< Container >::auto_max_stdev_Factor_, SignalToNoiseEstimatorMedian< Container >::auto_mode_, SignalToNoiseEstimatorMedian< Container >::AUTOMAXBYPERCENT, SignalToNoiseEstimatorMedian< Container >::AUTOMAXBYSTDEV, SignalToNoiseEstimatorMedian< Container >::bin_count_, ProgressLogger::endProgress(), SignalToNoiseEstimator< Container >::estimate_(), SignalToNoiseEstimatorMedian< Container >::histogram_oob_percent_, SignalToNoiseEstimatorMedian< Container >::max_intensity_, SignalToNoiseEstimator< Container >::GaussianEstimate::mean, SignalToNoiseEstimatorMedian< Container >::min_required_elements_, SignalToNoiseEstimatorMedian< Container >::noise_for_empty_window_, OPENMS_LOG_WARN, ProgressLogger::setProgress(), SignalToNoiseEstimatorMedian< Container >::sparse_window_percent_, ProgressLogger::startProgress(), SignalToNoiseEstimator< Container >::stn_estimates_, OpenMS::StringUtils::toStr(), SignalToNoiseEstimator< Container >::GaussianEstimate::variance, SignalToNoiseEstimatorMedian< Container >::win_len_, and SignalToNoiseEstimatorMedian< Container >::write_log_messages_.
|
inline |
Returns the percentage where the median was found in the rightmost bin.
References SignalToNoiseEstimatorMedian< Container >::histogram_oob_percent_.
|
inline |
Returns how many percent of the windows were sparse.
References SignalToNoiseEstimatorMedian< Container >::sparse_window_percent_.
|
inline |
|
inlineoverrideprotectedvirtual |
overridden function from DefaultParamHandler to keep members up to date, when a parameter is changed
Reimplemented from DefaultParamHandler.
References SignalToNoiseEstimatorMedian< Container >::auto_max_percentile_, SignalToNoiseEstimatorMedian< Container >::auto_max_stdev_Factor_, SignalToNoiseEstimatorMedian< Container >::auto_mode_, SignalToNoiseEstimatorMedian< Container >::bin_count_, Param::getValue(), SignalToNoiseEstimatorMedian< Container >::max_intensity_, SignalToNoiseEstimatorMedian< Container >::min_required_elements_, SignalToNoiseEstimatorMedian< Container >::noise_for_empty_window_, DefaultParamHandler::param_, SignalToNoiseEstimator< Container >::stn_estimates_, ParamValue::toBool(), SignalToNoiseEstimatorMedian< Container >::win_len_, and SignalToNoiseEstimatorMedian< Container >::write_log_messages_.
Referenced by SignalToNoiseEstimatorMedian< Container >::operator=(), and SignalToNoiseEstimatorMedian< Container >::SignalToNoiseEstimatorMedian().
|
protected |
parameter for initial automatic estimation of "max_intensity_" percentile or a stdev
Referenced by SignalToNoiseEstimatorMedian< Container >::computeSTN_(), and SignalToNoiseEstimatorMedian< Container >::updateMembers_().
|
protected |
parameter for initial automatic estimation of "max_intensity_": a stdev multiplier
Referenced by SignalToNoiseEstimatorMedian< Container >::computeSTN_(), and SignalToNoiseEstimatorMedian< Container >::updateMembers_().
|
protected |
determines which method shall be used for estimating "max_intensity_". valid are MANUAL=-1, AUTOMAXBYSTDEV=0 or AUTOMAXBYPERCENT=1
Referenced by SignalToNoiseEstimatorMedian< Container >::computeSTN_(), and SignalToNoiseEstimatorMedian< Container >::updateMembers_().
|
protected |
number of bins in the histogram
Referenced by SignalToNoiseEstimatorMedian< Container >::computeSTN_(), and SignalToNoiseEstimatorMedian< Container >::updateMembers_().
|
protected |
|
protected |
maximal intensity considered during binning (values above get discarded)
Referenced by SignalToNoiseEstimatorMedian< Container >::computeSTN_(), and SignalToNoiseEstimatorMedian< Container >::updateMembers_().
|
protected |
minimal number of elements a window needs to cover to be used
Referenced by SignalToNoiseEstimatorMedian< Container >::computeSTN_(), and SignalToNoiseEstimatorMedian< 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 SignalToNoiseEstimatorMedian< Container >::computeSTN_(), and SignalToNoiseEstimatorMedian< Container >::updateMembers_().
|
protected |
|
protected |
range of data points which belong to a window in Thomson
Referenced by SignalToNoiseEstimatorMedian< Container >::computeSTN_(), and SignalToNoiseEstimatorMedian< Container >::updateMembers_().
|
protected |