libXpertMass Developer Documentation
  • libXpertMass
  • ChemicalGroup
  • ChemicalGroup Class

    class MsXpS::libXpertMass::ChemicalGroup

    The ChemicalGroup class provides a model for specifying the acido-basic behaviour of a chemical group of either a Monomer object or of a Modif object. More...

    Header: #include <ChemicalGroup.hpp>

    Public Functions

    ChemicalGroup(QString name = QString(), float pka = 7.0, bool is_acid_charged = true, ChemicalGroupTrapping polymerization_rule = ChemicalGroupTrapping::NEVER_TRAPPED)
    ChemicalGroup(const ChemicalGroup &other)
    ~ChemicalGroup()
    ChemicalGroupRule *findRule(QString entity, QString name, int *index = 0) const
    ChemicalGroupRule *findRuleEntity(QString entity, int *index = 0) const
    ChemicalGroupRule *findRuleName(QString name, int *index = 0) const
    bool isAcidCharged() const
    QString name() const
    float pka() const
    ChemicalGroupTrapping polRule() const
    bool renderXmlMdfElement(const QDomElement &element)
    bool renderXmlMnmElement(const QDomElement &element)
    QList<ChemicalGroupRule *> &ruleList()
    void setAcidCharged(bool acid_charged)
    void setName(QString name)
    void setPka(float pka)
    void setPolRule(ChemicalGroupTrapping pol_rule)
    ChemicalGroup &operator=(const ChemicalGroup &other)

    Protected Variables

    bool m_acidCharged
    QString m_name
    float m_pka
    ChemicalGroupTrapping m_polymerizationRule
    QList<ChemicalGroupRule *> m_ruleList

    Detailed Description

    If the ChemicalGroup does not prove sufficient to characterize precisely the acido-basic properties of an entity, ChemicalGroupRule instances can be added to that effect.

    In an pkaphpidata definition file, the following xml structure is encountered:

    <pkaphpidata>
      <monomers>
        <monomer>
          <code>A</code>
          <mnmchemgroup>
            <name>N-term NH2</name>
            <pka>9.6</pka>
            <acidcharged>TRUE</acidcharged>
            <polrule>left_trapped</polrule>
            <chemgrouprule>
              <entity>LE_PLM_MODIF</entity>
              <name>Acetylation</name>
              <outcome>LOST</outcome>
            </chemgrouprule>
          </mnmchemgroup>
          <mnmchemgroup>
            <name>C-term COOH</name>
            <pka>2.35</pka>
            <acidcharged>FALSE</acidcharged>
            <polrule>right_trapped</polrule>
          </mnmchemgroup>
        </monomer>
        <monomer>
          <code>C</code>
          <mnmchemgroup>
            <name>N-term NH2</name>
            <pka>9.6</pka>
            <acidcharged>TRUE</acidcharged>
            <polrule>left_trapped</polrule>
            <chemgrouprule>
              <entity>LE_PLM_MODIF</entity>
              <name>Acetylation</name>
              <outcome>LOST</outcome>
            </chemgrouprule>
          </mnmchemgroup>
          <mnmchemgroup>
            <name>C-term COOH</name>
            <pka>2.35</pka>
            <acidcharged>FALSE</acidcharged>
            <polrule>right_trapped</polrule>
          </mnmchemgroup>
          <mnmchemgroup>
            <name>Lateral SH2</name>
            <pka>8.3</pka>
            <acidcharged>FALSE</acidcharged>
            <polrule>never_trapped</polrule>
          </mnmchemgroup>
        </monomer>
        .....
      <modifs>
        <modif>
          <name>Phosphorylation</name>
          <mdfchemgroup>
            <name>none_set</name>
            <pka>1.2</pka>
            <acidcharged>FALSE</acidcharged>
          </mdfchemgroup>
          <mdfchemgroup>
            <name>none_set</name>
            <pka>6.5</pka>
            <acidcharged>FALSE</acidcharged>
          </mdfchemgroup>
        </modif>
      </modifs>
    </pkaphpidata>

    See also ChemicalGroupRule.

    Member Function Documentation

    ChemicalGroup::ChemicalGroup(QString name = QString(), float pka = 7.0, bool is_acid_charged = true, ChemicalGroupTrapping polymerization_rule = ChemicalGroupTrapping::NEVER_TRAPPED)

    Constructs a ChemicalGroup instance.

    name The name of this ChemicalGroup. pka The pKa value of this ChemicalGroup. is_acid_charged Tells if the ChemicalGroup bears a charge when in acidic conditions. polymerization_rule Specifies the polymerization rule.

    ChemicalGroup::ChemicalGroup(const ChemicalGroup &other)

    Construct a ChemicalGroup instance as a copy of other.

    [noexcept] ChemicalGroup::~ChemicalGroup()

    Destructs this ChemicalGroup instance.

    ChemicalGroupRule *ChemicalGroup::findRule(QString entity, QString name, int *index = 0) const

    Searches by entity and name for a ChemicalGroupRule instance.

    Returns the index of the ChemicalGroupRule instance in the member list of ChemicalGroupRule instances or -1 if not found.

    ChemicalGroupRule *ChemicalGroup::findRuleEntity(QString entity, int *index = 0) const

    Searches by entity for a ChemicalGroupRule instance.

    Returns the index of the ChemicalGroupRule instance in the member list of ChemicalGroupRule instances or -1 if not found.

    ChemicalGroupRule *ChemicalGroup::findRuleName(QString name, int *index = 0) const

    Searches by name for a ChemicalGroupRule instance.

    Returns the index of the ChemicalGroupRule instance in the member list of ChemicalGroupRule instances or -1 if not found.

    bool ChemicalGroup::isAcidCharged() const

    Returns the charge condition in acidic conditions.

    If true, the group bears a charge when the pH is less than the pKa.

    QString ChemicalGroup::name() const

    Returns the name.

    See also setName().

    float ChemicalGroup::pka() const

    Returns the pKa.

    See also setPka().

    ChemicalGroupTrapping ChemicalGroup::polRule() const

    Returns the polymerization rule.

    See also setPolRule().

    bool ChemicalGroup::renderXmlMdfElement(const QDomElement &element)

    Parses the ChemicalGroup XML element related to a Modif.

    Upon parsing of the element (tag <mnmchemgroup>), its data are validated and set to this ChemicalGroup instance, thus essentially initializing it.

    In an pkaphpidata definition file, the following xml structure is encountered:

    <pkaphpidata>
      <monomers>
        <monomer>
          <code>A</code>
          <mnmchemgroup>
            <name>N-term NH2</name>
            <pka>9.6</pka>
            <acidcharged>TRUE</acidcharged>
            <polrule>left_trapped</polrule>
            <chemgrouprule>
              <entity>LE_PLM_MODIF</entity>
              <name>Acetylation</name>
              <outcome>LOST</outcome>
            </chemgrouprule>
          </mnmchemgroup>
          <mnmchemgroup>
            <name>C-term COOH</name>
            <pka>2.35</pka>
            <acidcharged>FALSE</acidcharged>
            <polrule>right_trapped</polrule>
          </mnmchemgroup>
        </monomer>
        .......
      </monomers>
      <modifs>
        <modif>
          <name>Phosphorylation</name>
          <mdfchemgroup>
            <name>none_set</name>
            <pka>1.2</pka>
            <acidcharged>FALSE</acidcharged>
          </mdfchemgroup>
          <mdfchemgroup>
            <name>none_set</name>
            <pka>6.5</pka>
            <acidcharged>FALSE</acidcharged>
          </mdfchemgroup>
        </modif>
      </modifs>
    </pkaphpidata>

    Upon parsing of the element, all the data are validated and set to this ChemicalGroup instance, thus essentially initializing it. If there are ChemicalGroupRules associated to the ChemicalGroup element, these are rendered also.

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

    bool ChemicalGroup::renderXmlMnmElement(const QDomElement &element)

    Parses the ChemicalGroup XML element related to a Monomer.

    Upon parsing of the element (tag

    are validated and set to this ChemicalGroup instance, thus essentially
    initializing it.
    
    In an pkaphpidata definition file, the following xml structure
    is encountered:
    
    \code
    <pkaphpidata>
      <monomers>
        <monomer>
          <code>A</code>
          <mnmchemgroup>
            <name>N-term NH2</name>
            <pka>9.6</pka>
            <acidcharged>TRUE</acidcharged>
            <polrule>left_trapped</polrule>
            <chemgrouprule>
              <entity>LE_PLM_MODIF</entity>
              <name>Acetylation</name>
              <outcome>LOST</outcome>
            </chemgrouprule>
          </mnmchemgroup>
          <mnmchemgroup>
            <name>C-term COOH</name>
            <pka>2.35</pka>
            <acidcharged>FALSE</acidcharged>
            <polrule>right_trapped</polrule>
          </mnmchemgroup>
        </monomer>
        <monomer>
          <code>C</code>
          <mnmchemgroup>
            <name>N-term NH2</name>
            <pka>9.6</pka>
            <acidcharged>TRUE</acidcharged>
            <polrule>left_trapped</polrule>
            <chemgrouprule>
              <entity>LE_PLM_MODIF</entity>
              <name>Acetylation</name>
              <outcome>LOST</outcome>
            </chemgrouprule>
          </mnmchemgroup>
          <mnmchemgroup>
            <name>C-term COOH</name>
            <pka>2.35</pka>
            <acidcharged>FALSE</acidcharged>
            <polrule>right_trapped</polrule>
          </mnmchemgroup>
          <mnmchemgroup>
            <name>Lateral SH2</name>
            <pka>8.3</pka>
            <acidcharged>FALSE</acidcharged>
            <polrule>never_trapped</polrule>
          </mnmchemgroup>
        </monomer>

    Upon parsing of the element, all the data are validated and set to this ChemicalGroup instance, thus essentially initializing it. If there are ChemicalGroupRules associated to the ChemicalGroup element, these are rendered also.

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

    QList<ChemicalGroupRule *> &ChemicalGroup::ruleList()

    Returns the list of ChemicalGroupRule instances.

    void ChemicalGroup::setAcidCharged(bool acid_charged)

    Sets the charge condition in acidic conditions to acid_charged.

    If true, the group bears a charge when the pH is less than the pKa.

    See also isAcidCharged().

    void ChemicalGroup::setName(QString name)

    Sets the name.

    See also name().

    void ChemicalGroup::setPka(float pka)

    Sets the pKa to pka.

    See also pka().

    void ChemicalGroup::setPolRule(ChemicalGroupTrapping pol_rule)

    Sets the polymerization rule to pol_rule.

    The polymerization rule determines if the chemical group is trapped upon formation of a Monomer-to-Monomer bond.

    See also polRule().

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

    Assigns other to this ChemicalGroup instance.

    Returns a reference to this ChemicalGroup instance.

    Member Variable Documentation

    bool ChemicalGroup::m_acidCharged

    Tells if the group is charged when in acid conditions (that is, the pH is less than the pKa).

    QString ChemicalGroup::m_name

    This variable holds the name of the ChemicalGroup instance.

    float ChemicalGroup::m_pka

    This variable holds the pKa of the ChemicalGroup instance.

    ChemicalGroupTrapping ChemicalGroup::m_polymerizationRule

    This variable holds the way this ChemicalGroup behaves upon polymerization of the chemical entity into a Polymer.

    QList<ChemicalGroupRule *> ChemicalGroup::m_ruleList

    This variable holds the list of ChemicalGroupRule instances.