pappso::MzIntegrationParams Class Reference

The MzIntegrationParams class provides the parameters definining how m/z ! More...

`#include <mzintegrationparams.h>`

## Public Member Functions

| MzIntegrationParams ()
| MzIntegrationParams (pappso::pappso_double minMz, pappso::pappso_double maxMz, BinningType binningType, int decimalPlaces, pappso::PrecisionPtr precisionPtr, bool applyMzShift, pappso::pappso_double mzShift, bool removeZeroValDataPoints)
| MzIntegrationParams (const MzIntegrationParams &other)
virtual | ~MzIntegrationParams ()
MzIntegrationParams & | operator= (const MzIntegrationParams &other)
void | setSmallestMz (pappso::pappso_double value)
void | updateSmallestMz (pappso::pappso_double value)
pappso::pappso_double | getSmallestMz () const
void | setGreatestMz (pappso::pappso_double value)
void | updateGreatestMz (pappso::pappso_double value)
pappso::pappso_double | getGreatestMz () const
void | setBinningType (BinningType binningType)
BinningType | getBinningType () const
void | setDecimalPlaces (int decimal_places)
int | getDecimalPlaces () const
void | setPrecision (pappso::PrecisionPtr precisionPtr)
pappso::PrecisionPtr | getPrecision () const
void | setApplyMzShift (bool applyMzShift)
bool | isApplyMzShift () const
void | setMzShift (double value)
double | getMzShift () const
void | setRemoveZeroValDataPoints (bool removeOrNot=true)
bool | isRemoveZeroValDataPoints () const
void | reset ()
| Reset the instance to default values. More...
bool | isValid () const
bool | hasValidMzRange () const
std::vector< pappso::pappso_double > | createBins ()
std::vector< pappso::pappso_double > | createBins (pappso::MassSpectrumCstSPtr mass_spectrum_csp)
QString | toString (int offset=0, const QString &spacer=QString()) const

## Private Member Functions

std::vector< double > | createArbitraryBins ()
std::vector< double > | createDataBasedBins (pappso::MassSpectrumCstSPtr massSpectrum)

## Private Attributes

pappso::pappso_double | m_smallestMz = std::numeric_limits<double>::max()
pappso::pappso_double | m_greatestMz = std::numeric_limits<double>::min()
BinningType | m_binningType = BinningType::NONE
int | m_decimalPlaces = -1
pappso::PrecisionPtr | mp_precision
bool | m_applyMzShift = false
pappso::pappso_double | m_mzShift = 0
bool | m_removeZeroValDataPoints = true

## Detailed Description

The MzIntegrationParams class provides the parameters definining how m/z !

Depending on the various mass spectrometer vendors, the mass spectrometry data files are structured in different ways and the software for mass data format conversion from raw files to mzML or mzXML produce mass data characterized by different behaviours.

The different characteristics of mass spectrometry data set are:

The size of the various mass spectra in the file is constant or variable;

The first m/z value of the various spectra is identical or not (that is, the spectra are root in a constant or variable root m/z value);

The m/z delta between two consecutive m/z values of a given spectrum are constant or variable;

The spectra contain or not 0-value m/z data points;

Definition at line 84 of file mzintegrationparams.h.

## Constructor & Destructor Documentation

## MzIntegrationParams() [1/3]

pappso::MzIntegrationParams::MzIntegrationParams | ( |  | ) |

Definition at line 66 of file mzintegrationparams.cpp.

{
m_binningType = BinningType::NONE;
mp_precision = pappso::PrecisionFactory::getPpmInstance(20);
}
pappso::MzIntegrationParams::m_binningType
BinningType m_binningType
Definition: mzintegrationparams.h:151
pappso::MzIntegrationParams::mp_precision
pappso::PrecisionPtr mp_precision
Definition: mzintegrationparams.h:157
pappso::PrecisionFactory::getPpmInstance
static PrecisionPtr getPpmInstance(pappso_double value)
get a ppm precision pointer
Definition: precision.cpp:149
pappso::BinningType::NONE
@ NONE
< no binning

