| <large>libXpertMassCore and libXpertMassGui Developer Documentation</large>

- libXpertMassCore
- IsotopicClusterShaper

# MsXpS::libXpertMassCore::IsotopicClusterShaper Class

class MsXpS::libXpertMassCore::IsotopicClusterShaper

The IsotopicClusterShaper class provides the features needed to shape sets of (peak centroid m/z, intensity) pairs associated to a given charge into a mass spectral pappso;:Trace. More...

Header: | `#include <IsotopicClusterShaper.hpp>`

- List of all members, including inherited members
- IsotopicClusterShaper is part of libXpertMassCore Mass calculations.

## Public Functions

| IsotopicClusterShaper(const std::vector<MsXpS::libXpertMassCore::IsotopicClusterChargePair> &isotopic_cluster_charge_pairs, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)
| IsotopicClusterShaper(const pappso::Trace &isotopic_cluster, int charge, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)
virtual | ~IsotopicClusterShaper()
void | appendIsotopicCluster(const pappso::Trace &isotopic_cluster, int charge)
void | appendIsotopicClusterChargePairs(const std::vector<MsXpS::libXpertMassCore::IsotopicClusterChargePair> &isotopic_cluster_charge_pairs)
const MsXpS::libXpertMassCore::MassPeakShaperConfig * | getConfig() const
int | getNormalizeIntensity() const
pappso::Trace & | run(bool reset = true)
void | setConfig(const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)
void | setIsotopicCluster(MsXpS::libXpertMassCore::IsotopicClusterChargePair isotopic_cluster_charge_pair)
void | setIsotopicCluster(const pappso::Trace &isotopic_cluster, int charge)
void | setIsotopicCluster(pappso::TraceCstSPtr isotopic_cluster_sp, int charge)
void | setIsotopicClusterChargePairs(const std::vector<MsXpS::libXpertMassCore::IsotopicClusterChargePair> &isotopic_cluster_charge_pairs)
void | setNormalizeIntensity(int max_intensity)
QString | shapeToString()

## Protected Functions

void | setIsotopicCluster(MsXpS::libXpertMassCore::IsotopicClusterChargePair isotopic_cluster_charge_pair, bool reset)
void | setIsotopicCluster(const pappso::Trace &isotopic_cluster, int charge, bool reset)
void | setIsotopicCluster(pappso::TraceCstSPtr isotopic_cluster_sp, int charge, bool reset)
void | setIsotopicClusterChargePairs(const std::vector<MsXpS::libXpertMassCore::IsotopicClusterChargePair> &isotopic_cluster_charge_pairs, bool reset)

## Protected Variables

pappso::Trace | m_finalTrace
double | m_greatestMz
std::vector<MsXpS::libXpertMassCore::IsotopicClusterChargePair> | m_isotopicClusterChargePairs
pappso::MapTrace | m_mapTrace
double | m_mostIntensePeakMz
pappso::MzIntegrationParams | m_mzIntegrationParams
int | m_normalizeIntensity
double | m_smallestMz

## Detailed Description

Each set of (peak centroid m/z, intensity) pairs corresponds to an isotopic cluster that is associated to a charge.

The configuration of the peak shaping process is held in a specific MassPeakShaperConfig class.

The output of the computation is a pappso::Trace obtained by combining all the different shapes obtained for the different peak centroids of all the sets of (peak centroid m/z, intensity) pairs. If binning was requested, the obtained Trace is the result of a combination accounting for the required bin size, otherwise the obtained Trace is the result of the mere addition of all the points in the different traces.

See also MassPeakShaperConfig.

## Member Function Documentation

### IsotopicClusterShaper::IsotopicClusterShaper(const std::vector<MsXpS::libXpertMassCore::IsotopicClusterChargePair> &isotopic_cluster_charge_pairs, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)

Constructs a IsotopicClusterShaper instance.

- isotopic_cluster_charge_pairs: The pairs associating a pappso::Trace instance to its corresponding charge.
- config: The mass peak shaping process configuration.

In this constructor, a set of sets of (m/z, charge) peak centroids is passed as argument. The pappso::Trace instances in isotopic_cluster_charge_pairs might correspond to all the isotopic clusters representing a given analyte at different charges.

### IsotopicClusterShaper::IsotopicClusterShaper(const pappso::Trace &isotopic_cluster, int charge, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)

Constructs a IsotopicClusterShaper instance.

- isotopic_cluster: The peak centroids belonging to an isotopic cluster in the form of a pappso::Trace.
- charge: The charge of the analyte below the isotopic cluster peaks.
- config: The mass peak shaping process configuration.

Each pappso::DataPoint in the isotopic_cluster pappso::Trace corresponds to a (m/z, intensity) peak centroid belonging to the isotopic cluster.

### `[virtual noexcept]` IsotopicClusterShaper::~IsotopicClusterShaper()

Destructs this IsotopicClusterShaper instance.

### void IsotopicClusterShaper::appendIsotopicCluster(const pappso::Trace &isotopic_cluster, int charge)

Adds an isotopic cluster in the form of the isotopic_cluster pappso::Trace associated to the corresponding charge.

The member vector of IsotopicClusterChargePair instances is not cleared before the computations.

### void IsotopicClusterShaper::appendIsotopicClusterChargePairs(const std::vector<MsXpS::libXpertMassCore::IsotopicClusterChargePair> &isotopic_cluster_charge_pairs)

Adds isotopic clusters in the form of the isotopic_cluster_charge_pairs vector of IsotopicClusterChargePair instances.

The member vector of IsotopicClusterChargePair instances is not cleared before the computations.

