83 template<
typename SpectrumType,
class TransitionT>
87 bool smooth_data =
false;
102 avg_score /= transition_group.
size();
111 if (current_section.size() < 2)
118 typedef Peak1D LocalPeakType;
121 std::vector<LocalPeakType> data_to_fit;
122 prepareFit_(current_section, data_to_fit, smooth_data);
123 std::unique_ptr<InterpolationModel> model_rt;
124 double quality =
fitRT_(data_to_fit, model_rt);
131 template<
class LocalPeakType>
132 double fitRT_(std::vector<LocalPeakType>& rt_input_data, std::unique_ptr<InterpolationModel>& model)
const
138 return fitter_emg1D.
fit1d(rt_input_data, model);
143 template<
class LocalPeakType>
149 for (ConvexHull2D::PointArrayType::const_iterator it = current_section.begin(); it != current_section.end(); it++)
153 p.setIntensity(it->getY());
154 filter_spec.push_back(p);
159 std::vector<double> distances;
160 for (
Size j = 1; j < filter_spec.size(); ++j)
162 distances.push_back(filter_spec[j].getMZ() - filter_spec[j - 1].getMZ());
164 double dist_average = std::accumulate(distances.begin(), distances.end(), 0.0) / (double) distances.size();
169 new_peak.
setMZ(filter_spec.back().getMZ() + dist_average);
170 filter_spec.push_back(new_peak);
171 new_peak.
setMZ(filter_spec.back().getMZ() + dist_average);
172 filter_spec.push_back(new_peak);
173 new_peak.
setMZ(filter_spec.back().getMZ() + dist_average);
174 filter_spec.push_back(new_peak);
177 new_peak.
setMZ(filter_spec.front().getMZ() - dist_average);
178 filter_spec.insert(filter_spec.begin(), new_peak);
179 new_peak.
setMZ(filter_spec.front().getMZ() - dist_average);
180 filter_spec.insert(filter_spec.begin(), new_peak);
181 new_peak.
setMZ(filter_spec.front().getMZ() - dist_average);
182 filter_spec.insert(filter_spec.begin(), new_peak);
191 filter_param.
setValue(
"gaussian_width", 4 * dist_average);
193 filter.
filter(filter_spec);
197 for (
Size j = 0; j != filter_spec.size(); ++j)
200 p.setPosition(filter_spec[j].getMZ());
201 p.setIntensity(filter_spec[j].getIntensity());
202 data_to_fit.push_back(p);
std::vector< PointType > PointArrayType
Definition: ConvexHull2D.h:76
const Param & getParameters() const
Non-mutable access to the parameters.
void setParameters(const Param ¶m)
Sets the parameters.
const Param & getDefaults() const
Non-mutable access to the default parameters.
Exponentially modified gaussian distribution fitter (1-dim.) using Levenberg-Marquardt algorithm (Eig...
Definition: EmgFitter1D.h:49
QualityType fit1d(const RawDataArrayType &range, std::unique_ptr< InterpolationModel > &model) override
return interpolation model
Scoring of an elution peak using an exponentially modified gaussian distribution model.
Definition: EmgScoring.h:61
void setFitterParam(const Param ¶m)
Definition: EmgScoring.h:71
double elutionModelFit(const ConvexHull2D::PointArrayType ¤t_section, bool smooth_data) const
Definition: EmgScoring.h:108
Param fitter_emg1D_params_
Definition: EmgScoring.h:206
Param getDefaults()
Get default params for the Emg1D fitting.
Definition: EmgScoring.h:77
double calcElutionFitScore(MRMFeature &mrmfeature, MRMTransitionGroup< SpectrumType, TransitionT > &transition_group) const
calculate the elution profile fit score
Definition: EmgScoring.h:84
double fitRT_(std::vector< LocalPeakType > &rt_input_data, std::unique_ptr< InterpolationModel > &model) const
Definition: EmgScoring.h:132
void prepareFit_(const ConvexHull2D::PointArrayType ¤t_section, std::vector< LocalPeakType > &data_to_fit, bool smooth_data) const
Definition: EmgScoring.h:144
An LC-MS feature.
Definition: Feature.h:72
const std::vector< ConvexHull2D > & getConvexHulls() const
Non-mutable access to the convex hulls.
This class represents a Gaussian lowpass-filter which works on uniform as well as on non-uniform prof...
Definition: GaussFilter.h:73
void filter(MSSpectrum &spectrum)
Smoothes an MSSpectrum containing profile data.
A multi-chromatogram MRM feature.
Definition: MRMFeature.h:52
Feature & getFeature(const String &key)
get a specified feature
The representation of a group of transitions in a targeted proteomics experiment.
Definition: MRMTransitionGroup.h:68
Size size() const
Definition: MRMTransitionGroup.h:125
std::vector< ChromatogramType > & getChromatograms()
Definition: MRMTransitionGroup.h:186
The representation of a 1D spectrum.
Definition: MSSpectrum.h:70
Management and storage of parameters / INI files.
Definition: Param.h:70
void setValue(const std::string &key, const ParamValue &value, const std::string &description="", const std::vector< std::string > &tags=std::vector< std::string >())
Sets a value.
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:54
void setIntensity(IntensityType intensity)
Mutable access to the data point intensity (height)
Definition: Peak1D.h:104
void setMZ(CoordinateType mz)
Mutable access to m/z.
Definition: Peak1D.h:113
A more convenient string class.
Definition: String.h:60
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition: openms/include/OpenMS/CONCEPT/Macros.h:120
const double k
Definition: Constants.h:153
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47