References pappso::PrecisionFactory::getPpmInstance(), m_binningType, mp_precision, and pappso::NONE.

## MzIntegrationParams() [2/3]

pappso::MzIntegrationParams::MzIntegrationParams | ( | pappso::pappso_double | minMz,
|  | pappso::pappso_double | maxMz,
|  | BinningType | binningType,
|  | int | decimalPlaces,
|  | pappso::PrecisionPtr | precisionPtr,
|  | bool | applyMzShift,
|  | pappso::pappso_double | mzShift,
|  | bool | removeZeroValDataPoints
| ) |  |

Definition at line 73 of file mzintegrationparams.cpp.

: m_smallestMz(minMz),
m_greatestMz(maxMz),
m_binningType(binningType),
m_decimalPlaces(decimalPlaces),
mp_precision(precisionPtr),
m_applyMzShift(applyMzShift),
m_mzShift(mzShift),
m_removeZeroValDataPoints(removeZeroValDataPoints)
{
if(mp_precision == nullptr)
mp_precision = pappso::PrecisionFactory::getPpmInstance(20);
}
pappso::MzIntegrationParams::m_smallestMz
pappso::pappso_double m_smallestMz
Definition: mzintegrationparams.h:145
pappso::MzIntegrationParams::m_greatestMz
pappso::pappso_double m_greatestMz
Definition: mzintegrationparams.h:149
pappso::MzIntegrationParams::m_applyMzShift
bool m_applyMzShift
Definition: mzintegrationparams.h:159
pappso::MzIntegrationParams::m_decimalPlaces
int m_decimalPlaces
Definition: mzintegrationparams.h:153
pappso::MzIntegrationParams::m_removeZeroValDataPoints
bool m_removeZeroValDataPoints
Definition: mzintegrationparams.h:161
pappso::MzIntegrationParams::m_mzShift
pappso::pappso_double m_mzShift
Definition: mzintegrationparams.h:160

References pappso::PrecisionFactory::getPpmInstance(), and mp_precision.

## MzIntegrationParams() [3/3]

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

Definition at line 95 of file mzintegrationparams.cpp.

: m_smallestMz(other.m_smallestMz),
m_greatestMz(other.m_greatestMz),
m_binningType(other.m_binningType),
m_decimalPlaces(other.m_decimalPlaces),
mp_precision(other.mp_precision),
m_applyMzShift(other.m_applyMzShift),
m_mzShift(other.m_mzShift),
m_removeZeroValDataPoints(other.m_removeZeroValDataPoints)
{
if(mp_precision == nullptr)
mp_precision = pappso::PrecisionFactory::getPpmInstance(20);
}

References pappso::PrecisionFactory::getPpmInstance(), and mp_precision.

## ~MzIntegrationParams()

pappso::MzIntegrationParams::~MzIntegrationParams | ( |  | ) |

virtual

Definition at line 110 of file mzintegrationparams.cpp.

{
}

## Member Function Documentation

## createArbitraryBins()

std::vector< double > pappso::MzIntegrationParams::createArbitraryBins | ( |  | ) |

private

Definition at line 383 of file mzintegrationparams.cpp.

