Loading...
Searching...
No Matches
pappso::MzRange Class Reference

`#include <mzrange.h>`

## Public Member Functions

| MzRange (pappso_double mz, PrecisionPtr precision)
| MzRange (pappso_double mz, pappso_double delta)
| Construct a MzRange object with `mz` and `delta`.
| MzRange (pappso_double mz, PrecisionPtr precision_lower, PrecisionPtr precision_upper)
| Constructs MzRange object using 2 different precisions: lower and upper.
| MzRange (const MzRange &other)
virtual | ~MzRange ()
MzRange & | operator= (const MzRange &other)
MzRange & | operator+= (const MzRange &other)
MzRange & | operator*= (double number)
pappso_double | getMz () const
bool | contains (pappso_double) const
QString | toString () const
pappso_double | lower () const
pappso_double | upper () const

## Private Attributes

pappso_double | m_mz
pappso_double | m_delta

## Detailed Description

Definition at line 45 of file mzrange.h.

## Constructor & Destructor Documentation

## MzRange() [1/4]

pappso::MzRange::MzRange | ( | pappso_double | mz,
|  | PrecisionPtr | precision
| ) |  |

Constructs MzRange object using 1 precision (the same for lower or upper range).

Definition at line 43 of file mzrange.cpp.

: m_mz(mz), m_delta(precision->delta(m_mz))
{
}
pappso::MzRange::m_delta
pappso_double m_delta
Definition mzrange.h:85
pappso::MzRange::m_mz
pappso_double m_mz
Definition mzrange.h:84
pappso::PrecisionUnit::mz
@ mz

## MzRange() [2/4]

pappso::MzRange::MzRange | ( | pappso_double | mz,
|  | pappso_double | delta
| ) |  |

Construct a MzRange object with `mz` and `delta`.

`delta` should be construed as the whole tolerance such that `lower()` returns `m_mz` - `m_delta` and `upper()` returns `m_mz` + `m_delta`.

Definition at line 56 of file mzrange.cpp.

: m_mz(mz), m_delta(delta)
{
}

## MzRange() [3/4]

pappso::MzRange::MzRange | ( | pappso_double | mz,
|  | PrecisionPtr | precision_lower,
|  | PrecisionPtr | precision_upper
| ) |  |

Constructs MzRange object using 2 different precisions: lower and upper.

Definition at line 63 of file mzrange.cpp.

{
m_delta = (precision_lower->delta(mz) + precision_upper->delta(mz)) / 2;
m_mz = mz - precision_lower->delta(mz) + m_delta;
}

References pappso::PrecisionBase::delta(), m_delta, m_mz, and pappso::mz.

## MzRange() [4/4]

pappso::MzRange::MzRange | ( | const MzRange & | other | ) |

Definition at line 73 of file mzrange.cpp.

: m_mz(other.m_mz), m_delta(other.m_delta)
{
// std::cout << "MzRange::MzRange (const MzRange & other)" << std::endl;
}

## ~MzRange()

pappso::MzRange::~MzRange | ( |  | ) |

virtual

Definition at line 80 of file mzrange.cpp.

{
}

## Member Function Documentation

## contains()

bool pappso::MzRange::contains | ( | pappso_double | mz | ) | const

Definition at line 120 of file mzrange.cpp.

{
// qDebug() << " " << std::abs(mz - m_mz) << " m_delta:" << m_delta;
if(std::abs(mz - m_mz) <= m_delta)
{
return true;
}
return false;
}

References m_delta, m_mz, and pappso::mz.

Referenced by pappso::MorpheusScore::MorpheusScore(), pappso::MassSpectrum::equals(), pappso::MsRunXicExtractorDisk::extractOneXicCoord(), pappso::OboListProxyModel::filterAcceptsRow(), pappso::MassSpectrumWidget::plot(), pappso::PeptideNaturalIsotopeAverage::recursiveDepletion(), and pappso::FilterOboPsiModTermDiffMono::setOboPsiModTerm().

## getMz()

pappso_double pappso::MzRange::getMz | ( |  | ) | const

Definition at line 114 of file mzrange.cpp.

{
return m_mz;
}

References m_mz.

