30 #include "../../exception/exceptionnotrecognized.h"
40 : m_exclusionPrecision(precision_ptr)
45 : m_exclusionPrecision(other.m_exclusionPrecision)
57 if(strBuildParams.startsWith(
"mzExclusion|"))
60 strBuildParams.split(
"|").back().split(
";", Qt::SkipEmptyParts);
62 QString precision = params.at(0);
63 m_exclusionPrecision =
65 .replace(
"ppm",
" ppm")
66 .replace(
"res",
" res"));
71 QString(
"building mzExclusion from string %1 is not possible")
72 .arg(strBuildParams));
81 qDebug() <<
"before" << data_points.size();
84 Trace new_trace = removeTraceInExclusionMargin(data_points);
86 data_points = std::move(new_trace);
87 qDebug() <<
"after" << data_points.size();
103 QString(
"%1|%2").arg(name()).arg(m_exclusionPrecision->toString());
105 strCode.replace(
" ",
"");
115 std::vector<MzRange> excluded_ranges;
117 for(
auto &data_point : points)
119 auto exclude_index = excluded_ranges.begin(), end = excluded_ranges.end();
122 std::find_if(exclude_index, end, [&data_point](
MzRange range) {
123 return (data_point.x >= range.
lower() &&
124 data_point.x <= range.
upper());
126 if(exclude_index == end)
128 new_trace.push_back(data_point);
129 MzRange new_range(data_point.x, m_exclusionPrecision);
130 excluded_ranges.push_back(new_range);
excetion to use when an item type is not recognized
void buildFilterFromString(const QString &strBuildParams) override
build this filter using a string
QString toString() const override
Trace & filter(Trace &data_points) const override
get all the datapoints and remove different isotope and add their intensity and change to charge = 1 ...
virtual ~FilterMzExclusion()
Trace removeTraceInExclusionMargin(Trace &points) const
FilterMzExclusion(PrecisionPtr precision_ptr)
QString name() const override
pappso_double lower() const
pappso_double upper() const
static PrecisionPtr fromString(const QString &str)
get a precision pointer from a string
A simple container of DataPoint instances.
Delete small peaks in the exclusion range.
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...