{
// qDebug();
// Now starts the tricky stuff. Depending on how the binning has been
// configured, we need to take diverse actions.
// qDebug() << "Bin size:" << mp_precision->toString();
pappso::pappso_double min_mz = m_smallestMz;
pappso::pappso_double max_mz = m_greatestMz;
// qDebug() << QString::asprintf("min_mz: %.6f\n", min_mz)
//<< QString::asprintf("max_mz: %.6f\n", max_mz);
pappso::pappso_double binSize = mp_precision->delta(min_mz);
// qDebug() << QString::asprintf(
//"binSize is the precision delta for min_mz: %.6f\n", binSize);
// Only compute the decimal places if they were not configured already.
if(m_decimalPlaces == -1)
{
// We want as many decimal places as there are 0s between the integral
// part of the double and the first non-0 cipher. For example, if
// binSize is 0.004, zero decimals is 2 and m_decimalPlaces is set to 3,
// because we want decimals up to 4 included.
m_decimalPlaces = pappso::Utils::zeroDecimalsInValue(binSize) + 1;
// qDebug() << "With the binSize m_decimalPlaces was computed to be:"
//<< m_decimalPlaces;
}
// Now that we have defined the value of m_decimalPlaces, let's use that
// value.
double first_mz = ceil((min_mz * std::pow(10, m_decimalPlaces)) - 0.49) /
pow(10, m_decimalPlaces);
double last_mz =
ceil((max_mz * pow(10, m_decimalPlaces)) - 0.49) / pow(10, m_decimalPlaces);
// qDebug() << "After having accounted for the decimals, new min/max values:"
//<< QString::asprintf("Very first data point: %.6f\n", first_mz)
//<< QString::asprintf("Very last data point to reach: %.6f\n",
// last_mz);
// Instanciate the vector of mz double_s that we'll feed with the bins.
std::vector<pappso::pappso_double> bins;
// Store that very first value for later use in the loop.
// The bins are notking more than:
//
// 1. The first mz (that is the smallest mz value found in all the spectra
// 2. A sequence of mz values corresponding to that first mz value
// incremented by the bin size.
// Seed the root of the bin vector with the first mz value rounded above as
// requested.
pappso::pappso_double previous_mz_bin = first_mz;
bins.push_back(previous_mz_bin);
// Now continue adding mz values until we have reached the end of the
// spectrum, that is the max_mz value, as converted using the decimals to
// last_mz.
// debugCount value used below for debugging purposes.
// int debugCount = 0;
while(previous_mz_bin <= last_mz)
{
// Calculate dynamically the precision delta according to the current mz
// value.
double current_mz =
previous_mz_bin + mp_precision->delta(previous_mz_bin);
// qDebug() << QString::asprintf(
//"previous_mzBin: %.6f and current_mz: %.6f\n",
// previous_mz_bin,
// current_mz);
// Now apply on the obtained mz value the decimals that were either set
// or computed earlier.
double current_rounded_mz =
ceil((current_mz * pow(10, m_decimalPlaces)) - 0.49) /
pow(10, m_decimalPlaces);
// qDebug() << QString::asprintf(
//"current_mz: %.6f and current_rounded_mz: %.6f and previous_mzBin "
//": % .6f\n ",
// current_mz,
// current_rounded_mz,
// previous_mz_bin);
// If rounding makes the new value identical to the previous one, then
// that means that we need to decrease roughness.
if(current_rounded_mz == previous_mz_bin)
{
++m_decimalPlaces;
current_rounded_mz =
ceil((current_mz * pow(10, m_decimalPlaces)) - 0.49) /
pow(10, m_decimalPlaces);
qDebug().noquote()
<< "Had to increment decimal places by one while creating the bins "
"in BinningType::ARBITRARY mode..";
}
bins.push_back(current_rounded_mz);
// Use the local_mz value for the storage of the previous mz bin.
previous_mz_bin = current_rounded_mz;
}
#if 0
QString fileName = "/tmp/massSpecArbitraryBins.txt-at-" +
QDateTime::currentDateTime().toString("yyyyMMdd-HH-mm-ss");
qDebug() << "Writing the list of bins setup in the "
"mass spectrum in file "
<< fileName;
QFile file(fileName);
file.open(QIODevice::WriteOnly);
QTextStream fileStream(&file);
for(auto &&bin : bins)
fileStream << QString("%1\n").arg(bin, 0, 'f', 10);
fileStream.flush();
file.close();
#endif
// qDebug() << "Prepared bins with " << bins.size() << "elements."
//<< "starting with mz" << bins.front() << "ending with mz"
//<< bins.back();
return bins;
}
pappso::PrecisionBase::delta
virtual pappso_double delta(pappso_double value) const =0
pappso::Utils::zeroDecimalsInValue
static int zeroDecimalsInValue(pappso_double value)
0.11 would return 0 (no empty decimal) 2.001 would return 2 1000.0001254 would return 3
Definition: utils.cpp:81
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:48

