libXpertMass Developer Documentation
  • libXpertMass
  • CleaveRule
  • CleaveRule Class

    class MsXpS::libXpertMass::CleaveRule

    The CleaveRule class provides a model for specifying aqueous cleavage rules for refining cleavage specifications (CleaveSpec) of Polymer Sequences. More...

    Header: #include <CleaveRule.hpp>
    Inherits: MsXpS::libXpertMass::PolChemDefEntity

    Public Functions

    CleaveRule(PolChemDefCstSPtr pol_chem_def_csp, QString name, QString leftCode = QString(), QString leftFormula = QString(), QString rightCode = QString(), QString rightFormula = QString())
    CleaveRule(const CleaveRule &other)
    virtual ~CleaveRule()
    QString *formatXmlClrElement(int offset, const QString &indent = QString(" "))
    const QString &leftCode()
    const Formula &leftFormula()
    bool renderXmlClrElement(const QDomElement &element, int version)
    const QString &rightCode()
    const Formula &rightFormula()
    void setLeftCode(const QString &code)
    void setLeftFormula(const Formula &formula)
    void setRightCode(const QString &code)
    void setRightFormula(const Formula &formula)
    bool validate()
    CleaveRule &operator=(const CleaveRule &other)

    Static Public Members

    int isNameInList(const QString &name, const QList<CleaveRule *> &cleave_rule_list, CleaveRule *other = nullptr)

    Protected Variables

    QString m_leftCode
    Formula m_leftFormula
    QString m_rightCode
    Formula m_rightFormula

    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 while cleaving their polymer sequence substrate chemically modify the ends of the generated oligomers. One notorious example is the case of cyanogen bromide, that cleaves proteins right 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 CleaveRule.

    See also CleaveMotif and CleaveSpec.

    Member Function Documentation

    CleaveRule::CleaveRule(PolChemDefCstSPtr pol_chem_def_csp, QString name, QString leftCode = QString(), QString leftFormula = QString(), QString rightCode = QString(), QString rightFormula = QString())

    Constructs a CleaveRule instance

    CleaveRule::CleaveRule(const CleaveRule &other)

    Constructs a CleaveRule instance as a copy of other.

    [virtual noexcept] CleaveRule::~CleaveRule()

    Destructs this CleaveRule instance

    QString *CleaveRule::formatXmlClrElement(int offset, const QString &indent = QString(" "))

    Formats a string representing this CleaveRule 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 dynamically allocated string that needs to be freed after use.

    [static] int CleaveRule::isNameInList(const QString &name, const QList<CleaveRule *> &cleave_rule_list, CleaveRule *other = nullptr)

    Searches for a CleaveRule instance by name in cleave_rule_list.

    If the instance is found, and other is non-nullptr, it is copied to other.

    Returns the index of the found CleaveRule instance in cleave_rule_list or -1 is the cleavage rule was not found.

    const QString &CleaveRule::leftCode()

    Returns the left code.

    See also setLeftCode().

    const Formula &CleaveRule::leftFormula()

    Returns the left formula.

    See also setLeftFormula().

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

    Parses the CleaveRule XML element using a versioned function.

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

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

    const QString &CleaveRule::rightCode()

    Returns the right code.

    See also setRightCode().

    const Formula &CleaveRule::rightFormula()

    Returns the right formula.

    See also setRightFormula().

    void CleaveRule::setLeftCode(const QString &code)

    Sets the left code.

    See also leftCode().

    void CleaveRule::setLeftFormula(const Formula &formula)

    Sets the left formula.

    See also leftFormula().

    void CleaveRule::setRightCode(const QString &code)

    Sets the right code.

    See also rightCode().

    void CleaveRule::setRightFormula(const Formula &formula)

    Sets the right formula.

    See also rightFormula().

    bool CleaveRule::validate()

    Validates this CleaveRule instance.

    Validation entails the following:

    Returns true if the validation is successful, false otherwise.

    CleaveRule &CleaveRule::operator=(const CleaveRule &other)

    Assigns to other to this CleaveRule instance.

    Returns a reference to this CleaveRule instance.

    Member Variable Documentation

    QString CleaveRule::m_leftCode

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

    Formula CleaveRule::m_leftFormula

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

    QString CleaveRule::m_rightCode

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

    Formula CleaveRule::m_rightFormula

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