libXpertMass Developer Documentation
  • libXpertMass
  • PolChemDef
  • PolChemDef Class

    class MsXpS::libXpertMass::PolChemDef

    The PolChemDef class provides a complete set of chemical entities fully qualifying a polymer chemistry definition, like Proteins, Saccharides or Nucleic acids. More...

    Header: #include <PolChemDef.hpp>

    Public Functions

    PolChemDef()
    PolChemDef(const PolChemDefSpec &pol_chem_def_spec)
    virtual ~PolChemDef()
    bool calculateDelimitedCodes()
    const QList<CleaveSpec *> &cleaveSpecList() const
    QList<CleaveSpec *> *cleaveSpecListPtr()
    int codeLength() const
    const QList<CrossLinker *> &crossLinkerList() const
    QList<CrossLinker *> *crossLinkerListPtr()
    QList<CrossLinkerSpec *> &crossLinkerSpecList() const
    QList<CrossLinkerSpec *> *crossLinkerSpecListPtr()
    QString deduceIsotopicDataFilePath() const
    const QString &delimitedCodes()
    QStringList *differenceBetweenMonomers(double threshold, MassType mass_type)
    QString *formatXmlDtd()
    const QList<FragSpec *> &fragSpecList() const
    QList<FragSpec *> *fragSpecListPtr()
    IsotopicDataCstSPtr getIsotopicDataCstSPtr() const
    QString getIsotopicDataFilePath() const
    IsotopicDataSPtr getIsotopicDataSPtr()
    QString getXmlDataDirPath() const
    QString getXmlDataFilePath() const
    const IonizeRule &ionizeRule() const
    IonizeRule *ionizeRulePtr()
    const Formula &leftCap() const
    const QList<Modif *> &modifList() const
    QList<Modif *> *modifListPtr()
    QList<ModifSpec *> &modifSpecList() const
    QList<ModifSpec *> *modifSpecListPtr()
    const QList<Monomer *> &monomerList() const
    QList<Monomer *> *monomerListPtr()
    QList<MonomerSpec *> &monomerSpecList() const
    QList<MonomerSpec *> *monomerSpecListPtr()
    QString name() const
    bool referenceCrossLinkerByName(const QString &name, CrossLinker *cross_linker_p = 0) const
    bool referenceModifByName(const QString &name, Modif *modification_p = 0) const
    const Formula &rightCap() const
    void setCodeLength(int code_length)
    void setIonizeRule(const IonizeRule &ionize_rule)
    void setIsotopicDataFilePath(const QString &file_path)
    void setIsotopicDataSPtr(IsotopicDataSPtr isotopic_data_sp)
    void setLeftCap(const Formula &formula)
    void setName(const QString &name)
    void setRightCap(const Formula &formula)
    void setXmlDataFilePath(const QString &file_path)
    bool writeXmlFile()

    Static Public Members

    std::size_t loadIsotopicData(PolChemDefSPtr pol_chem_def_sp, const QString &file_path = QString())
    bool renderXmlPolChemDefFile(PolChemDefSPtr pol_chem_def_sp)
    std::size_t writeIsotopicData(PolChemDefSPtr pol_chem_def_sp, const QString &file_path = QString())

    Protected Variables

    QList<CleaveSpec *> m_cleaveSpecList
    int m_codeLength
    QList<CrossLinker *> m_crossLinkerList
    QList<CrossLinkerSpec *> m_crossLinkerSpecList
    QString m_delimitedCodes
    QList<FragSpec *> m_fragSpecList
    IonizeRule m_ionizeRule
    QString m_isotopicDataFilePath
    Formula m_leftCap
    QList<Modif *> m_modifList
    QList<ModifSpec *> m_modifSpecList
    QList<Monomer *> m_monomerList
    QList<MonomerSpec *> m_monomerSpecList
    QString m_name
    Formula m_rightCap
    QString m_xmlDataFilePath
    QList<PolChemDef *> *mp_repositoryList
    IsotopicDataSPtr msp_isotopicData

    Detailed Description

    The PolChemDef class provides a full set of chemical entity definitions (Isotopes, Monomers, chemical Modifications, CrossLinks), chemical reaction models (in the liquid or gas phase, like Polymer cleavage: CleaveSpec or Oligomer fragmentation: FragSpec)

        ...

    Member Function Documentation

    PolChemDef::PolChemDef()

    Constructs a polymer chemistry definition.

    PolChemDef::PolChemDef(const PolChemDefSpec &pol_chem_def_spec)

    Constructs a polymer chemistry definition on the basis of pol_chem_def_spec.

    The pol_chem_def_spec polymer chemistry definition specification provides the name of the polymer chemistry definition and of the file that contains it.

    [virtual noexcept] PolChemDef::~PolChemDef()

    Destroys the polymer chemistry definition

    bool PolChemDef::calculateDelimitedCodes()

    Constructs a string with the codes of all the Monomers in this PolChemDef instance.

    The codes are delimited by the '@' character.

    Returns true.

    const QList<CleaveSpec *> &PolChemDef::cleaveSpecList() const

    Returns a const reference to the list of cleavage specifications.

    QList<CleaveSpec *> *PolChemDef::cleaveSpecListPtr()

    Returns a pointer to the list of cleavage specifications.

    int PolChemDef::codeLength() const

    Returns the code length.

    See also setCodeLength().

    const QList<CrossLinker *> &PolChemDef::crossLinkerList() const

    Returns a const reference to the list of cross-linkers.

    QList<CrossLinker *> *PolChemDef::crossLinkerListPtr()

    Returns a pointer to the list of cross-linkers.

    QList<CrossLinkerSpec *> &PolChemDef::crossLinkerSpecList() const

    Returns a const reference to the list of cross-linker specifications.

    QList<CrossLinkerSpec *> *PolChemDef::crossLinkerSpecListPtr()

    Returns a pointer to the list of cross-linker specifications.

    QString PolChemDef::deduceIsotopicDataFilePath() const

    Returns the path of the isotopic data file.

    The deduction is based on the fact that the file should have "isotopic-data.dat" as its name.

    const QString &PolChemDef::delimitedCodes()

    Returns a string with the codes of all the Monomers in this PolChemDef instance.

    The codes are delimited by the '@' character.

    QStringList *PolChemDef::differenceBetweenMonomers(double threshold, MassType mass_type)

    Returns a string list with the mass difference between all the Monomers in this PolChemDef instace.

    If the difference is below the threshold, the difference is added to the string list, otherwise it is skipped. The masses that are compared between every two monomers is of mass_type.

    QString *PolChemDef::formatXmlDtd()

    Returns a string with the XML DTD for a polymer chemistry definition file.

    const QList<FragSpec *> &PolChemDef::fragSpecList() const

    Returns a const reference to the list of fragmentation specifications.

    QList<FragSpec *> *PolChemDef::fragSpecListPtr()

    Returns a pointer to the list of fragmentation specifications.

    IsotopicDataCstSPtr PolChemDef::getIsotopicDataCstSPtr() const

    Returns the isotopic data as const shared pointer..

    QString PolChemDef::getIsotopicDataFilePath() const

    Returns the path of the isotopic data file.

    IsotopicDataSPtr PolChemDef::getIsotopicDataSPtr()

    Returns the isotopic data as non-const shared pointer..

    QString PolChemDef::getXmlDataDirPath() const

    Returns the absolute directory path of this PolChemDef instance.

    QString PolChemDef::getXmlDataFilePath() const

    Returns the file path of this PolChemDef instance.

    const IonizeRule &PolChemDef::ionizeRule() const

    Returns a const reference to the ionization rule.

    See also setIonizeRule().

    IonizeRule *PolChemDef::ionizeRulePtr()

    Returns a pointer to the ionization rule.

    const Formula &PolChemDef::leftCap() const

    Returns the left cap formula.

    See also setLeftCap().

    [static] std::size_t PolChemDef::loadIsotopicData(PolChemDefSPtr pol_chem_def_sp, const QString &file_path = QString())

    Loads the isotopic data stored in the file file_path.

    The data loaded from file are parsed and validated. Upon parsing of the file, the data are stored in the pol_chem_def_sp instance's isotopic data member.

    If file_path is empty, it is reconstructed using the directory of the polymer chemistry definition and the fact that the isotopic data file name is "isotopic-data.dat".

    Returns the count of parsed isotopes.

    const QList<Modif *> &PolChemDef::modifList() const

    Returns a const reference to the list of modifications.

    QList<Modif *> *PolChemDef::modifListPtr()

    Returns a pointer to the list of modifications.

    QList<ModifSpec *> &PolChemDef::modifSpecList() const

    Returns a const reference to the list of modification specifications.

    QList<ModifSpec *> *PolChemDef::modifSpecListPtr()

    Returns a pointer to the list of modification specifications.

    const QList<Monomer *> &PolChemDef::monomerList() const

    Returns a const reference to the list of monomers.

    QList<Monomer *> *PolChemDef::monomerListPtr()

    Returns a pointer to the list of monomers.

    QList<MonomerSpec *> &PolChemDef::monomerSpecList() const

    Returns a const reference to the list of monomer specifications.

    QList<MonomerSpec *> *PolChemDef::monomerSpecListPtr()

    Returns a pointer to the list of monomer specifications.

    QString PolChemDef::name() const

    Returns the name of this PolChemDef instance.

    See also setName().

    bool PolChemDef::referenceCrossLinkerByName(const QString &name, CrossLinker *cross_linker_p = 0) const

    Searches in the member list of cross-linkers a cross-linker by name.

    If the cross-linker object is found, and cross_linker_p is non-nullptr, it is copied in cross_linker_p.

    Returns true if the cross-linker was found, false otherwise.

    bool PolChemDef::referenceModifByName(const QString &name, Modif *modification_p = 0) const

    Searches in the member list of modifications a modification by name.

    If the modification object is found, and modification_p is non-nullptr, it is copied in modification_p.

    Returns true if the modification was found, false otherwise.

    [static] bool PolChemDef::renderXmlPolChemDefFile(PolChemDefSPtr pol_chem_def_sp)

    Parses the polymer chemistry definition file and updates pol_chem_def_sp accordingly.

    Upon parsing of the file and validation of the data, the pol_chem_def_sp is updated, essentially initializing it with the data from the file.

    Note that the pol_chem_def_sp should have a working set of isotopic data.

    Returns true if the parsing was successful and false otherwise.

    const Formula &PolChemDef::rightCap() const

    Returns the right cap formula.

    See also setRightCap().

    void PolChemDef::setCodeLength(int code_length)

    Sets the code_length.

    See also codeLength().

    void PolChemDef::setIonizeRule(const IonizeRule &ionize_rule)

    Sets the ionization rule to ionize_rule.

    See also ionizeRule().

    void PolChemDef::setIsotopicDataFilePath(const QString &file_path)

    Sets the path of the isotopic data file to file_path.

    void PolChemDef::setIsotopicDataSPtr(IsotopicDataSPtr isotopic_data_sp)

    Sets the isotopic data to isotopic_data_sp.

    void PolChemDef::setLeftCap(const Formula &formula)

    Sets the left cap formula.

    See also leftCap().

    void PolChemDef::setName(const QString &name)

    Sets the name of this PolChemDef instance.

    See also name().

    void PolChemDef::setRightCap(const Formula &formula)

    Sets the right cap formula.

    See also rightCap().

    void PolChemDef::setXmlDataFilePath(const QString &file_path)

    Sets the file_path of this PolChemDef instance.

    [static] std::size_t PolChemDef::writeIsotopicData(PolChemDefSPtr pol_chem_def_sp, const QString &file_path = QString())

    Writes the isotopic data in the pol_chem_def_sp PolChemDef instance to file file_path.

    Returns the count of isotopes written to file.

    bool PolChemDef::writeXmlFile()

    Writes the polymer chemistry definition to file.

    The file's name is from m_xmlDataFilePath.

    Returns true if successful, false otherwise.

    Member Variable Documentation

    QList<CleaveSpec *> PolChemDef::m_cleaveSpecList

    This variable holds the list of CleaveSpecs defining the various ways to cleave Polymer sequences of this PolChemDef instance.

    int PolChemDef::m_codeLength

    This variable holds the maximum length of a Monomer code in this defintion.

    The valid syntax of a Monomer code is that the first character of the code is uppercase and all the remaining ones are lowercase. The total number of characters cannot exceed m_codeLength.

    QList<CrossLinker *> PolChemDef::m_crossLinkerList

    The list of CrossLinkers defined to be part of this PolChemDef instance.

    QList<CrossLinkerSpec *> PolChemDef::m_crossLinkerSpecList

    This variable holds the list of CrossLinkerSpecs defining how CrossLinkers are represented in the graphical user interface.

    QString PolChemDef::m_delimitedCodes

    This variable holds the set of Monomer codes separated by '@' characters, like "@Ala@Tyr@Phe@".

    QList<FragSpec *> PolChemDef::m_fragSpecList

    This variable holds the list of FragSpecs defining the various ways to fragment Oligomer sequences of this PolChemDef instance.

    IonizeRule PolChemDef::m_ionizeRule

    This variable holds the ionization rule that governs the manner the Polymer sequences of this polymer chemistry definition are ionized by default.

    QString PolChemDef::m_isotopicDataFilePath

    This variable holds the path to the file that contains this polymer chemistry definition's isotopic data.

    Formula PolChemDef::m_leftCap

    This variable holds the Formula that defines how of the left end of a polymer sequence of this PolChemDef needs to be capped in order to finalize the polymerization state of the Polymer sequence.

    See also PolChemDef::m_rightCap.

    QList<Modif *> PolChemDef::m_modifList

    This variable holds the list of Modifs defined to be part of this PolChemDef instance.

    QList<ModifSpec *> PolChemDef::m_modifSpecList

    This variable holds the list of ModifSpecs defining how Modifs are represented in the graphical user interface.

    QList<Monomer *> PolChemDef::m_monomerList

    This variable holds the list of Monomers defined to be part of this PolChemDef instance.

    QList<MonomerSpec *> PolChemDef::m_monomerSpecList

    This variable holds the list of MonomerSpecs defining how Monomers are represented in the graphical user interface.

    QString PolChemDef::m_name

    This variable holds the name of the polymer chemistry definition, like protein-1-letter or nucac, for example.

    This name is typically identical to both the name of the directory where all the data defining this PolChemDef is stored and the name of the XML file that contains the definition itself.

    Formula PolChemDef::m_rightCap

    This variable holds the Formula that defines how of the right end of a polymer sequence of this PolChemDef needs to be capped in order to finalize the polymerization state of the Polymer sequence.

    See also PolChemDef::m_leftCap.

    QString PolChemDef::m_xmlDataFilePath

    This variable holds the path to the XML data file that contains the description of this polymer chemistry definition..

    QList<PolChemDef *> *PolChemDef::mp_repositoryList

    This variable holds the list of PolChemDef instances available in the repositories.

    IsotopicDataSPtr PolChemDef::msp_isotopicData

    This variable holds the isotopic data defining the fundamentals of this PolChemDef instance.