pappso::FilterComplementIonEnhancer Class Reference

try to detect complementary ions and assign maximum intensity of both elements More...

`#include <filtercomplementionenhancer.h>`

Inheritance diagram for pappso::FilterComplementIonEnhancer:

## Public Member Functions

| FilterComplementIonEnhancer (double target_mz, PrecisionPtr precision_ptr)
| FilterComplementIonEnhancer (const QualifiedMassSpectrum &qmass_spectrum, PrecisionPtr precision_ptr)
| FilterComplementIonEnhancer (const QString &strBuildParams)
| FilterComplementIonEnhancer (const FilterComplementIonEnhancer &other)
virtual | ~FilterComplementIonEnhancer ()
Trace & | filter (Trace &data_points) const override
void | buildFilterFromString (const QString &strBuildParams) override
| build this filter using a string More...
QString | name () const override
QString | toString () const override
Public Member Functions inherited from pappso::FilterNameInterface
virtual | ~FilterNameInterface ()
Public Member Functions inherited from pappso::FilterInterface
virtual | ~FilterInterface ()

## Private Member Functions

void | enhanceComplementMassInRange (double new_intensity, double mz_lower_bound, double mz_upper_bound, std::vector< DataPoint >::iterator it_begin, std::vector< DataPoint >::iterator it_end) const

## Private Attributes

double | m_targetMzSum
PrecisionPtr | m_precisionPtr

## Additional Inherited Members

## Detailed Description

try to detect complementary ions and assign maximum intensity of both elements

experimental filter

Definition at line 46 of file filtercomplementionenhancer.h.

## Constructor & Destructor Documentation

## FilterComplementIonEnhancer() [1/4]

FilterComplementIonEnhancer::FilterComplementIonEnhancer | ( | double | target_mz,
|  | PrecisionPtr | precision_ptr
| ) |  |

Parameters

  target_mz | the targeted mass of the peak pair
  precision_ptr | matching precision

Definition at line 33 of file filtercomplementionenhancer.cpp.

: m_targetMzSum(target_mz), m_precisionPtr(precision_ptr)
{
}
pappso::FilterComplementIonEnhancer::m_precisionPtr
PrecisionPtr m_precisionPtr
Definition: filtercomplementionenhancer.h:99
pappso::FilterComplementIonEnhancer::m_targetMzSum
double m_targetMzSum
Definition: filtercomplementionenhancer.h:98

## FilterComplementIonEnhancer() [2/4]

pappso::FilterComplementIonEnhancer::FilterComplementIonEnhancer | ( | const QualifiedMassSpectrum & | qmass_spectrum,
|  | pappso::PrecisionPtr | precision_ptr
| ) |  |

Parameters

  qmass_spectrum | qualified mass spectrum to compute the targeted mass of the peak pair
  precision_ptr | matching precision

Definition at line 45 of file filtercomplementionenhancer.cpp.

: m_targetMzSum(((qmass_spectrum.getPrecursorMz() -
(qmass_spectrum.getPrecursorCharge() * MHPLUS /
qmass_spectrum.getPrecursorCharge())) *
qmass_spectrum.getPrecursorCharge() +
(MHPLUS + MHPLUS))),
m_precisionPtr(precision_ptr)
{
}
pappso::QualifiedMassSpectrum::getPrecursorCharge
uint getPrecursorCharge(bool *ok=nullptr) const
Get the precursor charge.
Definition: qualifiedmassspectrum.cpp:316
pappso::QualifiedMassSpectrum::getPrecursorMz
pappso_double getPrecursorMz(bool *ok=nullptr) const
Get the precursor m/z ratio.
Definition: qualifiedmassspectrum.cpp:238
pappso::MHPLUS
const pappso_double MHPLUS(1.007276466879)

## FilterComplementIonEnhancer() [3/4]

pappso::FilterComplementIonEnhancer::FilterComplementIonEnhancer | ( | const QString & | strBuildParams | ) |

Parameters

  strBuildParams | string to build the filter "complementIonEnhancer|456.567;0.02dalton"

Definition at line 57 of file filtercomplementionenhancer.cpp.

{
buildFilterFromString(strBuildParams);
}
pappso::FilterComplementIonEnhancer::buildFilterFromString
void buildFilterFromString(const QString &strBuildParams) override
build this filter using a string
Definition: filtercomplementionenhancer.cpp:64

## FilterComplementIonEnhancer() [4/4]

FilterComplementIonEnhancer::FilterComplementIonEnhancer | ( | const FilterComplementIonEnhancer & | other | ) |

Copy constructor

Parameters

  other | TODO

Definition at line 39 of file filtercomplementionenhancer.cpp.

: m_targetMzSum(other.m_targetMzSum), m_precisionPtr(other.m_precisionPtr)
{
}

## ~FilterComplementIonEnhancer()

FilterComplementIonEnhancer::~FilterComplementIonEnhancer | ( |  | ) |

virtual

Destructor

Definition at line 108 of file filtercomplementionenhancer.cpp.