Referenced by pappso::specglob::ExperimentalSpectrum::reverseFindDiffMz().

## lower()

pappso_double pappso::MzRange::lower | ( |  | ) | const

inline

Definition at line 71 of file mzrange.h.

{
return (m_mz - m_delta);
};

Referenced by pappso::MorpheusScore::MorpheusScore(), pappso::TimsFrame::XicComputeStructure::XicComputeStructure(), pappso::MsRunXicExtractorDisk::acquireSlices(), pappso::FilterChargeDeconvolution::addDataPointToList(), pappso::FilterRemoveC13::addExclusionMap(), pappso::MsRunXicExtractor::extractOneXicCoord(), pappso::FilterComplementIonEnhancer::filter(), pappso::MassSpectrum::filterSum(), pappso::specglob::ExperimentalSpectrum::findMz(), pappso::QCPSpectrum::highlightPrecursorPeaks(), pappso::PeptideRawFragmentMasses::pushBackMatchSpectrum(), pappso::FilterMzExclusion::removeTraceInExclusionMargin(), pappso::specglob::ExperimentalSpectrum::reverseFindDiffMz(), pappso::CosineSimilarity::similarity(), and toString().

## operator*=()

MzRange & pappso::MzRange::operator*= | ( | double | number | ) |

Definition at line 105 of file mzrange.cpp.

{
m_mz *= number;
m_delta *= number;
return *this;
}

References m_delta, and m_mz.

## operator+=()

MzRange & pappso::MzRange::operator+= | ( | const MzRange & | other | ) |

Definition at line 96 of file mzrange.cpp.

{
m_mz += other.m_mz;
m_delta += other.m_delta;
return *this;
}

References m_delta, and m_mz.

## operator=()

MzRange & pappso::MzRange::operator= | ( | const MzRange & | other | ) |

Definition at line 86 of file mzrange.cpp.

{
m_mz = other.m_mz;
m_delta = other.m_delta;
return *this;
}

References m_delta, and m_mz.

## toString()

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

Definition at line 131 of file mzrange.cpp.

{
// QString s = "mz=" + QString::number(m_mz) + " delta=" +
// QString::number(m_delta);
return QString("mz=%1 delta=%2 : %3 < %4 < %5")
.arg(m_mz)
.arg(m_delta)
.arg(lower())
.arg(m_mz)
.arg(upper());
}
pappso::MzRange::lower
pappso_double lower() const
Definition mzrange.h:71
pappso::MzRange::upper
pappso_double upper() const
Definition mzrange.h:77

References lower(), m_delta, m_mz, and upper().

## upper()

pappso_double pappso::MzRange::upper | ( |  | ) | const

inline

Definition at line 77 of file mzrange.h.

{
return (m_mz + m_delta);
};

Referenced by pappso::TimsFrame::XicComputeStructure::XicComputeStructure(), pappso::MsRunXicExtractorDisk::acquireSlices(), pappso::FilterChargeDeconvolution::addDataPointToList(), pappso::FilterRemoveC13::addExclusionMap(), pappso::MsRunXicExtractor::extractOneXicCoord(), pappso::FilterComplementIonEnhancer::filter(), pappso::MassSpectrum::filterSum(), pappso::specglob::ExperimentalSpectrum::findMz(), pappso::QCPSpectrum::highlightPrecursorPeaks(), pappso::PeptideRawFragmentMasses::pushBackMatchSpectrum(), pappso::FilterMzExclusion::removeTraceInExclusionMargin(), pappso::specglob::ExperimentalSpectrum::reverseFindDiffMz(), pappso::CosineSimilarity::similarity(), and toString().

## Member Data Documentation

## m_delta

pappso_double pappso::MzRange::m_delta

private

Definition at line 85 of file mzrange.h.

Referenced by MzRange(), contains(), operator*=(), operator+=(), operator=(), and toString().

## m_mz

pappso_double pappso::MzRange::m_mz

private

Definition at line 84 of file mzrange.h.

Referenced by MzRange(), contains(), getMz(), operator*=(), operator+=(), operator=(), and toString().

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

- pappsomspp/mzrange.h
- pappsomspp/mzrange.cpp