References pappso::PrecisionBase::delta(), m_decimalPlaces, m_greatestMz, m_smallestMz, mp_precision, and pappso::Utils::zeroDecimalsInValue().

Referenced by createBins().

## createBins() [1/2]

std::vector< double > pappso::MzIntegrationParams::createBins | ( |  | ) |

Definition at line 323 of file mzintegrationparams.cpp.

{
// qDebug();
std::vector<double> bins;
if(m_binningType == BinningType::NONE)
{
// If no binning is to be performed, fine.
return bins;
}
else if(m_binningType == BinningType::ARBITRARY)
{
// Use only data in the MzIntegrationParams member data.
return createArbitraryBins();
}
else if(m_binningType == BinningType::DATA_BASED)
{
// qDebug();
qFatal("Programming error.");
}
return bins;
}
pappso::MzIntegrationParams::createArbitraryBins
std::vector< double > createArbitraryBins()
Definition: mzintegrationparams.cpp:383
pappso::BinningType::DATA_BASED
@ DATA_BASED
binning based on mass spectral data
pappso::BinningType::ARBITRARY
@ ARBITRARY
binning based on arbitrary bin size value

References pappso::ARBITRARY, createArbitraryBins(), pappso::DATA_BASED, m_binningType, and pappso::NONE.

## createBins() [2/2]

std::vector< double > pappso::MzIntegrationParams::createBins | ( | pappso::MassSpectrumCstSPtr | mass_spectrum_csp | ) |

Definition at line 352 of file mzintegrationparams.cpp.

{
// qDebug();
std::vector<double> bins;
if(m_binningType == BinningType::NONE)
{
// If no binning is to be performed, fine.
return bins;
}
else if(m_binningType == BinningType::ARBITRARY)
{
// Use only data in the MzIntegrationParams member data.
return createArbitraryBins();
}
else if(m_binningType == BinningType::DATA_BASED)
{
// qDebug();
// Use the first spectrum to perform the data-based bins
return createDataBasedBins(mass_spectrum_csp);
}
return bins;
}
pappso::MzIntegrationParams::createDataBasedBins
std::vector< double > createDataBasedBins(pappso::MassSpectrumCstSPtr massSpectrum)
Definition: mzintegrationparams.cpp:538

References pappso::ARBITRARY, createArbitraryBins(), createDataBasedBins(), pappso::DATA_BASED, m_binningType, and pappso::NONE.

## createDataBasedBins()

std::vector< double > pappso::MzIntegrationParams::createDataBasedBins | ( | pappso::MassSpectrumCstSPtr | massSpectrum | ) |

private

Definition at line 538 of file mzintegrationparams.cpp.

