COPASI API
4.16.103
|
#include <CChemEqInterface.h>
Public Member Functions | |
void | addModifier (const std::string &name) |
CChemEqInterface (CModel *pModel) | |
void | clearModifiers () |
bool | createNonExistingMetabs () |
std::string | getChemEqString (bool expanded) const |
const CCompartment * | getCompartment () const |
const std::vector< std::string > & | getListOfDisplayNames (CFunctionParameter::Role role) const |
const std::vector< C_FLOAT64 > & | getListOfMultiplicities (CFunctionParameter::Role role) const |
size_t | getMolecularity (CFunctionParameter::Role role) const |
bool | getReversibility () const |
bool | isMulticompartment () const |
std::set< std::pair < std::string, std::string > > | listOfNonExistingMetabNames () const |
std::set< std::string > | listOfNonUniqueMetabNames () const |
bool | loadFromChemEq (const CChemEq &ce) |
void | reverse () |
bool | setChemEqString (const std::string &ces) |
void | setReversibility (bool rev) |
bool | writeToChemEq (CChemEq &ce) const |
~CChemEqInterface () | |
Static Public Member Functions | |
static std::string | getChemEqString (CModel *model, const CReaction &rea, bool expanded) |
static bool | isValidEq (const std::string &eq) |
static void | setChemEqFromString (CModel *model, CReaction &rea, const std::string &ces) |
Private Member Functions | |
void | buildDisplayNames () |
CChemEqInterface () | |
void | completeCompartments () |
Static Private Member Functions | |
static std::string | writeElement (const std::string &name, C_FLOAT64 mult, bool expanded) |
Private Attributes | |
std::vector< std::string > | mModifierCompartments |
std::vector< std::string > | mModifierDisplayNames |
std::vector< C_FLOAT64 > | mModifierMult |
std::vector< std::string > | mModifierNames |
CModel * | mpModel |
std::vector< std::string > | mProductCompartments |
std::vector< std::string > | mProductDisplayNames |
std::vector< C_FLOAT64 > | mProductMult |
std::vector< std::string > | mProductNames |
bool | mReversibility |
std::vector< std::string > | mSubstrateCompartments |
std::vector< std::string > | mSubstrateDisplayNames |
std::vector< C_FLOAT64 > | mSubstrateMult |
std::vector< std::string > | mSubstrateNames |
This class describes a chemical equation based on metabolite names It supports parsing and generating string representations. Note that this class handles only metab names without caring about whether these metabs exist in the model. There is however a method to create the missing metabs.
Definition at line 44 of file CChemEqInterface.h.
|
private |
Definition at line 28 of file CChemEqInterface.cpp.
CChemEqInterface::CChemEqInterface | ( | CModel * | pModel | ) |
Definition at line 45 of file CChemEqInterface.cpp.
CChemEqInterface::~CChemEqInterface | ( | ) |
Definition at line 62 of file CChemEqInterface.cpp.
void CChemEqInterface::addModifier | ( | const std::string & | name | ) |
add a modifier to the chemical equation. It is only added if it is not alreay in there.
Definition at line 466 of file CChemEqInterface.cpp.
References mModifierCompartments, mModifierDisplayNames, mModifierMult, mModifierNames, quote(), and CMetabNameInterface::splitDisplayName().
Referenced by CReactionInterface::updateModifiersInChemEq().
|
private |
Definition at line 356 of file CChemEqInterface.cpp.
References CMetabNameInterface::getDisplayName(), mModifierCompartments, mModifierDisplayNames, mModifierNames, mpModel, mProductCompartments, mProductDisplayNames, mProductNames, mSubstrateCompartments, mSubstrateDisplayNames, and mSubstrateNames.
Referenced by createNonExistingMetabs(), loadFromChemEq(), and setChemEqString().
void CChemEqInterface::clearModifiers | ( | ) |
Definition at line 488 of file CChemEqInterface.cpp.
References mModifierCompartments, mModifierDisplayNames, mModifierMult, and mModifierNames.
Referenced by CReactionInterface::updateModifiersInChemEq().
|
private |
Definition at line 141 of file CChemEqInterface.cpp.
References CMetab::getCompartment(), CModel::getCompartments(), CMetabNameInterface::getMetabolite(), CCopasiObject::getObjectName(), CMetabNameInterface::isUnique(), mModifierCompartments, mModifierNames, mpModel, mProductCompartments, mProductNames, mSubstrateCompartments, mSubstrateNames, and CCopasiVector< T >::size().
Referenced by setChemEqString().
bool CChemEqInterface::createNonExistingMetabs | ( | ) |
Definition at line 649 of file CChemEqInterface.cpp.
References buildDisplayNames(), C_INVALID_INDEX, CModel::createCompartment(), CModel::createMetabolite(), CModel::getCompartments(), CCopasiVectorN< CType >::getIndex(), listOfNonExistingMetabNames(), mpModel, and CModelEntity::REACTIONS.
Referenced by CReactionInterface::createMetabolites().
std::string CChemEqInterface::getChemEqString | ( | bool | expanded | ) | const |
Definition at line 65 of file CChemEqInterface.cpp.
References mModifierDisplayNames, mModifierNames, mProductDisplayNames, mProductMult, mProductNames, mReversibility, mSubstrateDisplayNames, mSubstrateMult, mSubstrateNames, and writeElement().
Referenced by CQReactionDM::data(), CQMergingData::fillTree(), CReactionInterface::getChemEqString(), getChemEqString(), CEFMTask::getReactionEquation(), StateSubwidget::loadReactions(), and CQSpeciesDetail::loadReactionTable().
|
static |
Definition at line 740 of file CChemEqInterface.cpp.
References CReaction::getChemEq(), getChemEqString(), and loadFromChemEq().
const CCompartment * CChemEqInterface::getCompartment | ( | ) | const |
convenience method. If the reaction is single compartment the compartment is returned, else NULL.
Definition at line 716 of file CChemEqInterface.cpp.
References CMetab::getCompartment(), CChemEq::getCompartmentNumber(), CChemEq::getProducts(), CChemEq::getSubstrates(), CCopasiVector< T >::size(), and writeToChemEq().
Referenced by CReactionInterface::connectNonMetabolites(), and CQCompartment::copy().
const std::vector< std::string > & CChemEqInterface::getListOfDisplayNames | ( | CFunctionParameter::Role | role | ) | const |
Definition at line 456 of file CChemEqInterface.cpp.
References fatalError, mModifierDisplayNames, CFunctionParameter::MODIFIER, mProductDisplayNames, mSubstrateDisplayNames, CFunctionParameter::PRODUCT, and CFunctionParameter::SUBSTRATE.
Referenced by CReactionInterface::findAndSetFunction(), CReactionInterface::getExpandedMetabList(), CReactionInterface::getListOfMetabs(), CReactionInterface::isLocked(), and CReactionInterface::setMapping().
const std::vector< C_FLOAT64 > & CChemEqInterface::getListOfMultiplicities | ( | CFunctionParameter::Role | role | ) | const |
Definition at line 446 of file CChemEqInterface.cpp.
References fatalError, mModifierMult, CFunctionParameter::MODIFIER, mProductMult, mSubstrateMult, CFunctionParameter::PRODUCT, and CFunctionParameter::SUBSTRATE.
Referenced by CReactionInterface::getExpandedMetabList().
size_t CChemEqInterface::getMolecularity | ( | CFunctionParameter::Role | role | ) | const |
Definition at line 537 of file CChemEqInterface.cpp.
References C_INVALID_INDEX, fatalError, mModifierMult, CFunctionParameter::MODIFIER, mProductMult, mSubstrateMult, CFunctionParameter::PRODUCT, and CFunctionParameter::SUBSTRATE.
Referenced by CReactionInterface::getListOfPossibleFunctions(), and ParameterTable::updateTable().
|
inline |
Definition at line 90 of file CChemEqInterface.h.
References mReversibility.
Referenced by CReactionInterface::findAndSetFunction(), and CReactionInterface::isReversible().
bool CChemEqInterface::isMulticompartment | ( | ) | const |
this method tries to find out if the chemical equation involves several compartments in a given model. It only takes into account the metabs that actually exist in the model. A non existing metabolite is assumed not to be in a different compartment
Definition at line 675 of file CChemEqInterface.cpp.
References mModifierCompartments, mProductCompartments, and mSubstrateCompartments.
Referenced by CReactionInterface::isMulticompartment().
|
static |
Definition at line 756 of file CChemEqInterface.cpp.
References CChemEqParserBase::yyparse().
Referenced by CQReactionDM::setEquation(), ReactionsWidget1::slotLineEditChanged(), and ChemEqValidator::validate().
std::set< std::pair< std::string, std::string > > CChemEqInterface::listOfNonExistingMetabNames | ( | ) | const |
Definition at line 609 of file CChemEqInterface.cpp.
References CMetabNameInterface::doesExist(), mModifierCompartments, mModifierNames, mpModel, mProductCompartments, mProductNames, mSubstrateCompartments, and mSubstrateNames.
Referenced by createNonExistingMetabs().
std::set< std::string > CChemEqInterface::listOfNonUniqueMetabNames | ( | ) | const |
Definition at line 582 of file CChemEqInterface.cpp.
References CMetabNameInterface::isUnique(), mModifierNames, mpModel, mProductNames, and mSubstrateNames.
bool CChemEqInterface::loadFromChemEq | ( | const CChemEq & | ce | ) |
Definition at line 304 of file CChemEqInterface.cpp.
References buildDisplayNames(), CChemEq::getModifiers(), CChemEq::getProducts(), CChemEq::getReversibility(), CChemEq::getSubstrates(), mModifierCompartments, mModifierMult, mModifierNames, mProductCompartments, mProductMult, mProductNames, mReversibility, mSubstrateCompartments, mSubstrateMult, mSubstrateNames, and CCopasiVector< T >::size().
Referenced by getChemEqString(), and CReactionInterface::initFromReaction().
void CChemEqInterface::reverse | ( | ) |
Definition at line 563 of file CChemEqInterface.cpp.
References mProductCompartments, mProductMult, mProductNames, mSubstrateCompartments, mSubstrateMult, and mSubstrateNames.
Referenced by CReactionInterface::reverse().
|
static |
Definition at line 748 of file CChemEqInterface.cpp.
References CReaction::getChemEq(), setChemEqString(), and writeToChemEq().
Referenced by CReaction::load().
bool CChemEqInterface::setChemEqString | ( | const std::string & | ces | ) |
Definition at line 109 of file CChemEqInterface.cpp.
References buildDisplayNames(), completeCompartments(), CChemEqParserBase::getModifierCompartments(), CChemEqParserBase::getModifierMulitplicities(), CChemEqParserBase::getModifierNames(), CChemEqParserBase::getProductCompartments(), CChemEqParserBase::getProductMulitplicities(), CChemEqParserBase::getProductNames(), CChemEqParserBase::getSubstrateCompartments(), CChemEqParserBase::getSubstrateMulitplicities(), CChemEqParserBase::getSubstrateNames(), CChemEqParserBase::isReversible(), mModifierCompartments, mModifierMult, mModifierNames, mProductCompartments, mProductMult, mProductNames, mReversibility, mSubstrateCompartments, mSubstrateMult, mSubstrateNames, and CChemEqParserBase::yyparse().
Referenced by setChemEqFromString(), and CReactionInterface::setChemEqString().
|
inline |
Definition at line 91 of file CChemEqInterface.h.
References mReversibility.
Referenced by CReactionInterface::reverse(), and CReactionInterface::setReversibility().
|
staticprivate |
Definition at line 496 of file CChemEqInterface.cpp.
References C_INT32, and isNumber().
Referenced by getChemEqString().
bool CChemEqInterface::writeToChemEq | ( | CChemEq & | ce | ) | const |
Definition at line 397 of file CChemEqInterface.cpp.
References CChemEq::addMetabolite(), CChemEq::cleanup(), CMetabNameInterface::getMetaboliteKey(), mModifierCompartments, mModifierMult, mModifierNames, CChemEq::MODIFIER, mpModel, mProductCompartments, mProductMult, mProductNames, mReversibility, mSubstrateCompartments, mSubstrateMult, mSubstrateNames, CChemEq::PRODUCT, CChemEq::setReversibility(), and CChemEq::SUBSTRATE.
Referenced by getCompartment(), setChemEqFromString(), and CReactionInterface::writeBackToReaction().
|
private |
Definition at line 59 of file CChemEqInterface.h.
Referenced by addModifier(), buildDisplayNames(), clearModifiers(), completeCompartments(), isMulticompartment(), listOfNonExistingMetabNames(), loadFromChemEq(), setChemEqString(), and writeToChemEq().
|
private |
Definition at line 63 of file CChemEqInterface.h.
Referenced by addModifier(), buildDisplayNames(), clearModifiers(), getChemEqString(), and getListOfDisplayNames().
|
private |
Definition at line 55 of file CChemEqInterface.h.
Referenced by addModifier(), clearModifiers(), getListOfMultiplicities(), getMolecularity(), loadFromChemEq(), setChemEqString(), and writeToChemEq().
|
private |
Definition at line 51 of file CChemEqInterface.h.
Referenced by addModifier(), buildDisplayNames(), clearModifiers(), completeCompartments(), getChemEqString(), listOfNonExistingMetabNames(), listOfNonUniqueMetabNames(), loadFromChemEq(), setChemEqString(), and writeToChemEq().
|
private |
Definition at line 47 of file CChemEqInterface.h.
Referenced by buildDisplayNames(), completeCompartments(), createNonExistingMetabs(), listOfNonExistingMetabNames(), listOfNonUniqueMetabNames(), and writeToChemEq().
|
private |
Definition at line 58 of file CChemEqInterface.h.
Referenced by buildDisplayNames(), completeCompartments(), isMulticompartment(), listOfNonExistingMetabNames(), loadFromChemEq(), reverse(), setChemEqString(), and writeToChemEq().
|
private |
Definition at line 62 of file CChemEqInterface.h.
Referenced by buildDisplayNames(), getChemEqString(), and getListOfDisplayNames().
|
private |
Definition at line 54 of file CChemEqInterface.h.
Referenced by getChemEqString(), getListOfMultiplicities(), getMolecularity(), loadFromChemEq(), reverse(), setChemEqString(), and writeToChemEq().
|
private |
Definition at line 50 of file CChemEqInterface.h.
Referenced by buildDisplayNames(), completeCompartments(), getChemEqString(), listOfNonExistingMetabNames(), listOfNonUniqueMetabNames(), loadFromChemEq(), reverse(), setChemEqString(), and writeToChemEq().
|
private |
Definition at line 65 of file CChemEqInterface.h.
Referenced by getChemEqString(), getReversibility(), loadFromChemEq(), setChemEqString(), setReversibility(), and writeToChemEq().
|
private |
Definition at line 57 of file CChemEqInterface.h.
Referenced by buildDisplayNames(), completeCompartments(), isMulticompartment(), listOfNonExistingMetabNames(), loadFromChemEq(), reverse(), setChemEqString(), and writeToChemEq().
|
private |
Definition at line 61 of file CChemEqInterface.h.
Referenced by buildDisplayNames(), getChemEqString(), and getListOfDisplayNames().
|
private |
Definition at line 53 of file CChemEqInterface.h.
Referenced by getChemEqString(), getListOfMultiplicities(), getMolecularity(), loadFromChemEq(), reverse(), setChemEqString(), and writeToChemEq().
|
private |
Definition at line 49 of file CChemEqInterface.h.
Referenced by buildDisplayNames(), completeCompartments(), getChemEqString(), listOfNonExistingMetabNames(), listOfNonUniqueMetabNames(), loadFromChemEq(), reverse(), setChemEqString(), and writeToChemEq().