libXpertMassCore and libXpertMassGui Developer Documentation
  • libXpertMassCore
  • CleavageRule
  • CleavageRule Class

    class MsXpS::libXpertMassCore::CleavageRule

    The CleavageRule class provides a model for specifying aqueous cleavage rules for refining cleavage agent specifications (CleavageAgent) of Polymer Sequences. More...

    Header: #include <CleavageRule.hpp>

    Public Functions

    CleavageRule(MsXpS::libXpertMassCore::PolChemDefCstSPtr pol_chem_def_csp)
    CleavageRule(MsXpS::libXpertMassCore::PolChemDefCstSPtr pol_chem_def_csp, const QString &name, const QString &left_code, const QString &left_formula, const QString &right_code, const QString &right_formula)
    CleavageRule(const MsXpS::libXpertMassCore::CleavageRule &other)
    ~CleavageRule()
    QString formatXmlClrElement(int offset, const QString &indent = Utils::xmlIndentationToken)
    const QString &getLeftCode() const
    const MsXpS::libXpertMassCore::Formula &getLeftFormula() const
    const QString &getName() const
    MsXpS::libXpertMassCore::PolChemDefCstSPtr getPolchemDefCstSPtr() const
    const QString &getRightCode() const
    const MsXpS::libXpertMassCore::Formula &getRightFormula() const
    bool isValid() const
    bool renderXmlClrElement(const QDomElement &element, int version)
    void setLeftCode(const QString &code)
    void setLeftFormula(const MsXpS::libXpertMassCore::Formula &formula)
    void setName(const QString &name)
    void setPolchemDefCstSPtr(MsXpS::libXpertMassCore::PolChemDefCstSPtr pol_chem_def_csp)
    void setRightCode(const QString &code)
    void setRightFormula(const MsXpS::libXpertMassCore::Formula &formula)
    bool validate(MsXpS::libXpertMassCore::ErrorList *error_list_p) const
    bool operator!=(const MsXpS::libXpertMassCore::CleavageRule &other) const
    MsXpS::libXpertMassCore::CleavageRule &operator=(const MsXpS::libXpertMassCore::CleavageRule &other)
    bool operator==(const MsXpS::libXpertMassCore::CleavageRule &other) const

    Protected Variables

    bool m_isValid
    QString m_leftCode
    MsXpS::libXpertMassCore::Formula m_leftFormula
    QString m_name
    QString m_rightCode
    MsXpS::libXpertMassCore::Formula m_rightFormula
    MsXpS::libXpertMassCore::PolChemDefCstSPtr mcsp_polChemDef

    Detailed Description

    Cleavage rules help refine the description of the chemical reaction that is the basis of a cleavage (either enzymatic or chemical).

    While a number of cleavage agents (like a number of enzymes) do not make unexpected reactions upon the cleavage (enzymes usually hydrolyze their substrates), there are chemical agents that during the process of cleaving their polymer sequence substrate also chemically modify the ends of the generated oligomers. One notorious example is the case of cyanogen bromide, that cleaves proteins right (that is, C-terminal) of methionyl residues. Upon such cleavage, the monomer at the right side of the generated oligomer (methionyl residue) gets modified according to this actionformula: "-CH2S+O". This reaction is modelled using a CleavageRule.

    See also CleavageMotif and CleavageAgent.

    Member Function Documentation

    CleavageRule::CleavageRule(MsXpS::libXpertMassCore::PolChemDefCstSPtr pol_chem_def_csp)

    Constructs a CleavageRule instance with pol_chem_def_csp as the polymer chemistry definition.

    The validiy status (m_isValid) of this install will be set to false.

    CleavageRule::CleavageRule(MsXpS::libXpertMassCore::PolChemDefCstSPtr pol_chem_def_csp, const QString &name, const QString &left_code, const QString &left_formula, const QString &right_code, const QString &right_formula)

    Constructs a CleavageRule instance

    After setting the member data, the instance is validated and the result is set to m_isValid.

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

    Constructs a CleavageRule instance as a copy of other.

    After setting the member data, the instance is validated and the result is set to m_isValid.

    [noexcept] CleavageRule::~CleavageRule()

    Destructs this CleavageRule instance

    QString CleavageRule::formatXmlClrElement(int offset, const QString &indent = Utils::xmlIndentationToken)

    Formats a string representing this CleavageRule instance suitable to use as an XML element.

    The typical cleavage rule element that is generated in this function looks like this:

    <clr>
    <re-mnm-code>M</re-mnm-code>
    <re-formula>-CH2S+O</re-formula>
    </clr>

    The formatting of the XML element takes into account offset and indent by prepending the string with offset * indent character substring.

    indent defaults to two spaces.

    Returns a string.

    const QString &CleavageRule::getLeftCode() const

    Returns the left code.

    const MsXpS::libXpertMassCore::Formula &CleavageRule::getLeftFormula() const

    Returns the left formula.

    const QString &CleavageRule::getName() const

    Returns the name.

    MsXpS::libXpertMassCore::PolChemDefCstSPtr CleavageRule::getPolchemDefCstSPtr() const

    Returns the PolChemDef.

    const QString &CleavageRule::getRightCode() const

    Returns the right code.

    const MsXpS::libXpertMassCore::Formula &CleavageRule::getRightFormula() const

    Returns the right formula.

    bool CleavageRule::isValid() const

    Returns the validity status of this CleavageRule.

    bool CleavageRule::renderXmlClrElement(const QDomElement &element, int version)

    Parses the CleavageRule XML element using a versioned function.

    Upon parsing of the element, its data are validated and set to this CleavageRule instance, thus essentially initializing it.

    Returns true if parsing and validation were successful, false otherwise.

    void CleavageRule::setLeftCode(const QString &code)

    Sets the left code.

    After setting the member data, the instance is validated and the result is set to m_isValid.

    void CleavageRule::setLeftFormula(const MsXpS::libXpertMassCore::Formula &formula)

    Sets the left formula.

    After setting the member data, the instance is validated and the result is set to m_isValid.

    void CleavageRule::setName(const QString &name)

    Sets the name to name.

    After setting the member data, the instance is validated and the result is set to m_isValid.

    void CleavageRule::setPolchemDefCstSPtr(MsXpS::libXpertMassCore::PolChemDefCstSPtr pol_chem_def_csp)

    Sets the PolChemDef to pol_chem_def_csp.

    After setting the member data, the instance is validated and the result is set to m_isValid.

    void CleavageRule::setRightCode(const QString &code)

    Sets the right code.

    After setting the member data, the instance is validated and the result is set to m_isValid.

    void CleavageRule::setRightFormula(const MsXpS::libXpertMassCore::Formula &formula)

    Sets the right formula.

    After setting the member data, the instance is validated and the result is set to m_isValid.

    bool CleavageRule::validate(MsXpS::libXpertMassCore::ErrorList *error_list_p) const

    Validates this CleavageRule instance and stores error messages to error_list_p.

    Validation entails the following:

    Sets m_isValid to true if the validation is successful, false otherwise. Returns m_isValid.

    bool CleavageRule::operator!=(const MsXpS::libXpertMassCore::CleavageRule &other) const

    Returns true if this and other are different.

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

    Assigns to other to this CleavageRule instance.

    After setting the member data, the instance is validated and the result is set to m_isValid.

    Returns a reference to this CleavageRule instance.

    bool CleavageRule::operator==(const MsXpS::libXpertMassCore::CleavageRule &other) const

    Returns true if this and other are identical.

    Member Variable Documentation

    bool CleavageRule::m_isValid

    This variable holds the validity status of the CleavageRule instance.

    QString CleavageRule::m_leftCode

    This variable holds the Monomer code at the left of the cleavage site.

    MsXpS::libXpertMassCore::Formula CleavageRule::m_leftFormula

    This variable holds the Formula to be applied onto the left monomer code.

    QString CleavageRule::m_name

    This variable holds the name of the CleavageRule.

    QString CleavageRule::m_rightCode

    This variable holds the Monomer code at the right of the cleavage site.

    MsXpS::libXpertMassCore::Formula CleavageRule::m_rightFormula

    This variable holds the Formula to be applied onto the right monomer code.

    MsXpS::libXpertMassCore::PolChemDefCstSPtr CleavageRule::mcsp_polChemDef

    This variable holds the PolChemDef polymer chemistry definition.