| <large>libXpertMassCore and libXpertMassGui Developer Documentation</large>

- libXpertMassCore
- PkaPhPiDataParser

# MsXpS::libXpertMassCore::PkaPhPiDataParser Class

class MsXpS::libXpertMassCore::PkaPhPiDataParser

The PkaPhPiDataParser class provides a file reader for the pKa, pH, pI data XML file. More...

Header: | `#include <PkaPhPiDataParser.hpp>`

- List of all members, including inherited members
- PkaPhPiDataParser is part of Polymer chemistry building blocks.

## Public Functions

| PkaPhPiDataParser(const MsXpS::libXpertMassCore::PolChemDefCstSPtr &pol_chem_def_csp, const QString &file_path = QString())
| ~PkaPhPiDataParser()
const QString & | filePath()
bool | renderXmlFile(std::vector<MsXpS::libXpertMassCore::MonomerSPtr> &monomers, std::vector<MsXpS::libXpertMassCore::ModifSPtr> &modifs)
void | setFilePath(const QString &file_path)

## Protected Variables

QString | m_filePath
MsXpS::libXpertMassCore::PolChemDefCstSPtr | mcsp_polChemDef

## Detailed Description

The format is the following:

    <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>
      </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>

## Member Function Documentation

### PkaPhPiDataParser::PkaPhPiDataParser(const MsXpS::libXpertMassCore::PolChemDefCstSPtr &pol_chem_def_csp, const QString &file_path = QString())

Constructs a PkaPhPiDataParser instance.

- pol_chem_def_csp: The polymer chemistry definition (cannot be nullptr).
- file_path: the specification file path.

### `[noexcept]` PkaPhPiDataParser::~PkaPhPiDataParser()

Destructs this PkaPhPiDataParser instance

### const QString &PkaPhPiDataParser::filePath()

Returns the file path.

See also setFilePath().

### bool PkaPhPiDataParser::renderXmlFile(std::vector<MsXpS::libXpertMassCore::MonomerSPtr> &monomers, std::vector<MsXpS::libXpertMassCore::ModifSPtr> &modifs)

Parses the file and fills-in the monomers and the modifs containers.

The two container hold specific Monomer and Modif instances as desribed in the loaded file.

Returns true upon success, false otherwise.

### void PkaPhPiDataParser::setFilePath(const QString &file_path)

Sets the file_path.

See also filePath().

## Member Variable Documentation

### QString PkaPhPiDataParser::m_filePath

This variable holds the path of the file that contains all the specifications for chemical groups and chemical rules.

### MsXpS::libXpertMassCore::PolChemDefCstSPtr PkaPhPiDataParser::mcsp_polChemDef

This variable holds the polymer chemistry definition context in which this PkaPhPiDataParser instance exists.