libXpertMassCore and libXpertMassGui Developer Documentation
  • libXpertMassCore
  • Oligomer
  • Oligomer Class

    class MsXpS::libXpertMassCore::Oligomer

    The Oligomer class provides abstractions to work with an oligomer molecule (peptide or oligonucleotide, for example). More...

    Header: #include <Oligomer.hpp>
    Inherits: MsXpS::libXpertMassCore::PropListHolder

    Public Functions

    Oligomer(MsXpS::libXpertMassCore::PolymerCstQSPtr polymer_cqsp, const QString &name = QString(), const QString &description = QString(), bool is_modified = false, const MsXpS::libXpertMassCore::Ionizer &ionizer = Ionizer(), const MsXpS::libXpertMassCore::CalcOptions &calc_options = CalcOptions())
    Oligomer(const MsXpS::libXpertMassCore::Oligomer &other)
    virtual ~Oligomer()
    bool addCrossLink(MsXpS::libXpertMassCore::CrossLinkSPtr cross_link_sp)
    virtual bool calculateMasses()
    virtual bool calculateMasses(const MsXpS::libXpertMassCore::CalcOptions &calc_options, const MsXpS::libXpertMassCore::Ionizer &ionizer)
    MsXpS::libXpertMassCore::Enums::IonizationOutcome deionize()
    virtual QString elementalComposition() const
    virtual QString elementalComposition(const MsXpS::libXpertMassCore::CalcOptions &calc_options, const MsXpS::libXpertMassCore::Ionizer &ionizer) const
    bool encompasses(MsXpS::libXpertMassCore::MonomerCstRPtr monomer_crp) const
    bool encompasses(MsXpS::libXpertMassCore::MonomerSPtr monomer_sp) const
    bool encompasses(std::size_t index) const
    const MsXpS::libXpertMassCore::CalcOptions &getCalcOptionsCstRef() const
    MsXpS::libXpertMassCore::CalcOptions &getCalcOptionsRef()
    const std::vector<MsXpS::libXpertMassCore::CrossLinkSPtr> &getCrossLinksCstRef() const
    std::vector<MsXpS::libXpertMassCore::CrossLinkSPtr> &getCrossLinksRef()
    QString getDescription() const
    const MsXpS::libXpertMassCore::Formula &getFormulaCstRef() const
    MsXpS::libXpertMassCore::Formula &getFormulaRef()
    const MsXpS::libXpertMassCore::IndexRangeCollection &getIndexRangeCollectionCstRef() const
    MsXpS::libXpertMassCore::IndexRangeCollection &getIndexRangeCollectionRef()
    const MsXpS::libXpertMassCore::Ionizer &getIonizerCstRef() const
    MsXpS::libXpertMassCore::Ionizer &getIonizerRef()
    MsXpS::libXpertMassCore::MonomerSPtr getLeftEndMonomerCstSPtr() const
    double getMass(MsXpS::libXpertMassCore::Enums::MassType mass_type) const
    double &getMassRef(MsXpS::libXpertMassCore::Enums::MassType mass_type)
    MsXpS::libXpertMassCore::MonomerSPtr getMonomerCstSPtrAt(std::size_t index) const
    QString getName() const
    std::size_t getPartialCleavage() const
    const MsXpS::libXpertMassCore::PolymerCstQSPtr &getPolymerCstSPtr() const
    MsXpS::libXpertMassCore::MonomerSPtr getRightEndMonomerCstSPtr() const
    MsXpS::libXpertMassCore::Enums::IonizationOutcome ionize()
    bool isModified(bool deep = false) const
    std::size_t modifiedMonomerCount() const
    MsXpS::libXpertMassCore::Enums::IonizationOutcome molecularMasses(double &mono, double &avg) const
    void setCalcOptions(const MsXpS::libXpertMassCore::CalcOptions &calc_options)
    void setDescription(const QString &description)
    void setFormula(const MsXpS::libXpertMassCore::Formula &formula)
    void setFormula(const QString &formula_string)
    void setIndexRange(const MsXpS::libXpertMassCore::IndexRange &index_range)
    void setIndexRanges(const MsXpS::libXpertMassCore::IndexRangeCollection &index_ranges)
    void setIonizer(const MsXpS::libXpertMassCore::Ionizer &ionizer)
    void setMass(MsXpS::libXpertMassCore::Enums::MassType mass_type, double mass)
    void setMasses(double mono, double avg)
    void setModified(bool is_modified = true)
    void setName(const QString &name)
    void setPartialCleavage(std::size_t partial_cleavage)
    void setPolymerCstSPtr(MsXpS::libXpertMassCore::PolymerCstQSPtr polymer_cqsp)
    void setStartAndStopIndices(std::size_t start_index, std::size_t stop_index)
    void setStartIndex(int start_index)
    void setStopIndex(int stop_index)
    std::size_t size()
    qsizetype startIndex(bool &ok) const
    qsizetype stopIndex(bool &ok) const
    QString toString() const
    MsXpS::libXpertMassCore::Oligomer &operator=(const MsXpS::libXpertMassCore::Oligomer &other)

    Protected Variables

    double m_avg
    MsXpS::libXpertMassCore::CalcOptions m_calcOptions
    std::vector<MsXpS::libXpertMassCore::CrossLinkSPtr> m_crossLinks
    QString m_description
    MsXpS::libXpertMassCore::Formula m_formula
    MsXpS::libXpertMassCore::Ionizer m_ionizer
    bool m_isModified
    double m_mono
    QString m_name
    std::size_t m_partialCleavage
    MsXpS::libXpertMassCore::PolymerCstQSPtr mcsp_polymer

    Detailed Description

    The notion of an Oligomer is that it is part of a Polymer and is thus defined by a range of Monomer indices in this Polymer (the IndexRangeCollection).

    The start index cannot be less than 0 nor greater than the size of the polymer minus one, and the end index follows the same rule.

    An Oligomer is also characterized by a monoisotopic mass and an average mass.

    The ionization of the Oligomer is handled by the member Ionizer instance.

    All computations about an oligomer (fragmentation, composition, for example, isoelectric point, ...) can only be performed by referring to the sequence of its "enclosing" Polymer.

    Member Function Documentation

    Oligomer::Oligomer(MsXpS::libXpertMassCore::PolymerCstQSPtr polymer_cqsp, const QString &name = QString(), const QString &description = QString(), bool is_modified = false, const MsXpS::libXpertMassCore::Ionizer &ionizer = Ionizer(), const MsXpS::libXpertMassCore::CalcOptions &calc_options = CalcOptions())

    Constructs an Oligomer.

    The Oligomer instance is constructed with these arguments:

    Oligomer::Oligomer(const MsXpS::libXpertMassCore::Oligomer &other)

    Constructs the Oligomer as a copy of other.

    [virtual noexcept] Oligomer::~Oligomer()

    Destructs this Oligomer.

    Adds the cross_link_sp CrossLink to this Oligomer's container of CrossLink instances.

    Returns true if the CrossLink was added succesfully, or false cross_link_sp was already in the container.

    [virtual] bool Oligomer::calculateMasses()

    Calculates the monoisotopic and average masses.

    The calculation is performed by computing the mono and avg masses of the sequence stretch as described by the set of start and top indices (member IndexRangeCollection object) in the polymer sequence.

    The member CalcOptions (m_calcOptions) and the member Ionizer (m_ionizer) are used.

    The m_mono and m_avg member objects are reset to 0.0 before the calculations.

    Returns true if calculations were successful, false otherwise.

    [virtual] bool Oligomer::calculateMasses(const MsXpS::libXpertMassCore::CalcOptions &calc_options, const MsXpS::libXpertMassCore::Ionizer &ionizer)

    Calculates the monoisotopic and average masses.

    The calculation is performed by computing the mono and avg masses of the sequence stretch as described by the start and end indices in the polymer sequence. The calculations are configured by calc_options and the ionization is defined in ionizer.

    The m_mono and m_avg member objects are reset to 0.0 before the calculations.

    The member Ionizer is not set to ionizer. This is so that a whole set of ionization computations can be performed without touching the internal Ionizer.

    Returns true if calculations were successful, false otherwise.

    MsXpS::libXpertMassCore::Enums::IonizationOutcome Oligomer::deionize()

    Returns the result of the deionization process.

    The new masses, if a change occurred, are updated in the member m_mono and m_avg variables.

    [virtual] QString Oligomer::elementalComposition() const

    Returns the elemental composition of this Oligomer instance.

    [virtual] QString Oligomer::elementalComposition(const MsXpS::libXpertMassCore::CalcOptions &calc_options, const MsXpS::libXpertMassCore::Ionizer &ionizer) const

    Returns the elemental composition of this Oligomer instance.

    The computation of the elemental composition is performed as configured in calc_options and using the ionization described in ionizer.

    bool Oligomer::encompasses(MsXpS::libXpertMassCore::MonomerCstRPtr monomer_crp) const

    Returns true if this Oligomer spans at least one region of the enclosing Polymer that contains the Monomer monomer_crp, false otherwise.

    The search is performed by comparing pointers, thus the Monomer to be search is monomer_crp.

    bool Oligomer::encompasses(MsXpS::libXpertMassCore::MonomerSPtr monomer_sp) const

    Returns true if this Oligomer spans at least one region of the enclosing Polymer that contains the Monomer monomer_sp, false otherwise.

    The search is performed by comparing pointers, thus the Monomer to be search is monomer_sp.

    bool Oligomer::encompasses(std::size_t index) const

    Returns true if this Oligomer spans at least one region of the enclosing polymer that contains a Monomer at index, false otherwise.

    const MsXpS::libXpertMassCore::CalcOptions &Oligomer::getCalcOptionsCstRef() const

    Returns the CalcOptions member.

    MsXpS::libXpertMassCore::CalcOptions &Oligomer::getCalcOptionsRef()

    Returns a reference to the CalcOptions member.

    const std::vector<MsXpS::libXpertMassCore::CrossLinkSPtr> &Oligomer::getCrossLinksCstRef() const

    Returns a const reference to the CrossLink container.

    std::vector<MsXpS::libXpertMassCore::CrossLinkSPtr> &Oligomer::getCrossLinksRef()

    Returns a reference to the CrossLink container.

    QString Oligomer::getDescription() const

    Returns the description.

    const MsXpS::libXpertMassCore::Formula &Oligomer::getFormulaCstRef() const

    Returns a constant reference to the formula.

    MsXpS::libXpertMassCore::Formula &Oligomer::getFormulaRef()

    Returns a reference to the formula.

    const MsXpS::libXpertMassCore::IndexRangeCollection &Oligomer::getIndexRangeCollectionCstRef() const

    Returns a const reference to the IndexRangeCollection.

    MsXpS::libXpertMassCore::IndexRangeCollection &Oligomer::getIndexRangeCollectionRef()

    Returns a reference to the IndexRangeCollection.

    const MsXpS::libXpertMassCore::Ionizer &Oligomer::getIonizerCstRef() const

    Returns a const reference to the Ionizer.

    MsXpS::libXpertMassCore::Ionizer &Oligomer::getIonizerRef()

    Returns a reference to the Ionizer.

    MsXpS::libXpertMassCore::MonomerSPtr Oligomer::getLeftEndMonomerCstSPtr() const

    Returns the Monomer in the member Polymer that is located at the index that has the start value of the first IndexRange object in the member IndexRangeCollection container.

    If the Polymer is not avaialable, or if the start index could not be obtained, nullptr is returned.

    If the index is out of bounds, that is a fatal error.

    double Oligomer::getMass(MsXpS::libXpertMassCore::Enums::MassType mass_type) const

    Returns the Oligomer's mass of the type defined by mass_type.

    double &Oligomer::getMassRef(MsXpS::libXpertMassCore::Enums::MassType mass_type)

    Returns a reference to the Oligomer's mass of the type defined by mass_type.

    MsXpS::libXpertMassCore::MonomerSPtr Oligomer::getMonomerCstSPtrAt(std::size_t index) const

    Returns the Monomer in the member Polymer that is located at the index.

    If the Polymer is not available, nullptr is returned. If index is not encompassed by the member IndexRangeCollection container, or if that container is empty, nullptr is returned.

    If index is out of bounds, that is a fatal error.

    QString Oligomer::getName() const

    Returns the name.

    std::size_t Oligomer::getPartialCleavage() const

    Returns the m_partialCleavage member.

    const MsXpS::libXpertMassCore::PolymerCstQSPtr &Oligomer::getPolymerCstSPtr() const

    Returns the polymer.

    See also getPolymerCstSPtr().

    MsXpS::libXpertMassCore::MonomerSPtr Oligomer::getRightEndMonomerCstSPtr() const

    Returns the Monomer in the member Polymer that is located at the index that has the stop value of the first IndexRange object in the member IndexRangeCollection container.

    If the Polymer is not avaialable, or if the stop index could not be obtained, nullptr is returned.

    If the index is out of bounds, that is a fatal error.

    MsXpS::libXpertMassCore::Enums::IonizationOutcome Oligomer::ionize()

    Returns the result of the ionization process.

    The new masses, if a change occurred, are updated in the member m_mono and m_avg variables.

    bool Oligomer::isModified(bool deep = false) const

    Returns the chemical modification status of this Oligomer.

    If deep is true, the member Polymer must exist (mcsp_polymer cannot be nullptr) because the polymer itself is asked for the count of Monomer instances being modified. The sequence ranges of the polymer that are surveyed are those in this Oligomer's IndexRangeCollection. Upon checking the result, if the count of modified Monomer instances is not 0, then m_isModified is set to true, otherwise it is set to false. That m_isModified value is then returned.

    If deep is false, the value of m_isModified is immediately returned.

    See also Polymer::hasModifiedMonomer and Monomer::isModified().

    std::size_t Oligomer::modifiedMonomerCount() const

    Return the count of the Polymer's Sequence's Monomer instances that are modified.

    See also Polymer::modifiedMonomerCount.

    MsXpS::libXpertMassCore::Enums::IonizationOutcome Oligomer::molecularMasses(double &mono, double &avg) const

    Sets mono and avg to the masses of unionized analyte.

    The member Ionizer is used to first deionize the mono and avg masses (on copy data, if the Ionizer reports that the analyte is ionized).

    mono and avg are then set to the masses of this polymer instance in an unionized status.

    Nothing is modified in this Oligomer instance.

    Returns the process outcome.

    void Oligomer::setCalcOptions(const MsXpS::libXpertMassCore::CalcOptions &calc_options)

    Sets calc_options to the member datum.

    void Oligomer::setDescription(const QString &description)

    Sets the description.

    void Oligomer::setFormula(const MsXpS::libXpertMassCore::Formula &formula)

    Sets the formula to formula.

    void Oligomer::setFormula(const QString &formula_string)

    Sets the formula to formula_string.

    void Oligomer::setIndexRange(const MsXpS::libXpertMassCore::IndexRange &index_range)

    Sets index_range to the member datum as the sole range in the member IndexRange container.

    void Oligomer::setIndexRanges(const MsXpS::libXpertMassCore::IndexRangeCollection &index_ranges)

    Sets index_ranges to the member datum.

    void Oligomer::setIonizer(const MsXpS::libXpertMassCore::Ionizer &ionizer)

    Sets ionizer to the member datum.

    void Oligomer::setMass(MsXpS::libXpertMassCore::Enums::MassType mass_type, double mass)

    Set the mass qualified using mass_type to the mass value.

    See also setMasses().

    void Oligomer::setMasses(double mono, double avg)

    Sets mono and avg masses to this Oligomer.

    See also setMass().

    void Oligomer::setModified(bool is_modified = true)

    Sets the modification status to is_modified.

    See also isModified().

    void Oligomer::setName(const QString &name)

    Sets the name.

    void Oligomer::setPartialCleavage(std::size_t partial_cleavage)

    Set the member m_partialCleavage to partial_cleavage.

    void Oligomer::setPolymerCstSPtr(MsXpS::libXpertMassCore::PolymerCstQSPtr polymer_cqsp)

    Set the PolChemDef mcsp_polymer member to polymer_cqsp.

    See also getPolymerCstSPtr().

    void Oligomer::setStartAndStopIndices(std::size_t start_index, std::size_t stop_index)

    Sets the start_index and stop_index indices to the first IndexRange instance of the member IndexRangeCollection container.

    void Oligomer::setStartIndex(int start_index)

    Sets start_index as the the first IndexRange instance'start value of the member IndexRangeCollection container.

    See also startIndex().

    void Oligomer::setStopIndex(int stop_index)

    Sets stop_index as the the first IndexRange instance'stop value of the member IndexRangeCollection container.

    See also stopIndex().

    std::size_t Oligomer::size()

    Returns the size of this Oligomer.

    The size is computed by adding the length of all the regions of the enclosing Polymer as documented in the Coordinates instances in the member coordinateList.

    qsizetype Oligomer::startIndex(bool &ok) const

    Returns the start index, or 0 (ok is set to false) if the IndexRangeCollection member is empty.

    The returned start index is that of the first IndexRange instance in the IndexRangeCollection member (ok is set to true).

    See also setStartIndex().

    qsizetype Oligomer::stopIndex(bool &ok) const

    Returns the stop index, or 0 (ok is set to false) if the IndexRangeCollection member is empty.

    The returned stop index is that of the first IndexRange instance in the IndexRangeCollection member (ok is set to true).

    See also setStopIndex().

    QString Oligomer::toString() const

    Returns a string documenting this Oligomer instance.

    MsXpS::libXpertMassCore::Oligomer &Oligomer::operator=(const MsXpS::libXpertMassCore::Oligomer &other)

    Assigns other to this Oligomer instance.

    Member Variable Documentation

    double Oligomer::m_avg

    This variable holds the average mass.

    MsXpS::libXpertMassCore::CalcOptions Oligomer::m_calcOptions

    This variable holds the CalcOptions instance that drives the mass and formula calculations.

    This variable holds the container of CrossLink instances formed in the Oligomer sequence.

    QString Oligomer::m_description

    This variable holds the description of the Oligomer.

    MsXpS::libXpertMassCore::Formula Oligomer::m_formula

    Stores the formula of the Oligomer.

    MsXpS::libXpertMassCore::Ionizer Oligomer::m_ionizer

    This variable holds the Ionizer instance that drives the ionization of the Oligomer.

    bool Oligomer::m_isModified

    Tells if the Oligomer is modified.

    double Oligomer::m_mono

    This variable holds the monoisotopic mass.

    QString Oligomer::m_name

    This variable holds the name of the Oligomer.

    std::size_t Oligomer::m_partialCleavage

    Stores the partial cleavage out of which the Oligomer has been obtained if that process was a (bio)-chemical cleavage.

    MsXpS::libXpertMassCore::PolymerCstQSPtr Oligomer::mcsp_polymer

    This variable holds the Polymer instance of which this Oligomer is part.