libXpertMass Developer Documentation
  • libXpertMass
  • Oligomer
  • Oligomer Class

    class MsXpS::libXpertMass::Oligomer

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

    Header: #include <Oligomer.hpp>
    Inherits: MsXpS::libXpertMass::Sequence, MsXpS::libXpertMass::CoordinateList, MsXpS::libXpertMass::Ionizable, and MsXpS::libXpertMass::PropListHolder

    Public Functions

    Oligomer(Polymer *polymer, const QString &name, const QString &description, bool modified, const Ponderable &ponderable, const IonizeRule &ionizeRule, const CalcOptions &calcOptions, bool isIonized, int startIndex, int endIndex)
    Oligomer(PolChemDefCstSPtr pol_chem_def_csp, const QString &name, const QString &description, bool modified, const Ponderable &ponderable, const IonizeRule &ionizeRule, const CalcOptions &calcOptions, bool isIonized, int startIndex, int endIndex)
    Oligomer(Polymer *polymer, const QString &name, const QString &description, bool modified = false, const Ponderable &ponderable = Ponderable(), int startIndex = -1, int endIndex = -1, const CalcOptions &calcOptions = CalcOptions())
    Oligomer(PolChemDefCstSPtr pol_chem_def_csp, const QString &name, const QString &description, bool modified = false, const Ponderable &ponderable = Ponderable(), const CalcOptions &calcOptions = CalcOptions(), int startIndex = -1, int endIndex = -1)
    Oligomer(const Ionizable &ionizable, const CalcOptions &calcOptions = CalcOptions(), int startIndex = -1, int endIndex = -1)
    Oligomer(Polymer *polymer, const QString &name, const QString &description, bool modified = false, double mono = 0, double avg = 0, int startIndex = -1, int endIndex = -1, const CalcOptions &calcOptions = CalcOptions())
    Oligomer(PolChemDefCstSPtr pol_chem_def_csp, const QString &name, const QString &description, bool modified = false, const CalcOptions &calcOptions = CalcOptions(), double mono = 0, double avg = 0, int startIndex = -1, int endIndex = -1)
    Oligomer(const Oligomer &other)
    virtual ~Oligomer()
    bool addCrossLink(CrossLink *cross_link)
    int appendCoordinates(CoordinateList *list)
    const Monomer &atLeftEnd() const
    const Monomer &atRightEnd() const
    const CalcOptions &calcOptions() const
    virtual bool calculateMasses(const CalcOptions *calc_options, const IonizeRule *ionize_rule = 0)
    QList<CrossLink *> *crossLinkList()
    QString description() const
    virtual QString elementalComposition()
    virtual QString elementalComposition(const CalcOptions &calc_options, const IonizeRule &ionize_rule)
    bool encompasses(int index) const
    bool encompasses(const Monomer *monomer) const
    int endIndex() const
    IonizeRule &ionizeRule()
    virtual bool isModified(bool deep = true)
    const Monomer *monomerAt(int index) const
    QString *monomerText()
    const Polymer *polymer() const
    void setCalcOptions(const CalcOptions &calc_options)
    void setDescription(const QString &description)
    void setEndIndex(int value)
    void setIonizeRule(IonizeRule &ionize_rule)
    void setModified(bool modified = true)
    void setStartEndIndices(int value1, int value2)
    void setStartIndex(int value)
    int size()
    int startIndex() const
    void updateCalcOptions()

    Reimplemented Public Functions

    virtual bool calculateMasses() override
    virtual int makeMonomerText() override

    Protected Variables

    CalcOptions m_calcOptions
    QList<CrossLink *> m_crossLinkList
    QString m_description
    bool m_isModified
    Polymer *mp_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 Coordinates).

    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.

    Derived from Ionizable (itself derived from Ponderable), an oligomer is also characterized by a monoisotopic mass and an average mass.

    All computations about an oligomer (fragmentation, composition, for example, isoelectric point, ...) can only be performed by referring to the sequence of its "enclosing" Polymer. Therefore, an Oligomer should never exist after the destruction of its "enclosing" polymer.

    Member Function Documentation

    Oligomer::Oligomer(Polymer *polymer, const QString &name, const QString &description, bool modified, const Ponderable &ponderable, const IonizeRule &ionizeRule, const CalcOptions &calcOptions, bool isIonized, int startIndex, int endIndex)

    Constructs an oligomer.

    The Oligomer instance is constructed with these arguments:

    polymer: The polymer instance that encloses this Oligomer. Used to intialize the member m_polymer and the Ionizable base class' polymer chemistry definition

    name: The name of this Oligomer, used to intialize the Ionizable base class

    description: The description of this Oligomer (m_description)

    modified: Tells if the Oligomer is modified

    ponderable: Used to initialize the Ionizable base class

    ionizeRule: Used to initialize the Ionizable base class

    calcOptions: Used to initialize the m_calcOptions member

    isIonized: Tells if this Oligomer instance is ionized

    startIndex: The oligomer's start index coordinate in the enclosing Polymer

    endIndex: The oligomer's end index coordinate in the enclosing Polymer

    Oligomer::Oligomer(PolChemDefCstSPtr pol_chem_def_csp, const QString &name, const QString &description, bool modified, const Ponderable &ponderable, const IonizeRule &ionizeRule, const CalcOptions &calcOptions, bool isIonized, int startIndex, int endIndex)

    Constructs an oligomer.

    The Oligomer instance is constructed with these arguments:

    pol_chem_def_csp: The polymer chemistry definition used to initialize the Ionizable base class

    name: The name of this Oligomer, used to intialize the Ionizable base class

    description: The description of this Oligomer (m_description)

    modified: Tells if the Oligomer is modified

    ponderable: Used to initialize the Ionizable base class

    ionizeRule: Used to initialize the Ionizable base class

    calcOptions: Used to initialize the m_calcOptions member

    isIonized: Tells if this Oligomer instance is ionized

    startIndex: The oligomer's start index coordinate in the enclosing Polymer

    endIndex: The oligomer's end index coordinate in the enclosing Polymer

    Oligomer::Oligomer(Polymer *polymer, const QString &name, const QString &description, bool modified = false, const Ponderable &ponderable = Ponderable(), int startIndex = -1, int endIndex = -1, const CalcOptions &calcOptions = CalcOptions())

    Constructs an oligomer.

    The Oligomer instance is constructed with these arguments:

    polymer: The polymer instance that encloses this Oligomer. Used to intialize the member m_polymer and the Ionizable base class' polymer

    name: The name of this Oligomer, used to intialize the Ionizable base class

    description: The description of this Oligomer (m_description)

    modified: Tells if the Oligomer is modified

    ponderable: Used to initialize the Ionizable base class

    calcOptions: Used to initialize the m_calcOptions member

    startIndex: The oligomer's start index coordinate in the enclosing Polymer

    endIndex: The oligomer's end index coordinate in the enclosing Polymer

    Oligomer::Oligomer(PolChemDefCstSPtr pol_chem_def_csp, const QString &name, const QString &description, bool modified = false, const Ponderable &ponderable = Ponderable(), const CalcOptions &calcOptions = CalcOptions(), int startIndex = -1, int endIndex = -1)

    Constructs an oligomer.

    The Oligomer instance is constructed with these arguments:

    pol_chem_def_csp: The polymer chemistry definition used to initialize the Ionizable base class

    name: The name of this Oligomer, used to intialize the Ionizable base class

    description: The description of this Oligomer (m_description)

    modified: Tells if the Oligomer is modified

    ponderable: Used to initialize the Ionizable base class

    calcOptions: Used to initialize the m_calcOptions member

    startIndex: The oligomer's start index coordinate in the enclosing Polymer

    endIndex: The oligomer's end index coordinate in the enclosing Polymer

    Oligomer::Oligomer(const Ionizable &ionizable, const CalcOptions &calcOptions = CalcOptions(), int startIndex = -1, int endIndex = -1)

    Constructs an oligomer.

    The Oligomer instance is constructed with these arguments:

    ionizable: Used to initialize the Ionizable base class

    calcOptions: Used to initialize the m_calcOptions member

    startIndex: The oligomer's start index coordinate in the enclosing Polymer

    endIndex: The oligomer's end index coordinate in the enclosing Polymer

    Oligomer::Oligomer(Polymer *polymer, const QString &name, const QString &description, bool modified = false, double mono = 0, double avg = 0, int startIndex = -1, int endIndex = -1, const CalcOptions &calcOptions = CalcOptions())

    Constructs an oligomer.

    The Oligomer instance is constructed with these arguments:

    polymer: Use to initialize the member mp_polymer and also to initialize the Ionizable base class (by using its polymer chemistry definition member).

    name: The name of this Oligomer, used to intialize the Ionizable base class

    description: The description of this Oligomer (m_description)

    modified: Tells if the Oligomer is modified

    mono and avg: Used to initialize the Ionizable::Ponderable base class

    calcOptions: Used to initialize the m_calcOptions member

    startIndex: The oligomer's start index coordinate in the enclosing Polymer

    endIndex: The oligomer's end index coordinate in the enclosing Polymer

    Oligomer::Oligomer(PolChemDefCstSPtr pol_chem_def_csp, const QString &name, const QString &description, bool modified = false, const CalcOptions &calcOptions = CalcOptions(), double mono = 0, double avg = 0, int startIndex = -1, int endIndex = -1)

    Constructs an oligomer.

    The Oligomer instance is constructed with these arguments:

    pol_chem_def_csp: The polymer chemistry definition used to initialize the Ionizable base class

    name: The name of this Oligomer, used to intialize the Ionizable base class

    description: The description of this Oligomer (m_description)

    modified: Tells if the Oligomer is modified

    calcOptions: Used to initialize the m_calcOptions member

    mono and avg: Used to initialize the Ionizable::Ponderable base class

    startIndex: The oligomer's start index coordinate in the enclosing Polymer

    endIndex: The oligomer's end index coordinate in the enclosing Polymer

    Oligomer::Oligomer(const Oligomer &other)

    Constructs the Oligomer as a copy of other.

    [virtual noexcept] Oligomer::~Oligomer()

    Destructs this Oligomer.

    Add the cross_link CrossLink to this Oligomer's list of CrossLinks

    Returns true if the cross-link was added succesfully, or false if cross_link was already in the list.

    int Oligomer::appendCoordinates(CoordinateList *list)

    Add to the member CoordinateList all the Coordinates instances found in list.

    The added Coordinates instances are copies of the instances found in list.

    Returns the count of added Coordinates instances allocated on the heap.

    const Monomer &Oligomer::atLeftEnd() const

    Returns the Monomer in the enclosing Polymer that is located at the start index of this oligomer.

    See also atRightEnd() and startIndex().

    const Monomer &Oligomer::atRightEnd() const

    Returns the Monomer in the enclosing Polymer that is located at the end index of this oligomer.

    See also atLeftEnd() and endIndex().

    const CalcOptions &Oligomer::calcOptions() const

    Returns the calculation options.

    See also setCalcOptions().

    [override virtual] bool Oligomer::calculateMasses()

    Reimplements: Ionizable::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 start and end indices in the polymer sequence. Default calculation options are used.

    Returns true if calculations were successful, false otherwise.

    [virtual] bool Oligomer::calculateMasses(const CalcOptions *calc_options, const IonizeRule *ionize_rule = 0)

    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 ionize_rule.

    Returns true if calculations were successful, false otherwise.

    Returns the member crossLinkList.

    QString Oligomer::description() const

    Returns the description.

    See also setDescription().

    [virtual] QString Oligomer::elementalComposition()

    Returns the elemental composition of this Oligomer instance.

    [virtual] QString Oligomer::elementalComposition(const CalcOptions &calc_options, const IonizeRule &ionize_rule)

    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 ionize_rule.

    bool Oligomer::encompasses(int index) const

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

    bool Oligomer::encompasses(const Monomer *monomer) const

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

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

    int Oligomer::endIndex() const

    Returns the end index.

    The end index that is returned is the end index of the first Coordinates instance of the CoordinateList member.

    See also setEndIndex().

    IonizeRule &Oligomer::ionizeRule()

    Returns a reference to the IonizeRule member.

    See also setIonizeRule().

    [virtual] bool Oligomer::isModified(bool deep = true)

    Returns the chemical modification status of this Oligomer.

    If deep is true, the enclosing Polymer must exist (m_polymer cannot be nullptr) because each monomer of the Polymer is probed for a potential modification. This function returns true as soon as such a modified monomer is encountered.

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

    See also m_isModified and Monomer::isModified().

    [override virtual] int Oligomer::makeMonomerText()

    Reimplements: Sequence::makeMonomerText().

    Calculates the sequence of this Oligomer and sets it to the Sequence base class member m_monomerText.

    Returns the size of m_monomerText. If m_polymer is nullptr, return 0.

    See also Sequence.

    const Monomer *Oligomer::monomerAt(int index) const

    Return the Monomer that is located in the enclosing Polymer at index.

    QString *Oligomer::monomerText()

    Returns a string with the sequence of this Oligomer.

    If mp_polymer is non-nullptr, the sequence is calculated by looking into the Polymer using member Coordinates.

    If mp_polymer is nullptr and if Sequence::m_monomerText is not empty, that is returned.

    If mp_polymer is nullptr and if Sequence::m_monomerText is emtpy, then the sequence is crafted by looking into Sequence::m_monomerList.

    See also makeMonomerText().

    const Polymer *Oligomer::polymer() const

    Returns the polymer.

    void Oligomer::setCalcOptions(const CalcOptions &calc_options)

    Set the calculation options to calc_options.

    See also m_calcOptions.

    void Oligomer::setDescription(const QString &description)

    Set the description to description.

    See also description().

    void Oligomer::setEndIndex(int value)

    Sets the end index to value.

    The value is used to construct a Coordinates instance that is allocated on the heap and added to member CoordinateList if that list is empty. If the CoordinateList is not empty, then the value is set to the first Coordinates instance in that list.

    See also endIndex().

    void Oligomer::setIonizeRule(IonizeRule &ionize_rule)

    Set the IonizeRule member to ionize_rule.

    See also MsXpS::libXpertMass::Ionizable::m_ionizeRule.

    void Oligomer::setModified(bool modified = true)

    Set the m_isModified status of this Oligomer to modified.

    See also isModified().

    void Oligomer::setStartEndIndices(int value1, int value2)

    Sets the start and end indices to value1 and value2 respectively.

    The values are used to construct a Coordinates instance that is allocated on the heap and added to member CoordinateList if that list is empty. If the CoordinateList is not empty, then the values are set to the first Coordinates instance in that list.

    See also setStartIndex() and setEndIndex().

    void Oligomer::setStartIndex(int value)

    Sets the start index to value.

    The value is used to construct a Coordinates instance that is allocated on the heap and added to member CoordinateList if that list is empty. If the CoordinateList is not empty, then the value is set to the first Coordinates instance in that list.

    See also startIndex().

    int 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.

    int Oligomer::startIndex() const

    Returns the start index, or -1 if no Coordinates instance is found in the CoordinateList member.

    The start index that is returned is the start index of the first Coordinates instance of the CoordinateList member.

    See also setStartIndex().

    void Oligomer::updateCalcOptions()

    Updates the member calculation options with this Oligomer's CoordinateList.

    The data in m_calcOptions that need updating are the CoordinateList elements.

    Member Variable Documentation

    CalcOptions Oligomer::m_calcOptions

    This variable holds the calculation options definining how calculations are performed.

    This variable holds the list of CrossLink events in the oligomer sequence.

    QString Oligomer::m_description

    This variable holds the description of the Oligomer.

    bool Oligomer::m_isModified

    Tell if the Oligomer is modified.

    Polymer *Oligomer::mp_polymer

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