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

- libXpertMassCore
- Averagine

# MsXpS::libXpertMassCore::Averagine Class

class MsXpS::libXpertMassCore::Averagine

The Averagine class provides features to use the Averagine concept. More...

Header: | `#include <MsXpS/libXpertMassCore/Averagine.hpp>`
Inherits: | QObject

- List of all members, including inherited members

## Properties

- formula : Formula
- isotopicData : IsotopicDataCstSPtr

## Public Functions

| Averagine(QObject *parent = nullptr)
| Averagine(MsXpS::libXpertMassCore::IsotopicDataCstSPtr isotopic_data_csp, QObject *parent = nullptr)
| Averagine(const MsXpS::libXpertMassCore::Formula &formula, QObject *parent = nullptr)
| Averagine(const MsXpS::libXpertMassCore::Formula &formula, MsXpS::libXpertMassCore::IsotopicDataCstSPtr isotopic_data_csp, QObject *parent = nullptr)
| Averagine(const MsXpS::libXpertMassCore::Averagine &other, QObject *parent = nullptr)
virtual | ~Averagine()
MsXpS::libXpertMassCore::Averagine * | clone(QObject *parent = nullptr)
const MsXpS::libXpertMassCore::Formula & | getFormula() const
const MsXpS::libXpertMassCore::IsotopicDataCstSPtr | getIsotopicData() const
MsXpS::libXpertMassCore::Averagine & | initialize(const MsXpS::libXpertMassCore::Averagine &other)
bool | isValid() const
void | setFormula(const MsXpS::libXpertMassCore::Formula &formula)
void | setFormula(const QString &formula)
void | setIsotopicData(const MsXpS::libXpertMassCore::IsotopicDataCstSPtr isotopic_data_csp)
QString | toString() const
bool | validate(MsXpS::libXpertMassCore::ErrorList *error_list_p)
bool | operator!=(const MsXpS::libXpertMassCore::Averagine &other) const
bool | operator==(const MsXpS::libXpertMassCore::Averagine &other) const

## Signals

void | formulaChanged()
void | isotopicDataChanged()

## Static Public Members

MsXpS::libXpertMassCore::Averagine * | clone(const MsXpS::libXpertMassCore::Averagine &other, QObject *parent = nullptr)

## Protected Variables

MsXpS::libXpertMassCore::Formula | m_formula
MsXpS::libXpertMassCore::IsotopicDataCstSPtr | mcsp_isotopicData

## Detailed Description

## Property Documentation

### formula : Formula

Formula of the Averagine. Note that the formula holds decimal element symbol count indices.

Access functions:

const MsXpS::libXpertMassCore::Formula & | getFormula() const | [see note below]
void | setFormula(const QString &formula) | [see note below]
void | setFormula(const MsXpS::libXpertMassCore::Formula &formula) | [see note below]

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

Notifier signal:

void | formulaChanged()

### isotopicData : IsotopicDataCstSPtr

This property holds the isotopic data to be used for the computations.

Access functions:

const MsXpS::libXpertMassCore::IsotopicDataCstSPtr | getIsotopicData() const | [see note below]
void | setIsotopicData(const MsXpS::libXpertMassCore::IsotopicDataCstSPtr isotopic_data_csp) | [see note below]

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

Notifier signal:

void | isotopicDataChanged()

## Member Function Documentation

### `[explicit invokable]` Averagine::Averagine(QObject *parent = nullptr)

Constructs an empty Averagine instance.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[explicit invokable]` Averagine::Averagine(MsXpS::libXpertMassCore::IsotopicDataCstSPtr isotopic_data_csp, QObject *parent = nullptr)

Construct a Averagine instance setting the isotopic data to isotopic_data_csp.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[explicit invokable]` Averagine::Averagine(const MsXpS::libXpertMassCore::Formula &formula, QObject *parent = nullptr)

Construct a Averagine instance setting the formula to formula.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[explicit invokable]` Averagine::Averagine(const MsXpS::libXpertMassCore::Formula &formula, MsXpS::libXpertMassCore::IsotopicDataCstSPtr isotopic_data_csp, QObject *parent = nullptr)

Construct a Averagine instance setting the formula to formula and the isotopic data to isotopic_data_csp.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[explicit invokable]` Averagine::Averagine(const MsXpS::libXpertMassCore::Averagine &other, QObject *parent = nullptr)

Construct a Averagine instance as a copy of other.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

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

Destructs this Averagine object.

Clear the member coordinateList.

### `[invokable]` MsXpS::libXpertMassCore::Averagine *Averagine::clone(QObject *parent = nullptr)

Returns a newly allocated Averagine instance with parent set to parent.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[static invokable]` MsXpS::libXpertMassCore::Averagine *Averagine::clone(const MsXpS::libXpertMassCore::Averagine &other, QObject *parent = nullptr)

b*rief Returns a newly allocated Averagine instance initialized using other and with parent set to parent.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[invokable]` MsXpS::libXpertMassCore::Averagine &Averagine::initialize(const MsXpS::libXpertMassCore::Averagine &other)

Returns a reference to this Averagine after having initialized it using other.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[invokable]` bool Averagine::isValid() const

Returns true if this Averagine instance is valid, false otherwise.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[invokable]` void Averagine::setFormula(const MsXpS::libXpertMassCore::Formula &formula)

Sets the member Formula to to formula.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

Note: Setter function for property formula.

### `[invokable]` void Averagine::setFormula(const QString &formula)

Sets the member Formula to to formula.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

Note: Setter function for property formula.

### `[invokable]` QString Averagine::toString() const

Returns a string describing this Averagine instance.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[invokable]` bool Averagine::validate(MsXpS::libXpertMassCore::ErrorList *error_list_p)

Returns true if this Averagine instance could validate successfully, false otherwise.

Validation steps include checking that the isotopic data are correctly set, that the formula can validate against them and that the masses (mono and avg) of the averagine can be computed.

The errors, if any, are appended to error_list_p, that cannot be nullptr.

m_isValid is set to the result of the validation and is returned.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[invokable]` bool Averagine::operator!=(const MsXpS::libXpertMassCore::Averagine &other) const

Returns true if this Averagine instance is different than other, false otherwise.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[invokable]` bool Averagine::operator==(const MsXpS::libXpertMassCore::Averagine &other) const

Returns true if this instance is identical to other, false otherwise.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

## Member Variable Documentation

### MsXpS::libXpertMassCore::Formula Averagine::m_formula

Formula of the Averagine. Note that the formula holds decimal element symbol count indices.

### MsXpS::libXpertMassCore::IsotopicDataCstSPtr Averagine::mcsp_isotopicData

This variable holds the isotopic data to be used for the computations.