libXpertMass Developer Documentation
  • libXpertMass
  • MassPeakShaper
  • MassPeakShaper Class

    class MsXpS::libXpertMass::MassPeakShaper

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

    Header: #include <MassPeakShaper.hpp>

    Public Functions

    MassPeakShaper()
    MassPeakShaper(double mz, double intensity, const MassPeakShaperConfig &config)
    MassPeakShaper(const pappso::DataPoint &data_point, const MassPeakShaperConfig &config)
    MassPeakShaper(const MassPeakShaper &other)
    virtual ~MassPeakShaper()
    int computeGaussianPeakShape()
    int computeLorentzianPeakShape()
    int computePeakShape()
    const 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 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 MassPeakShaperConfig &config)
    pappso::Trace computeLorentzianPeakShape(double mz, double intensity, const MassPeakShaperConfig &config)
    pappso::Trace computePeakShape(double mz, double intensity, const MassPeakShaperConfig &config)

    Protected Variables

    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(double mz, double intensity, const MassPeakShaperConfig &config)

    Constructs a MassPeakShaper instance.

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

    Constructs a MassPeakShaper instance.

    MassPeakShaper::MassPeakShaper(const 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 MassPeakShaperConfig &config)

    Computes the Gaussian peak shape of the peak centroid.

    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 MassPeakShaperConfig &config)

    Computes the Lorentzian peak shape of the peak centroid.

    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 MassPeakShaperConfig &config)

    Computes the peak shape of the peak centroid.

    Returns the pappso::Trace describing the peak shape.

    const 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 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

    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.