{
// qDebug();
// The bins in *this mass spectrum must be calculated starting from the
// data in the mass_spectrum_csp parameter.
// Instanciate the vector of mz double_s that we'll feed with the bins.
std::vector<pappso::pappso_double> bins;
if(mass_spectrum_csp->size() < 2)
return bins;
// Make sure the spectrum is sorted, as this functions takes for granted
// that the DataPoint instances are sorted in ascending x (== mz) value
// order.
pappso::MassSpectrum local_mass_spectrum = *mass_spectrum_csp;
local_mass_spectrum.sortMz();
pappso::pappso_double min_mz = m_smallestMz;
// qDebug() << "The min_mz:" << min_mz;
if(m_decimalPlaces != -1)
min_mz = ceil((min_mz * pow(10, m_decimalPlaces)) - 0.49) /
pow(10, m_decimalPlaces);
// Two values for the definition of a MassSpectrumBin.
// The first value of the mz range that defines the bin. This value is part
// of the bin.
pappso::pappso_double start_mz_in = min_mz;
// The second value of the mz range that defines the bin. This value is
// *not* part of the bin.
pappso::pappso_double end_mz_out;
std::vector<pappso::DataPoint>::const_iterator it =
local_mass_spectrum.begin();
pappso::pappso_double prev_mz = it->x;
if(m_decimalPlaces != -1)
prev_mz = ceil((prev_mz * pow(10, m_decimalPlaces)) - 0.49) /
pow(10, m_decimalPlaces);
++it;
while(it != local_mass_spectrum.end())
{
pappso::pappso_double next_mz = it->x;
if(m_decimalPlaces != -1)
next_mz = ceil((next_mz * pow(10, m_decimalPlaces)) - 0.49) /
pow(10, m_decimalPlaces);
pappso::pappso_double step = next_mz - prev_mz;
end_mz_out = start_mz_in + step;
if(m_decimalPlaces != -1)
end_mz_out = ceil((end_mz_out * pow(10, m_decimalPlaces)) - 0.49) /
pow(10, m_decimalPlaces);
// The data point that is crafted has a 0 y-value. The binning must
// indeed not create artificial intensity data.
// qDebug() << "Pushing back bin:" << start_mz_in << end_mz_out;
bins.push_back(start_mz_in);
// Prepare next bin
start_mz_in = end_mz_out;
// Update prev_mz to be the current one for next iteration.
prev_mz = next_mz;
// Now got the next DataPoint instance.
++it;
}
#if 0
QString fileName = "/tmp/massSpecDataBasedBins.txt";
qDebug() << "Writing the list of bins setup in the "
"mass spectrum in file "
<< fileName;
QFile file(fileName);
file.open(QIODevice::WriteOnly);
QTextStream fileStream(&file);
for(auto &&bin : m_bins)
fileStream << QString("[%1-%2]\n")
.arg(bin.startMzIn, 0, 'f', 10)
.arg(bin.endMzOut, 0, 'f', 10);
fileStream.flush();
file.close();
qDebug() << "elements."
<< "starting with mz" << m_bins.front().startMzIn << "ending with mz"
<< m_bins.back().endMzOut;
#endif
return bins;
}
pappso::MassSpectrum
Class to represent a mass spectrum.
Definition: massspectrum.h:71
pappso::MassSpectrum::sortMz
void sortMz()
Sort the DataPoint instances of this spectrum.
Definition: massspectrum.cpp:201

References m_decimalPlaces, m_smallestMz, and pappso::MassSpectrum::sortMz().

Referenced by createBins().

## getBinningType()

BinningType pappso::MzIntegrationParams::getBinningType | ( |  | ) | const

Definition at line 187 of file mzintegrationparams.cpp.

{
return m_binningType;
}

References m_binningType.

## getDecimalPlaces()

int pappso::MzIntegrationParams::getDecimalPlaces | ( |  | ) | const

Definition at line 200 of file mzintegrationparams.cpp.

{
return m_decimalPlaces;
}

References m_decimalPlaces.

## getGreatestMz()

pappso::pappso_double pappso::MzIntegrationParams::getGreatestMz | ( |  | ) | const

Definition at line 175 of file mzintegrationparams.cpp.

{
return m_greatestMz;
}

References m_greatestMz.

## getMzShift()

double pappso::MzIntegrationParams::getMzShift | ( |  | ) | const

Definition at line 257 of file mzintegrationparams.cpp.

{
return m_mzShift;
}

References m_mzShift.

## getPrecision()

pappso::PrecisionPtr pappso::MzIntegrationParams::getPrecision | ( |  | ) | const

Definition at line 215 of file mzintegrationparams.cpp.

{
return mp_precision;
}

References mp_precision.

## getSmallestMz()

pappso::pappso_double pappso::MzIntegrationParams::getSmallestMz | ( |  | ) | const

Definition at line 154 of file mzintegrationparams.cpp.

{
return m_smallestMz;
}

References m_smallestMz.

## hasValidMzRange()

bool pappso::MzIntegrationParams::hasValidMzRange | ( |  | ) | const

Definition at line 315 of file mzintegrationparams.cpp.

{
return (m_smallestMz != std::numeric_limits<double>::max()) &&
(m_greatestMz != std::numeric_limits<double>::min());
}