{
}

## Member Function Documentation

## buildFilterFromString()

void pappso::FilterComplementIonEnhancer::buildFilterFromString | ( | const QString & | strBuildParams | ) |

override virtual

build this filter using a string

Parameters

  strBuildParams | a string coding the filter and its parameters "filterName|param1;param2;param3"

Implements pappso::FilterNameInterface.

Definition at line 64 of file filtercomplementionenhancer.cpp.

{
//"complementIonEnhancer|456.567;0.02dalton"
if(strBuildParams.startsWith("complementIonEnhancer|"))
{
QStringList params = strBuildParams.split("|").back().split(";");
m_targetMzSum = params.at(0).toDouble();
QString precision = params.at(1);
m_precisionPtr =
PrecisionFactory::fromString(precision.replace("dalton", " dalton")
.replace("ppm", " ppm")
.replace("res", " res"));
}
else
{
throw pappso::ExceptionNotRecognized(
QString(
"building FilterComplementIonEnhancer from string %1 is not possible")
.arg(strBuildParams));
}
}
pappso::ExceptionNotRecognized
excetion to use when an item type is not recognized
Definition: exceptionnotrecognized.h:42
pappso::PrecisionFactory::fromString
static PrecisionPtr fromString(const QString &str)
get a precision pointer from a string
Definition: precision.cpp:71

References pappso::PrecisionFactory::fromString().

## enhanceComplementMassInRange()

void pappso::FilterComplementIonEnhancer::enhanceComplementMassInRange | ( | double | new_intensity,
|  | double | mz_lower_bound,
|  | double | mz_upper_bound,
|  | std::vector< DataPoint >::iterator | it_begin,
|  | std::vector< DataPoint >::iterator | it_end
| ) |  | const

private

Definition at line 138 of file filtercomplementionenhancer.cpp.

{
for(std::vector<DataPoint>::iterator it = it_begin; it != it_end; it++)
{
if((it->x >= mz_lower_bound) && (it->x <= mz_upper_bound))
{
if(it->y < new_intensity)
{
it->y = new_intensity;
}
}
}
}

## filter()

pappso::Trace & pappso::FilterComplementIonEnhancer::filter | ( | pappso::Trace & | data_points | ) | const

override virtual

Implements pappso::FilterInterface.

Definition at line 113 of file filtercomplementionenhancer.cpp.

{
auto it_end = data_points.end();
std::sort(data_points.begin(),
it_end,
[](const DataPoint &a, const DataPoint &b) { return (a.y > b.y); });
for(auto it = data_points.begin(); it != it_end; it++)
{
double mz_complement = m_targetMzSum - it->x;
if(mz_complement > 0)
{
MzRange mz_range(mz_complement, m_precisionPtr);
enhanceComplementMassInRange(
it->y, mz_range.lower(), mz_range.upper(), it, it_end);
}
}
data_points.sortX();
return data_points;
}
pappso::FilterComplementIonEnhancer::enhanceComplementMassInRange
void enhanceComplementMassInRange(double new_intensity, double mz_lower_bound, double mz_upper_bound, std::vector< DataPoint >::iterator it_begin, std::vector< DataPoint >::iterator it_end) const
Definition: filtercomplementionenhancer.cpp:138
pappso::MzRange
Definition: mzrange.h:46
pappso::Trace::sortX
void sortX()
Definition: trace.cpp:905
pappso::DataPoint
Definition: datapoint.h:21

References pappso::a, pappso::b, pappso::MzRange::lower(), pappso::Trace::sortX(), and pappso::MzRange::upper().

## name()

QString pappso::FilterComplementIonEnhancer::name | ( |  | ) | const

override virtual

Implements pappso::FilterNameInterface.

Definition at line 90 of file filtercomplementionenhancer.cpp.

{
return "complementIonEnhancer";
}

## toString()

QString pappso::FilterComplementIonEnhancer::toString | ( |  | ) | const

override virtual

Implements pappso::FilterNameInterface.

Definition at line 97 of file filtercomplementionenhancer.cpp.

{
QString strCode = QString("%1|%2;%3")
.arg(name())
.arg(QString::number(m_targetMzSum, 'g', 15))
.arg(m_precisionPtr->toString());
strCode.replace(" ", "");
return strCode;
}
pappso::FilterComplementIonEnhancer::name
QString name() const override
Definition: filtercomplementionenhancer.cpp:90
pappso::PrecisionBase::toString
virtual QString toString() const =0

## Member Data Documentation

## m_precisionPtr

PrecisionPtr pappso::FilterComplementIonEnhancer::m_precisionPtr

private

Definition at line 99 of file filtercomplementionenhancer.h.

## m_targetMzSum

double pappso::FilterComplementIonEnhancer::m_targetMzSum

private

Definition at line 98 of file filtercomplementionenhancer.h.

The documentation for this class was generated from the following files:

- pappsomspp/processing/filters/filtercomplementionenhancer.h
- pappsomspp/processing/filters/filtercomplementionenhancer.cpp