94 typedef std::vector<double> ContainerT;
98 bool found_signal =
false;
99 const Size data_size = spectrum.size();
100 ContainerT mz_in(data_size), int_in(data_size), mz_out(data_size), int_out(data_size);
103 for (
Size p = 0; p < spectrum.size(); ++p)
105 mz_in[p] = spectrum[p].getMZ();
106 int_in[p] =
static_cast<double>(spectrum[p].getIntensity());
110 ContainerT::iterator mz_out_it = mz_out.begin();
111 ContainerT::iterator int_out_it = int_out.begin();
112 found_signal = gauss_algo_.filter(mz_in.begin(), mz_in.end(), int_in.begin(), mz_out_it, int_out_it);
116 if (!found_signal && spectrum.size() >= 3)
118 String error_message =
"Found no signal. The Gaussian width is probably smaller than the spacing in your profile data. Try to use a bigger width.";
119 if (spectrum.
getRT() > 0.0)
121 error_message +=
String(
" The error occurred in the spectrum with retention time ") + spectrum.
getRT() +
".";
128 ContainerT::iterator mz_it = mz_out.begin();
129 ContainerT::iterator int_it = int_out.begin();
130 for (
Size p = 0; mz_it != mz_out.end(); mz_it++, int_it++, p++)
132 spectrum[p].setIntensity(*int_it);
133 spectrum[p].setMZ(*mz_it);
140 typedef std::vector<double> ContainerT;
142 if (param_.getValue(
"use_ppm_tolerance").toBool())
145 "GaussFilter: Cannot use ppm tolerance on chromatograms");
148 bool found_signal =
false;
149 const Size data_size = chromatogram.size();
150 ContainerT rt_in(data_size), int_in(data_size), rt_out(data_size), int_out(data_size);
153 for (
Size p = 0; p < chromatogram.size(); ++p)
155 rt_in[p] = chromatogram[p].getRT();
156 int_in[p] = chromatogram[p].getIntensity();
160 ContainerT::iterator mz_out_it = rt_out.begin();
161 ContainerT::iterator int_out_it = int_out.begin();
162 found_signal = gauss_algo_.filter(rt_in.begin(), rt_in.end(), int_in.begin(), mz_out_it, int_out_it);
166 if (!found_signal && chromatogram.size() >= 3)
168 String error_message =
"Found no signal. The Gaussian width is probably smaller than the spacing in your chromatogram data. Try to use a bigger width.";
169 if (chromatogram.
getMZ() > 0.0)
171 error_message +=
String(
" The error occurred in the chromatogram with m/z time ") + chromatogram.
getMZ() +
".";
178 ContainerT::iterator mz_it = rt_out.begin();
179 ContainerT::iterator int_it = int_out.begin();
180 for (
Size p = 0; mz_it != rt_out.end(); mz_it++, int_it++, p++)
182 chromatogram[p].setIntensity(*int_it);
183 chromatogram[p].setMZ(*mz_it);
197 for (
Size i = 0; i < map.
size(); ++i)
200 setProgress(++progress);
205 setProgress(++progress);
#define OPENMS_LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:455
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:93
A method or algorithm argument contains illegal values.
Definition: Exception.h:656
This class represents a Gaussian lowpass-filter which works on uniform as well as on non-uniform prof...
Definition: GaussFilterAlgorithm.h:70
This class represents a Gaussian lowpass-filter which works on uniform as well as on non-uniform prof...
Definition: GaussFilter.h:77
~GaussFilter() override
Destructor.
void filter(MSChromatogram &chromatogram)
Definition: GaussFilter.h:138
void filter(MSSpectrum &spectrum)
Smoothes an MSSpectrum containing profile data.
Definition: GaussFilter.h:92
double spacing_
The spacing of the pre-tabulated kernel coefficients.
Definition: GaussFilter.h:215
void filterExperiment(PeakMap &map)
Smoothes an MSExperiment containing profile data.
Definition: GaussFilter.h:193
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
GaussFilter()
Constructor.
GaussFilterAlgorithm gauss_algo_
Definition: GaussFilter.h:212
The representation of a chromatogram.
Definition: MSChromatogram.h:58
double getMZ() const
returns the mz of the product entry, makes sense especially for MRM scans
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:80
const std::vector< MSChromatogram > & getChromatograms() const
returns the chromatogram list
MSChromatogram & getChromatogram(Size id)
returns a single chromatogram
Size size() const
Definition: MSExperiment.h:127
The representation of a 1D spectrum.
Definition: MSSpectrum.h:71
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
void setType(SpectrumType type)
sets the spectrum type
@ PROFILE
profile data
Definition: SpectrumSettings.h:74
A more convenient string class.
Definition: String.h:61
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47