References m_greatestMz, and m_smallestMz.

## isApplyMzShift()

bool pappso::MzIntegrationParams::isApplyMzShift | ( |  | ) | const

Definition at line 229 of file mzintegrationparams.cpp.

{
return m_applyMzShift;
}

References m_applyMzShift.

## isRemoveZeroValDataPoints()

bool pappso::MzIntegrationParams::isRemoveZeroValDataPoints | ( |  | ) | const

Definition at line 243 of file mzintegrationparams.cpp.

{
return m_removeZeroValDataPoints;
}

References m_removeZeroValDataPoints.

## isValid()

bool pappso::MzIntegrationParams::isValid | ( |  | ) | const

Definition at line 281 of file mzintegrationparams.cpp.

{
int errors = 0;
if(m_binningType != BinningType::NONE)
{
// qDebug() << "m_smallestMz:" << m_smallestMz;
// qDebug() << "smallest is max:" << (m_smallestMz ==
// std::numeric_limits<double>::max());
errors += (m_smallestMz == std::numeric_limits<double>::max() ? 1 : 0);
// qDebug() << "m_greatestMz:" << m_greatestMz;
// qDebug() << "greatest is min:" << (m_greatestMz ==
// std::numeric_limits<double>::min());
errors += (m_greatestMz == std::numeric_limits<double>::min() ? 1 : 0);
// if(mp_precision != nullptr)
// qDebug() << mp_precision->toString();
errors += (mp_precision == nullptr ? 1 : 0);
}
if(errors)
{
qDebug()
<< "The m/z integration parameters are not valid or do not apply...";
}
return !errors;
}

References m_binningType, m_greatestMz, m_smallestMz, mp_precision, and pappso::NONE.

## operator=()

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

Definition at line 116 of file mzintegrationparams.cpp.

{
if(this == &other)
return *this;
m_smallestMz = other.m_smallestMz;
m_greatestMz = other.m_greatestMz;
m_binningType = other.m_binningType;
m_decimalPlaces = other.m_decimalPlaces;
mp_precision = other.mp_precision;
if(mp_precision == nullptr)
mp_precision = pappso::PrecisionFactory::getPpmInstance(20);
m_applyMzShift = other.m_applyMzShift;
m_mzShift = other.m_mzShift;
m_removeZeroValDataPoints = other.m_removeZeroValDataPoints;
return *this;
}

References pappso::PrecisionFactory::getPpmInstance(), m_applyMzShift, m_binningType, m_decimalPlaces, m_greatestMz, m_mzShift, m_removeZeroValDataPoints, m_smallestMz, and mp_precision.

## reset()

void pappso::MzIntegrationParams::reset | ( |  | ) |

Reset the instance to default values.

Definition at line 265 of file mzintegrationparams.cpp.

{
m_smallestMz = std::numeric_limits<double>::min();
m_greatestMz = std::numeric_limits<double>::min();
m_binningType = BinningType::NONE;
// Special case for this member datum
mp_precision = pappso::PrecisionFactory::getPpmInstance(20);
m_applyMzShift = false;
m_mzShift = 0;
m_removeZeroValDataPoints = false;
}

References pappso::PrecisionFactory::getPpmInstance(), m_applyMzShift, m_binningType, m_greatestMz, m_mzShift, m_removeZeroValDataPoints, m_smallestMz, mp_precision, and pappso::NONE.

## setApplyMzShift()

void pappso::MzIntegrationParams::setApplyMzShift | ( | bool | applyMzShift | ) |

Definition at line 222 of file mzintegrationparams.cpp.

{
m_applyMzShift = applyMzShift;
}

References m_applyMzShift.

## setBinningType()

void pappso::MzIntegrationParams::setBinningType | ( | BinningType | binningType | ) |

Definition at line 181 of file mzintegrationparams.cpp.

{
m_binningType = binningType;
}

References m_binningType.

## setDecimalPlaces()

void pappso::MzIntegrationParams::setDecimalPlaces | ( | int | decimal_places | ) |