### const MsXpS::libXpertMassCore::MassPeakShaperConfig *IsotopicClusterShaper::getConfig() const

Gets the peak shaping process configuration.

### int IsotopicClusterShaper::getNormalizeIntensity() const

Gets the intensity normalization value.

### pappso::Trace &IsotopicClusterShaper::run(bool reset = true)

Runs the mass peak shaping process for all the IsotopicClusterChargePair objects in m_isotopicClusterChargePairs.

If reset is true, the member m_mapTrace and m_finalTrace are cleared before starting the computations. The m_config member is first MassPeakShaperConfig::resolve()d to check that all the parameters have been properly set and are valid.

Returns the obtained pappso::Trace corresponding to the combination of all the individual traces obtained for the various isotopic clusters and their corresponding charge.

### void IsotopicClusterShaper::setConfig(const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)

Sets the peak shaping process configuration.

### void IsotopicClusterShaper::setIsotopicCluster(MsXpS::libXpertMassCore::IsotopicClusterChargePair isotopic_cluster_charge_pair)

Handles the isotopic_cluster_charge_pair input isotopic cluster as a IsotopicClusterChargePair.

The member vector of IsotopicClusterChargePair instances is cleared before the computations.

### `[protected]` void IsotopicClusterShaper::setIsotopicCluster(MsXpS::libXpertMassCore::IsotopicClusterChargePair isotopic_cluster_charge_pair, bool reset)

Handles the isotopic_cluster_charge_pair input isotopic cluster as a IsotopicClusterChargePair.

If reset is true, the member vector of IsotopicClusterChargePair instances is cleared before the computations.

### void IsotopicClusterShaper::setIsotopicCluster(const pappso::Trace &isotopic_cluster, int charge)

Handles the isotopic_cluster input isotopic cluster as a pappso::Trace.

isotopic_cluster is associated to a charge.

The member vector of IsotopicClusterChargePair instances is cleared before the computations.

### void IsotopicClusterShaper::setIsotopicCluster(pappso::TraceCstSPtr isotopic_cluster_sp, int charge)

Handles the isotopic_cluster_sp input isotopic cluster as a pappso::Trace.

isotopic_cluster_sp is associated to a charge.

The member vector of IsotopicClusterChargePair instances is cleared before the computations.

### `[protected]` void IsotopicClusterShaper::setIsotopicCluster(const pappso::Trace &isotopic_cluster, int charge, bool reset)

Handles the isotopic_cluster input isotopic cluster as a pappso::Trace.

isotopic_cluster is associated to a charge. If reset is true, the member vector of IsotopicClusterChargePair instances is cleared before the computations.

### `[protected]` void IsotopicClusterShaper::setIsotopicCluster(pappso::TraceCstSPtr isotopic_cluster_sp, int charge, bool reset)

Handles the isotopic_cluster_sp input isotopic cluster as a pappso::Trace.

isotopic_cluster_sp is associated to a charge. If reset is true, the member vector of IsotopicClusterChargePair instances is cleared before the computations.

This function is the workhorse for all the functions used to set the initial data for the computations. Its main task is to scrutinize the data in isotopic_cluster_sp and update the m_smallestMz, m_greatestMz and m_mostIntensePeakMz values based on the data passed as argument.

### void IsotopicClusterShaper::setIsotopicClusterChargePairs(const std::vector<MsXpS::libXpertMassCore::IsotopicClusterChargePair> &isotopic_cluster_charge_pairs)

Handles the isotopic_cluster_charge_pairs input isotopic cluster as a vector of IsotopicClusterChargePair instances.

The member vector of IsotopicClusterChargePair instances is cleared before the computations.

### `[protected]` void IsotopicClusterShaper::setIsotopicClusterChargePairs(const std::vector<MsXpS::libXpertMassCore::IsotopicClusterChargePair> &isotopic_cluster_charge_pairs, bool reset)

Handles the isotopic_cluster_charge_pairs input isotopic cluster as a vector of IsotopicClusterChargePair instances.

If reset is true, the member vector of IsotopicClusterChargePair instances is cleared before the computations.

### void IsotopicClusterShaper::setNormalizeIntensity(int max_intensity)

Sets the intensity normalization value to max_intensity.

### QString IsotopicClusterShaper::shapeToString()

Returns the final result of all the computations as a string.

## Member Variable Documentation

### pappso::Trace IsotopicClusterShaper::m_finalTrace

This variable holds the pappso::Trace holding the final results of the computations.

### double IsotopicClusterShaper::m_greatestMz

This variable holds the greatest m/z value encountered during the calculations.

This value is required for the crafting of the bins.

### std::vector<MsXpS::libXpertMassCore::IsotopicClusterChargePair> IsotopicClusterShaper::m_isotopicClusterChargePairs

Vector of pappso::Trace instances in pair with charges.

### pappso::MapTrace IsotopicClusterShaper::m_mapTrace

This variable holds the map relating a m/z value to its intensity.

This map is a variant of pappso::Trace that is designed to allow for easy mass spectrum combination. It is generally used only for computations and is converted to a pappso::Trace once all the computations have been carried out.

### double IsotopicClusterShaper::m_mostIntensePeakMz

This variable holds the most intense peak encountered during the calculations.

### pappso::MzIntegrationParams IsotopicClusterShaper::m_mzIntegrationParams

This variable holds the configuration of the mass spectral combinations (for example, determines the bins, if binning is required).

### int IsotopicClusterShaper::m_normalizeIntensity

This variable holds the value by which all the peak shapes need to be normalized.

### double IsotopicClusterShaper::m_smallestMz

This variable holds the smallest m/z value encountered during the calculations.

This value is required for the crafting of the bins.