|
OpenMS
2.5.0
|
Go to the documentation of this file.
107 nr_windows(nr_windows_),
109 window_length(win_len_),
110 result_windows_even(nr_windows_),
111 result_windows_odd(nr_windows_+1)
125 return std::max(1.0, (get_noise_even(mz)+get_noise_odd(mz))/2.0 );
131 int window_nr = (
int)((mz - mz_start)/window_length);
132 assert(window_nr >= 0);
133 assert(window_nr < (
int)result_windows_even.size());
135 double noise = result_windows_even[window_nr];
142 int window_nr = (
int)((mz - mz_start + window_length/2.0)/window_length);
143 assert(window_nr >= 0);
144 assert(window_nr < (
int)result_windows_odd.size());
146 double noise = result_windows_odd[window_nr];
153 window_length_(window_length)
163 return estimateNoise(spectrum->getMZArray()->data, spectrum->getIntensityArray()->data);
172 return estimateNoise(chrom->getTimeArray()->data, chrom->getIntensityArray()->data);
182 assert(mz_array.size() == int_array.size());
183 assert(mz_array.size() > 2);
185 int nr_windows = (
int)((mz_array[mz_array.size()-1] - mz_array[0])/window_length_) + 1;
191 computeNoiseInWindows_(mz_array, int_array, eval.
result_windows_odd, mz_array[0] - window_length_/2.0);
203 void computeNoiseInWindows_(
const std::vector<double>& mz_array, std::vector<double> int_array, std::vector<double> & result,
double mz_start);
211 double computeMedian_(std::vector<double>::iterator & first, std::vector<double>::iterator & last);
NoiseEstimator estimateNoise(OpenMS::Interfaces::SpectrumPtr spectrum)
Compute noise estimator for an m/z and intensity array using windows.
Definition: SignalToNoiseEstimatorMedianRapid.h:161
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:236
NoiseEstimator estimateNoise(OpenMS::Interfaces::ChromatogramPtr chrom)
Compute noise estimator for an m/z and intensity array using windows.
Definition: SignalToNoiseEstimatorMedianRapid.h:170
double get_noise_odd(double mz)
Definition: SignalToNoiseEstimatorMedianRapid.h:139
double get_noise_even(double mz)
Definition: SignalToNoiseEstimatorMedianRapid.h:128
Class to compute the noise value at a given position.
Definition: SignalToNoiseEstimatorMedianRapid.h:89
std::vector< double > result_windows_even
Noise values for window starting at mz_start (length = nr_windows)
Definition: SignalToNoiseEstimatorMedianRapid.h:98
NoiseEstimator(double nr_windows_, double mz_start_, double win_len_)
Constructor.
Definition: SignalToNoiseEstimatorMedianRapid.h:106
double get_noise_value(double mz)
Return the noise value at a given m/z position.
Definition: SignalToNoiseEstimatorMedianRapid.h:121
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: openms/include/OpenMS/INTERFACES/DataStructures.h:156
NoiseEstimator estimateNoise(const std::vector< double > &mz_array, const std::vector< double > &int_array)
Compute noise estimator for an m/z and intensity array using windows.
Definition: SignalToNoiseEstimatorMedianRapid.h:179
std::vector< double > result_windows_odd
Noise values for window starting at mz_start - 0.5 * window_length (length = nr_windows + 1)
Definition: SignalToNoiseEstimatorMedianRapid.h:100
NoiseEstimator()
Constructor.
Definition: SignalToNoiseEstimatorMedianRapid.h:103
SignalToNoiseEstimatorMedianRapid(double window_length)
default constructor
Definition: SignalToNoiseEstimatorMedianRapid.h:152
double window_length
Length of the window in m/z direction.
Definition: SignalToNoiseEstimatorMedianRapid.h:96
Estimates the signal/noise (S/N) ratio of each data point in a scan by using the median (window based...
Definition: SignalToNoiseEstimatorMedianRapid.h:70
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
double mz_start
Start of m/z domain.
Definition: SignalToNoiseEstimatorMedianRapid.h:94
int nr_windows
Number of windows in m/z direction for which noise values are stored.
Definition: SignalToNoiseEstimatorMedianRapid.h:92
double window_length_
Window length parameter.
Definition: SignalToNoiseEstimatorMedianRapid.h:73