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

- libXpertMassCore
- MassPeakShaper

# MsXpS::libXpertMassCore::MassPeakShaper Class

class MsXpS::libXpertMassCore::MassPeakShaper

The MassPeakShaper class provides the features needed to shape a mass peak. More...

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

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

## Public Functions

| MassPeakShaper()
| MassPeakShaper(const pappso::DataPoint &data_point, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)
| MassPeakShaper(double mz, double intensity, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)
| MassPeakShaper(const MsXpS::libXpertMassCore::MassPeakShaper &other)
virtual | ~MassPeakShaper()
int | computeGaussianPeakShape()
int | computeLorentzianPeakShape()
int | computePeakShape()
const MsXpS::libXpertMassCore::MassPeakShaperConfig & | getConfig() const
const pappso::DataPoint & | getPeakCentroid() const
const pappso::Trace & | getTrace() const
double | intensityAt(double mz, pappso::PrecisionPtr precision_p, bool &ok)
void | setConfig(const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)
void | setPeakCentroid(const pappso::DataPoint &peak_centroid_data)
bool | shapeToFile(const QString &file_name)
QString | shapetoString()

## Static Public Members

pappso::Trace | computeGaussianPeakShape(double mz, double intensity, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)
pappso::Trace | computeLorentzianPeakShape(double mz, double intensity, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)
pappso::Trace | computePeakShape(double mz, double intensity, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)

## Protected Variables

MsXpS::libXpertMassCore::MassPeakShaperConfig | m_config
pappso::DataPoint | m_peakCentroid
pappso::Trace | m_trace

## Detailed Description

Shaping a peak means creating a shape around a centroid m/z value such that the m/z peak is represented like it appears in a mass spectrum displayed in "profile" mode.

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

See also MassPeakShaperConfig.

## Member Function Documentation

### MassPeakShaper::MassPeakShaper()

Constructs a MassPeakShaper instance.

### MassPeakShaper::MassPeakShaper(const pappso::DataPoint &data_point, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)

Constructs a MassPeakShaper instance.

- data_point: The data point representing the peak centroid.
- config: The configuration driving the mass peak shaping process.

### MassPeakShaper::MassPeakShaper(double mz, double intensity, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)

Constructs a MassPeakShaper instance.

- mz: The peak centroid m/z value.
- intensity: The peak centroid intensity value.
- config: The configuration driving the mass peak shaping process.

### MassPeakShaper::MassPeakShaper(const MsXpS::libXpertMassCore::MassPeakShaper &other)

Constructs a MassPeakShaper instance as a copy of other.

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

Destructs this MassPeakShaper instance.

### int MassPeakShaper::computeGaussianPeakShape()

Computes the Gaussian peak shape of the peak centroid.

### `[static]` pappso::Trace MassPeakShaper::computeGaussianPeakShape(double mz, double intensity, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)

Computes the Gaussian peak shape of the peak centroid.

- mz: the peak centroid's m/z value.
- intensity: the peak centroid's intensity value.
- config: the configuration driving the peak shaping process.

Returns the pappso::Trace describing the peak shape.

### int MassPeakShaper::computeLorentzianPeakShape()

Computes the Lorentzian peak shape of the peak centroid.

### `[static]` pappso::Trace MassPeakShaper::computeLorentzianPeakShape(double mz, double intensity, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)

Computes the Lorentzian peak shape of the peak centroid.

- mz: the peak centroid's m/z value.
- intensity: the peak centroid's intensity value.
- config: the configuration driving the peak shaping process.

Returns the pappso::Trace describing the peak shape.

### int MassPeakShaper::computePeakShape()

Computes the peak shape of the peak centroid.

Returns the count of points in the peak shape.

### `[static]` pappso::Trace MassPeakShaper::computePeakShape(double mz, double intensity, const MsXpS::libXpertMassCore::MassPeakShaperConfig &config)

Computes the peak shape of the peak centroid.

- mz: the peak centroid's m/z value.
- intensity: the peak centroid's intensity value.
- config: the configuration driving the peak shaping process.

Returns the pappso::Trace describing the peak shape.

### const MsXpS::libXpertMassCore::MassPeakShaperConfig &MassPeakShaper::getConfig() const

Returns the configuration driving the peak shaping process.

### const pappso::DataPoint &MassPeakShaper::getPeakCentroid() const

Returns the peak centroid data.

### const pappso::Trace &MassPeakShaper::getTrace() const

Returns the peak shape as a pappso::Trace.

### double MassPeakShaper::intensityAt(double mz, pappso::PrecisionPtr precision_p, bool &ok)

Returns the intensity of a data point in the member peak shape pappso::Trace (m_trace).

If the member pappso::Trace contains a data point having its x value equal to mz (comparison performed using tolerance precision_p), then return the intensity (y member) of that data point and set ok to true. Otherwise, return 0 and set ok to false.

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

Sets the configuration driving the peak shaping process to config.

### void MassPeakShaper::setPeakCentroid(const pappso::DataPoint &peak_centroid_data)

Sets the peak_centroid_data.

### bool MassPeakShaper::shapeToFile(const QString &file_name)

Writes to file_name a string containing the member pappso::Trace data.

Returns true if successful, false otherwise.

See also shapetoString().

### QString MassPeakShaper::shapetoString()

Returns a string with the data in the member pappso::Trace.

## Member Variable Documentation

### MsXpS::libXpertMassCore::MassPeakShaperConfig MassPeakShaper::m_config

This variable holds the configuration needed to drive the mass peak shaping process.

### pappso::DataPoint MassPeakShaper::m_peakCentroid

This variable holds the peak centroid for which a shape is computed.

A peak centroid is the center of a mass peak profile and is thus the (m/z, intensity) pair.

### pappso::Trace MassPeakShaper::m_trace

This variable holds the Trace object that will receive the different points that make the peak shape.