Definition at line 193 of file mzintegrationparams.cpp.

{
m_decimalPlaces = decimal_places;
}

References m_decimalPlaces.

## setGreatestMz()

void pappso::MzIntegrationParams::setGreatestMz | ( | pappso::pappso_double | value | ) |

Definition at line 161 of file mzintegrationparams.cpp.

{
m_greatestMz = value;
}

References m_greatestMz.

## setMzShift()

void pappso::MzIntegrationParams::setMzShift | ( | double | value | ) |

Definition at line 250 of file mzintegrationparams.cpp.

{
m_mzShift = value;
}

References m_mzShift.

## setPrecision()

void pappso::MzIntegrationParams::setPrecision | ( | pappso::PrecisionPtr | precisionPtr | ) |

Definition at line 206 of file mzintegrationparams.cpp.

{
mp_precision = precisionPtr;
if(mp_precision == nullptr)
mp_precision = pappso::PrecisionFactory::getDaltonInstance(0.05);
}
pappso::PrecisionFactory::getDaltonInstance
static PrecisionPtr getDaltonInstance(pappso_double value)
get a Dalton precision pointer
Definition: precision.cpp:129

References pappso::PrecisionFactory::getDaltonInstance(), and mp_precision.

## setRemoveZeroValDataPoints()

void pappso::MzIntegrationParams::setRemoveZeroValDataPoints | ( | bool | removeOrNot = `true` | ) |

Definition at line 236 of file mzintegrationparams.cpp.

{
m_removeZeroValDataPoints = removeOrNot;
}

References m_removeZeroValDataPoints.

## setSmallestMz()

void pappso::MzIntegrationParams::setSmallestMz | ( | pappso::pappso_double | value | ) |

Definition at line 140 of file mzintegrationparams.cpp.

{
m_smallestMz = value;
}

References m_smallestMz.

## toString()

QString pappso::MzIntegrationParams::toString | ( | int | offset = `0`,
|  | const QString & | spacer = `QString()`
| ) |  | const

Definition at line 653 of file mzintegrationparams.cpp.

{
QString lead;
for(int iter = 0; iter < offset; ++iter)
lead += spacer;
QString text = lead;
text += "m/z integration parameters:\n";
text += lead;
text += spacer;
if(m_smallestMz != std::numeric_limits<double>::max())
text.append(
QString::asprintf("Smallest (first) m/z: %.6f\n", m_smallestMz));
text += lead;
text += spacer;
if(m_greatestMz != std::numeric_limits<double>::min())
text.append(QString::asprintf("Greatest (last) m/z: %.6f\n", m_greatestMz));
text += lead;
text += spacer;
text.append(QString("Decimal places: %1\n").arg(m_decimalPlaces));
std::map<BinningType, QString>::iterator it;
it = binningTypeMap.find(m_binningType);
if(it == binningTypeMap.end())
qFatal("Programming error.");
text += lead;
text += spacer;
text.append(QString("Binning type: %1\n").arg(it->second.toLatin1().data()));
// Only provide the details relative to the ARBITRARY binning type.
if(m_binningType == BinningType::ARBITRARY)
{
text += lead;
text += spacer;
text += spacer;
text.append(QString("Bin nominal size: %1\n")
.arg(mp_precision->getNominal(), 0, 'f', 6));
text += lead;
text += spacer;
text += spacer;
text.append(QString("Bin size: %2\n")
.arg(mp_precision->toString().toLatin1().data()));
}
// Now other data that are independent of the bin settings.
text += lead;
text += spacer;
text +=
QString("Apply m/z shift: %1\n").arg(m_applyMzShift ? "true" : "false");
if(m_applyMzShift)
{
text += lead;
text += spacer;
text += spacer;
text += QString("m/z shift: %1").arg(m_mzShift, 0, 'f', 6);
}
text += lead;
text += spacer;
text += QString("Remove 0-val data points: %1\n")
.arg(m_removeZeroValDataPoints ? "true" : "false");
return text;
}
pappso::PrecisionBase::toString
virtual QString toString() const =0
pappso::PrecisionBase::getNominal
virtual pappso_double getNominal() const final
Definition: precision.cpp:64
pappso::binningTypeMap
std::map< BinningType, QString > binningTypeMap
Map relating the BinningType to a textual representation.
Definition: mzintegrationparams.cpp:60

