COPASI API
4.40.278
|
#include <CChemEqInterface.h>
Public Member Functions | |
void | addModifier (const std::string &name) |
CChemEqInterface () | |
void | clearAll () |
void | clearModifiers () |
bool | createNonExistingMetabs (std::vector< std::string > &createdKeys) |
std::pair< std::string, std::string > | displayNameToNamePair (CFunctionParameter::Role role, const std::string displayName) const |
bool | fromDataValue (const std::string &dataValue) |
std::string | getChemEqString (bool expanded) const |
const CCompartment * | getCompartment () const |
std::set< std::string > | getCompartments () const |
std::string | getDefaultCompartment () const |
const std::vector< std::string > & | getListOfCompartments (CFunctionParameter::Role role) const |
const std::vector< std::string > & | getListOfDisplayNames (CFunctionParameter::Role role) const |
const std::vector< C_FLOAT64 > & | getListOfMultiplicities (CFunctionParameter::Role role) const |
const std::vector< std::string > & | getListOfSpecies (CFunctionParameter::Role role) const |
size_t | getMolecularity (CFunctionParameter::Role role) const |
bool | getReversibility () const |
bool | init (const CChemEq &ce) |
bool | isMulticompartment () const |
std::set< std::pair< std::string, std::string > > | listOfNonExistingMetabNames () const |
std::set< std::string > | listOfNonUniqueMetabNames () const |
void | reverse () |
bool | setChemEqString (const std::string &ces) |
void | setReversibility (bool rev) |
std::string | toDataValue () const |
bool | writeToChemEq (CChemEq *pChemEq=NULL) const |
~CChemEqInterface () | |
Static Public Member Functions | |
static std::string | getChemEqString (const CReaction &rea, bool expanded) |
static bool | isValidEq (const std::string &eq) |
static bool | setChemEqFromString (CReaction &rea, const std::string &ces) |
Private Member Functions | |
void | buildDisplayNames () |
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 |
const CChemEq * | mpChemEq |
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.
CChemEqInterface::CChemEqInterface | ( | ) |
CChemEqInterface::~CChemEqInterface | ( | ) |
void CChemEqInterface::addModifier | ( | const std::string & | name | ) |
add a modifier to the chemical equation. It is only added if it is not already in there.
References CMetab::getCompartment(), CMetabNameInterface::getDisplayName(), CMetabNameInterface::getMetabolite(), CDataObject::getObjectName(), mModifierCompartments, mModifierDisplayNames, mModifierMult, mModifierNames, mpModel, quote(), and CMetabNameInterface::splitDisplayName().
Referenced by CReactionInterface::updateModifiersInChemEq().
|
private |
References CMetabNameInterface::getDisplayName(), mModifierCompartments, mModifierDisplayNames, mModifierNames, mpModel, mProductCompartments, mProductDisplayNames, mProductNames, mSubstrateCompartments, mSubstrateDisplayNames, and mSubstrateNames.
Referenced by createNonExistingMetabs(), init(), and setChemEqString().
void CChemEqInterface::clearAll | ( | ) |
References mModifierCompartments, mModifierDisplayNames, mModifierMult, mModifierNames, mProductCompartments, mProductDisplayNames, mProductMult, mProductNames, mSubstrateCompartments, mSubstrateDisplayNames, mSubstrateMult, and mSubstrateNames.
Referenced by CReactionInterface::clearChemEquation(), and init().
void CChemEqInterface::clearModifiers | ( | ) |
References mModifierCompartments, mModifierDisplayNames, mModifierMult, and mModifierNames.
Referenced by CReactionInterface::updateModifiersInChemEq().
|
private |
References CMetab::getCompartment(), CModel::getCompartments(), CMetabNameInterface::getMetabolite(), CDataObject::getObjectName(), CMetabNameInterface::isUnique(), mModifierCompartments, mModifierNames, mpModel, mProductCompartments, mProductNames, mSubstrateCompartments, mSubstrateNames, and CDataVector< CType >::size().
Referenced by setChemEqString().
bool CChemEqInterface::createNonExistingMetabs | ( | std::vector< std::string > & | createdKeys | ) |
creates all necessary metabolites (and volumes)
createdKeys | this vector will be filled with keys of created elements |
References buildDisplayNames(), C_INVALID_INDEX, CModel::createCompartment(), CModel::createMetabolite(), CModel::getCompartments(), CDataVectorN< CType >::getIndex(), CModelEntity::getKey(), CDataContainer::insert(), listOfNonExistingMetabNames(), mpModel, and CModelEntity::REACTIONS.
Referenced by CReactionInterface::createMetabolites().
std::pair< std::string, std::string > CChemEqInterface::displayNameToNamePair | ( | CFunctionParameter::Role | role, |
const std::string | displayName | ||
) | const |
References getListOfCompartments(), getListOfDisplayNames(), getListOfSpecies(), and CMetabNameInterface::unQuote().
Referenced by CReactionInterface::createUndoData().
bool CChemEqInterface::fromDataValue | ( | const std::string & | dataValue | ) |
References setChemEqString().
Referenced by CReaction::applyData().
std::string CChemEqInterface::getChemEqString | ( | bool | expanded | ) | const |
References mModifierDisplayNames, mModifierNames, mProductDisplayNames, mProductMult, mProductNames, mReversibility, mSubstrateDisplayNames, mSubstrateMult, mSubstrateNames, and writeElement().
Referenced by CReactionInterface::getChemEqString(), getChemEqString(), and CEFMTask::getReactionEquation().
|
static |
References CReaction::getChemEq(), getChemEqString(), and init().
const CCompartment * CChemEqInterface::getCompartment | ( | ) | const |
convenience method. If the reaction is single compartment the compartment is returned, else NULL.
References CMetab::getCompartment(), CChemEq::getProducts(), CChemEq::getSubstrates(), isMulticompartment(), CDataVector< CType >::size(), and writeToChemEq().
Referenced by CReactionInterface::connectNonMetabolites().
std::set< std::string > CChemEqInterface::getCompartments | ( | ) | const |
References mModifierCompartments, mProductCompartments, and mSubstrateCompartments.
std::string CChemEqInterface::getDefaultCompartment | ( | ) | const |
References mModifierCompartments, mProductCompartments, and mSubstrateCompartments.
Referenced by CReactionInterface::getDefaultScalingCompartment().
const std::vector< std::string > & CChemEqInterface::getListOfCompartments | ( | CFunctionParameter::Role | role | ) | const |
const std::vector< std::string > & CChemEqInterface::getListOfDisplayNames | ( | CFunctionParameter::Role | role | ) | const |
References fatalError, mModifierDisplayNames, CFunctionParameter::MODIFIER, mProductDisplayNames, mSubstrateDisplayNames, CFunctionParameter::PRODUCT, and CFunctionParameter::SUBSTRATE.
Referenced by CReactionInterface::connectFromScratch(), displayNameToNamePair(), CReactionInterface::findAndSetFunction(), CReactionInterface::getExpandedMetabList(), CReactionInterface::getListOfMetabs(), CReactionInterface::isLocked(), and CReactionInterface::setMapping().
const std::vector< C_FLOAT64 > & CChemEqInterface::getListOfMultiplicities | ( | CFunctionParameter::Role | role | ) | const |
References fatalError, mModifierMult, CFunctionParameter::MODIFIER, mProductMult, mSubstrateMult, CFunctionParameter::PRODUCT, and CFunctionParameter::SUBSTRATE.
Referenced by CReactionInterface::getExpandedMetabList().
const std::vector< std::string > & CChemEqInterface::getListOfSpecies | ( | CFunctionParameter::Role | role | ) | const |
References fatalError, mModifierNames, CFunctionParameter::MODIFIER, mProductNames, mSubstrateNames, CFunctionParameter::PRODUCT, and CFunctionParameter::SUBSTRATE.
Referenced by displayNameToNamePair().
size_t CChemEqInterface::getMolecularity | ( | CFunctionParameter::Role | role | ) | const |
bool CChemEqInterface::getReversibility | ( | ) | const |
References mReversibility.
Referenced by CReactionInterface::findAndSetFunction(), and CReactionInterface::isReversible().
bool CChemEqInterface::init | ( | const CChemEq & | ce | ) |
References buildDisplayNames(), clearAll(), CMetab::getCompartment(), CChemEq::getModifiers(), CDataObject::getObjectAncestor(), CDataObject::getObjectName(), CChemEq::getProducts(), CChemEq::getReversibility(), CChemEq::getSubstrates(), mModifierCompartments, mModifierMult, mModifierNames, mpChemEq, mpModel, mProductCompartments, mProductMult, mProductNames, mReversibility, mSubstrateCompartments, mSubstrateMult, mSubstrateNames, and CDataVector< CType >::size().
Referenced by CReaction::applyData(), CReaction::createUndoData(), getChemEqString(), CReactionInterface::init(), setChemEqFromString(), and CReaction::toData().
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
References mModifierCompartments, mProductCompartments, and mSubstrateCompartments.
Referenced by getCompartment(), and CReactionInterface::isMulticompartment().
|
static |
References CChemEqParserBase::yyparse().
std::set< std::pair< std::string, std::string > > CChemEqInterface::listOfNonExistingMetabNames | ( | ) | const |
References CMetabNameInterface::doesExist(), mModifierCompartments, mModifierNames, mpModel, mProductCompartments, mProductNames, mSubstrateCompartments, and mSubstrateNames.
Referenced by createNonExistingMetabs(), and CReactionInterface::createUndoData().
std::set< std::string > CChemEqInterface::listOfNonUniqueMetabNames | ( | ) | const |
References CMetabNameInterface::isUnique(), mModifierNames, mpModel, mProductNames, and mSubstrateNames.
void CChemEqInterface::reverse | ( | ) |
References mProductCompartments, mProductMult, mProductNames, mSubstrateCompartments, mSubstrateMult, and mSubstrateNames.
Referenced by CReactionInterface::reverse().
|
static |
References CReaction::getChemEq(), init(), setChemEqString(), and writeToChemEq().
Referenced by CReaction::load().
bool CChemEqInterface::setChemEqString | ( | const std::string & | ces | ) |
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 fromDataValue(), setChemEqFromString(), and CReactionInterface::setChemEqString().
void CChemEqInterface::setReversibility | ( | bool | rev | ) |
References mReversibility.
Referenced by CReactionInterface::reverse(), and CReactionInterface::setReversibility().
std::string CChemEqInterface::toDataValue | ( | ) | const |
References CMetabNameInterface::createUniqueDisplayName(), mModifierCompartments, mModifierNames, mProductCompartments, mProductMult, mProductNames, mReversibility, mSubstrateCompartments, mSubstrateMult, and mSubstrateNames.
Referenced by CReactionInterface::createUndoData(), CReaction::createUndoData(), and CReaction::toData().
|
staticprivate |
References C_INT32, and isNumber().
Referenced by getChemEqString().
bool CChemEqInterface::writeToChemEq | ( | CChemEq * | pChemEq = NULL | ) | const |
References CChemEq::addMetabolite(), CChemEq::cleanup(), CMetabNameInterface::getMetaboliteKey(), CDataObject::getObjectAncestor(), mModifierCompartments, mModifierMult, mModifierNames, CChemEq::MODIFIER, mpChemEq, mpModel, mProductCompartments, mProductMult, mProductNames, mReversibility, mSubstrateCompartments, mSubstrateMult, mSubstrateNames, CChemEq::PRODUCT, CChemEq::setReversibility(), and CChemEq::SUBSTRATE.
Referenced by CReaction::applyData(), getCompartment(), setChemEqFromString(), and CReactionInterface::writeBackToReaction().
|
private |
|
private |
Referenced by addModifier(), buildDisplayNames(), clearAll(), clearModifiers(), getChemEqString(), and getListOfDisplayNames().
|
private |
Referenced by addModifier(), clearAll(), clearModifiers(), getListOfMultiplicities(), getMolecularity(), init(), setChemEqString(), and writeToChemEq().
|
private |
|
private |
Referenced by init(), and writeToChemEq().
|
mutableprivate |
|
private |
|
private |
Referenced by buildDisplayNames(), clearAll(), getChemEqString(), and getListOfDisplayNames().
|
private |
Referenced by clearAll(), getChemEqString(), getListOfMultiplicities(), getMolecularity(), init(), reverse(), setChemEqString(), toDataValue(), and writeToChemEq().
|
private |
|
private |
Referenced by getChemEqString(), getReversibility(), init(), setChemEqString(), setReversibility(), toDataValue(), and writeToChemEq().
|
private |
|
private |
Referenced by buildDisplayNames(), clearAll(), getChemEqString(), and getListOfDisplayNames().
|
private |
Referenced by clearAll(), getChemEqString(), getListOfMultiplicities(), getMolecularity(), init(), reverse(), setChemEqString(), toDataValue(), and writeToChemEq().
|
private |