57 template<
typename SpectrumType,
class TransitionT>
61 bool smooth_data =
false;
76 avg_score /= transition_group.
size();
85 if (current_section.size() < 2)
92 typedef Peak1D LocalPeakType;
95 std::vector<LocalPeakType> data_to_fit;
96 prepareFit_(current_section, data_to_fit, smooth_data);
97 std::unique_ptr<InterpolationModel> model_rt;
98 double quality =
fitRT_(data_to_fit, model_rt);
105 template<
class LocalPeakType>
106 double fitRT_(std::vector<LocalPeakType>& rt_input_data, std::unique_ptr<InterpolationModel>& model)
const
112 return fitter_emg1D.
fit1d(rt_input_data, model);
117 template<
class LocalPeakType>
123 for (
const auto& pa : current_section)
126 using IntensityType =
typename LocalPeakType::IntensityType;
128 p.setIntensity(IntensityType(pa.getY()));
129 filter_spec.push_back(p);
134 std::vector<double> distances;
135 for (
Size j = 1; j < filter_spec.size(); ++j)
137 distances.push_back(filter_spec[j].getMZ() - filter_spec[j - 1].getMZ());
139 double dist_average = std::accumulate(distances.begin(), distances.end(), 0.0) / (double) distances.size();
144 new_peak.
setMZ(filter_spec.back().getMZ() + dist_average);
145 filter_spec.push_back(new_peak);
146 new_peak.
setMZ(filter_spec.back().getMZ() + dist_average);
147 filter_spec.push_back(new_peak);
148 new_peak.
setMZ(filter_spec.back().getMZ() + dist_average);
149 filter_spec.push_back(new_peak);
152 new_peak.
setMZ(filter_spec.front().getMZ() - dist_average);
153 filter_spec.insert(filter_spec.begin(), new_peak);
154 new_peak.
setMZ(filter_spec.front().getMZ() - dist_average);
155 filter_spec.insert(filter_spec.begin(), new_peak);
156 new_peak.
setMZ(filter_spec.front().getMZ() - dist_average);
157 filter_spec.insert(filter_spec.begin(), new_peak);
166 filter_param.
setValue(
"gaussian_width", 4 * dist_average);
168 filter.
filter(filter_spec);
172 for (
Size j = 0; j != filter_spec.size(); ++j)
175 p.setPosition(filter_spec[j].getMZ());
176 p.setIntensity(filter_spec[j].getIntensity());
177 data_to_fit.push_back(p);
std::vector< PointType > PointArrayType
Definition: ConvexHull2D.h:50
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:23
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:35
void setFitterParam(const Param ¶m)
Definition: EmgScoring.h:45
double elutionModelFit(const ConvexHull2D::PointArrayType ¤t_section, bool smooth_data) const
Definition: EmgScoring.h:82
Param fitter_emg1D_params_
Definition: EmgScoring.h:181
Param getDefaults()
Get default params for the Emg1D fitting.
Definition: EmgScoring.h:51
double calcElutionFitScore(MRMFeature &mrmfeature, MRMTransitionGroup< SpectrumType, TransitionT > &transition_group) const
calculate the elution profile fit score
Definition: EmgScoring.h:58
double fitRT_(std::vector< LocalPeakType > &rt_input_data, std::unique_ptr< InterpolationModel > &model) const
Definition: EmgScoring.h:106
void prepareFit_(const ConvexHull2D::PointArrayType ¤t_section, std::vector< LocalPeakType > &data_to_fit, bool smooth_data) const
Definition: EmgScoring.h:118
An LC-MS feature.
Definition: Feature.h:46
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:47
void filter(MSSpectrum &spectrum)
Smoothes an MSSpectrum containing profile data.
A multi-chromatogram MRM feature.
Definition: MRMFeature.h:26
Feature & getFeature(const String &key)
get a specified feature
The representation of a group of transitions in a targeted proteomics experiment.
Definition: MRMTransitionGroup.h:42
Size size() const
Definition: MRMTransitionGroup.h:99
std::vector< ChromatogramType > & getChromatograms()
Definition: MRMTransitionGroup.h:160
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
Management and storage of parameters / INI files.
Definition: Param.h:44
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:28
void setIntensity(IntensityType intensity)
Mutable access to the data point intensity (height)
Definition: Peak1D.h:84
void setMZ(CoordinateType mz)
Mutable access to m/z.
Definition: Peak1D.h:93
A more convenient string class.
Definition: String.h:34
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition: openms/include/OpenMS/CONCEPT/Macros.h:94
const double k
Definition: Constants.h:132
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19