References pappso::ARBITRARY, pappso::binningTypeMap, pappso::PrecisionBase::getNominal(), m_applyMzShift, m_binningType, m_decimalPlaces, m_greatestMz, m_mzShift, m_removeZeroValDataPoints, m_smallestMz, mp_precision, and pappso::PrecisionBase::toString().

## updateGreatestMz()

void pappso::MzIntegrationParams::updateGreatestMz | ( | pappso::pappso_double | value | ) |

Definition at line 168 of file mzintegrationparams.cpp.

{
m_greatestMz = m_greatestMz < value ? value : m_greatestMz;
}

References m_greatestMz.

## updateSmallestMz()

void pappso::MzIntegrationParams::updateSmallestMz | ( | pappso::pappso_double | value | ) |

Definition at line 147 of file mzintegrationparams.cpp.

{
m_smallestMz = m_smallestMz > value ? value : m_smallestMz;
}

References m_smallestMz.

## Member Data Documentation

## m_applyMzShift

bool pappso::MzIntegrationParams::m_applyMzShift = false

private

Definition at line 159 of file mzintegrationparams.h.

Referenced by isApplyMzShift(), operator=(), reset(), setApplyMzShift(), and toString().

## m_binningType

BinningType pappso::MzIntegrationParams::m_binningType = BinningType::NONE

private

Definition at line 151 of file mzintegrationparams.h.

Referenced by MzIntegrationParams(), createBins(), getBinningType(), isValid(), operator=(), reset(), setBinningType(), and toString().

## m_decimalPlaces

int pappso::MzIntegrationParams::m_decimalPlaces = -1

private

Definition at line 153 of file mzintegrationparams.h.

Referenced by createArbitraryBins(), createDataBasedBins(), getDecimalPlaces(), operator=(), setDecimalPlaces(), and toString().

## m_greatestMz

pappso::pappso_double pappso::MzIntegrationParams::m_greatestMz = std::numeric_limits<double>::min()

private

Definition at line 149 of file mzintegrationparams.h.

Referenced by createArbitraryBins(), getGreatestMz(), hasValidMzRange(), isValid(), operator=(), reset(), setGreatestMz(), toString(), and updateGreatestMz().

## m_mzShift

pappso::pappso_double pappso::MzIntegrationParams::m_mzShift = 0

private

Definition at line 160 of file mzintegrationparams.h.

Referenced by getMzShift(), operator=(), reset(), setMzShift(), and toString().

## m_removeZeroValDataPoints

bool pappso::MzIntegrationParams::m_removeZeroValDataPoints = true

private

Definition at line 161 of file mzintegrationparams.h.

Referenced by isRemoveZeroValDataPoints(), operator=(), reset(), setRemoveZeroValDataPoints(), and toString().

## m_smallestMz

pappso::pappso_double pappso::MzIntegrationParams::m_smallestMz = std::numeric_limits<double>::max()

private

Definition at line 145 of file mzintegrationparams.h.

Referenced by createArbitraryBins(), createDataBasedBins(), getSmallestMz(), hasValidMzRange(), isValid(), operator=(), reset(), setSmallestMz(), toString(), and updateSmallestMz().

## mp_precision

pappso::PrecisionPtr pappso::MzIntegrationParams::mp_precision

private

Initial value:
=
pappso::PrecisionFactory::getDaltonInstance(0.05)

Definition at line 157 of file mzintegrationparams.h.

Referenced by MzIntegrationParams(), createArbitraryBins(), getPrecision(), isValid(), operator=(), reset(), setPrecision(), and toString().

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

- pappsomspp/processing/combiners/mzintegrationparams.h
- pappsomspp/processing/combiners/mzintegrationparams.cpp