libXpertMass Developer Documentation
  • libXpertMass
  • CleaveSpec
  • CleaveSpec Class

    class MsXpS::libXpertMass::CleaveSpec

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

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

    Public Functions

    CleaveSpec(PolChemDefCstSPtr pol_chem_def_csp, QString name, QString pattern = QString())
    CleaveSpec(const CleaveSpec &other)
    virtual ~CleaveSpec()
    QString *formatXmlClsElement(int offset, const QString &indent = QString(" "))
    QList<CleaveMotif *> *motifList()
    bool parse()
    const QString &pattern()
    bool renderXmlClsElement(const QDomElement &element, int version)
    QList<CleaveRule *> *ruleList()
    void setPattern(const QString &pattern)
    bool validate()
    CleaveSpec &operator=(const CleaveSpec &other)

    Static Public Members

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

    Protected Variables

    QList<CleaveMotif *> m_motifList
    QString m_pattern
    QList<CleaveRule *> m_ruleList

    Detailed Description

    Cleavage specifications determine the specificity of cleavage in a polymer sequence using a simple syntax. For example, Trypsin is able to cleave after lysyl and arginyl residues. Its cleavage pattern is thus "Lys/;Arg/". However, it is known that Trypsin fails to cleave after Lys if that monomer is followed by a Prolyl residue, thus the complete cleavage specification for Trypsin comprises three cleavage motifs: "Lys/;Arg/;-Lys/Pro".

    A cleavage specification might not be enough information to determine the manner in which a polymer is cleaved. Cleavage rules might be required to refine the specification. A cleavage specification might hold as many cleavage rules as required.

    See also CleaveMotif and CleaveRule.

    Member Function Documentation

    CleaveSpec::CleaveSpec(PolChemDefCstSPtr pol_chem_def_csp, QString name, QString pattern = QString())

    Constructs a CleaveSpec instance.

    CleaveSpec::CleaveSpec(const CleaveSpec &other)

    Constructs a CleaveSpec instance as a copy of other.

    [virtual noexcept] CleaveSpec::~CleaveSpec()

    Destructs this CleaveSpec instance.

    QString *CleaveSpec::formatXmlClsElement(int offset, const QString &indent = QString(" "))

    Formats a string describing this CleaveSpec instance suitable to be used as an XML element.

    The XML element is typically used in a polymer chemistry defintion and looks like this:

    <cls>
    <name>CyanogenBromide</name>
    <pattern>M/</pattern>
    <clr>
    <re-mnm-code>M</re-mnm-code>
    <re-formula>-CH2S+O</re-formula>
    </clr>
    </cls>

    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 CleaveSpec::isNameInList(const QString &name, const QList<CleaveSpec *> &cleave_spec_list, CleaveSpec *other = nullptr)

    Searches for a CleaveSpec instance by name in cleave_spec_list.

    If the CleaveSpec instance is found, it is copied into other.

    Returns the index of the found cleavage specification or -1 if none is found or if other is empty.

    QList<CleaveMotif *> *CleaveSpec::motifList()

    Returns the list of CleaveMotif instances.

    bool CleaveSpec::parse()

    Parses this CleaveSpec instance.

    The parsing involves separating the components found in the m_pattern string and making CleaveMotif instances out of them.

    Starting from a pattern "Lys/;Arg/;-Lys/Pro", the parsing would first split it into three site strings:

    Each of these site strings will be deconstructed into motifs, stored in CleaveMotif objects:

    Returns true if parsing is successful, false otherwise.

    const QString &CleaveSpec::pattern()

    Returns the pattern.

    See also setPattern().

    bool CleaveSpec::renderXmlClsElement(const QDomElement &element, int version)

    Parses a cleavage specification XML element using a versioned function.

    The data in the element are validated and if successful they are set to this instance, thus initializing it.

    Returns true upon success, false otherwise.

    QList<CleaveRule *> *CleaveSpec::ruleList()

    Returns the list of CleaveRule instances.

    void CleaveSpec::setPattern(const QString &pattern)

    Sets the pattern.

    See also pattern().

    bool CleaveSpec::validate()

    Validates this CleaveSpec instance.

    The validation involves checking that:

    Returns true if the validation is successful, false otherwise.

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

    Assigns other to this CleaveSpec instance.

    Returns a reference to this CleaveSpec instance.

    Member Variable Documentation

    QList<CleaveMotif *> CleaveSpec::m_motifList

    This variable holds the list of CleaveMotifs that together make the CleaveSpec.

    See also CleaveMotif.

    QString CleaveSpec::m_pattern

    This variable holds the cleavage pattern, that might comprise more than one CleaveMotif.

    See also CleaveMotif and CleaveRule.

    QList<CleaveRule *> CleaveSpec::m_ruleList

    This variable holds the list of CleaveRules that might be requied to refine the CleaveSpec.

    See also CleaveRule.