COPASI API
4.16.103
|
#include <CChemEq.h>
Public Types | |
enum | MetaboliteRole { PRODUCT = 0, SUBSTRATE, MODIFIER, NOROLE } |
![]() | |
typedef std::multimap < std::string, CCopasiObject * > | objectMap |
![]() | |
typedef std::set< const CCopasiObject * > | DataObjectSet |
typedef std::vector< Refresh * > | DataUpdateSequence |
![]() | |
typedef std::set< const CObjectInterface * > | ObjectSet |
typedef std::vector < CObjectInterface * > | UpdateSequence |
Public Member Functions | |
bool | addMetabolite (const std::string &key, const C_FLOAT64 multiplicity, const MetaboliteRole &role) |
CChemEq (const std::string &name="NoName", const CCopasiContainer *pParent=NULL) | |
CChemEq (const CChemEq &src, const CCopasiContainer *pParent=NULL) | |
void | cleanup () |
const CCopasiVector < CChemEqElement > & | getBalances () const |
size_t | getCompartmentNumber () const |
std::set< const CCompartment * > | getCompartments () const |
const CCompartment * | getLargestCompartment () const |
const CCopasiVector < CChemEqElement > & | getModifiers () const |
size_t | getMolecularity (const MetaboliteRole role) const |
const CCopasiVector < CChemEqElement > & | getProducts () const |
const bool & | getReversibility () const |
const CCopasiVector < CChemEqElement > & | getSubstrates () const |
bool | setMultiplicity (const CMetab *pMetab, C_FLOAT64 newMult, MetaboliteRole role) |
void | setReversibility (const bool &reversible) |
virtual | ~CChemEq () |
![]() | |
virtual bool | add (CCopasiObject *pObject, const bool &adopt=true) |
CCopasiContainer (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=CCopasiObject::Container) | |
CCopasiContainer (const CCopasiContainer &src, const CCopasiContainer *pParent=NULL) | |
virtual std::string | getChildObjectUnits (const CCopasiObject *pObject) const |
virtual const CObjectInterface * | getObject (const CCopasiObjectName &cn) const |
virtual const objectMap & | getObjects () const |
virtual std::string | getUnits () const |
virtual const CCopasiObject * | getValueObject () const |
virtual bool | remove (CCopasiObject *pObject) |
virtual | ~CCopasiContainer () |
![]() | |
void | addDirectDependency (const CCopasiObject *pObject) |
CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL) | |
void | clearDirectDependencies () |
void | clearRefresh () |
bool | dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const |
void | getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const |
virtual CCopasiObjectName | getCN () const |
virtual const DataObjectSet & | getDirectDependencies (const DataObjectSet &context=DataObjectSet()) const |
virtual const std::string & | getKey () const |
CCopasiContainer * | getObjectAncestor (const std::string &type) const |
CCopasiDataModel * | getObjectDataModel () |
const CCopasiDataModel * | getObjectDataModel () const |
virtual std::string | getObjectDisplayName (bool regular=true, bool richtext=false) const |
const std::string & | getObjectName () const |
CCopasiContainer * | getObjectParent () const |
const std::string & | getObjectType () const |
virtual const CObjectInterface::ObjectSet & | getPrerequisites () const |
virtual Refresh * | getRefresh () const |
UpdateMethod * | getUpdateMethod () const |
virtual void * | getValuePointer () const |
bool | hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const |
bool | hasUpdateMethod () const |
bool | isArray () const |
bool | isContainer () const |
bool | isDataModel () const |
bool | isMatrix () const |
bool | isNameVector () const |
bool | isNonUniqueName () const |
virtual bool | isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const |
bool | isReference () const |
bool | isRoot () const |
bool | isSeparator () const |
bool | isStaticString () const |
bool | isValueBool () const |
bool | isValueDbl () const |
bool | isValueInt () const |
bool | isValueInt64 () const |
bool | isValueString () const |
bool | isVector () const |
virtual bool | mustBeDeleted (const DataObjectSet &deletedObjects) const |
virtual void | print (std::ostream *ostream) const |
void | removeDirectDependency (const CCopasiObject *pObject) |
void | setDirectDependencies (const DataObjectSet &directDependencies) |
bool | setObjectName (const std::string &name) |
virtual bool | setObjectParent (const CCopasiContainer *pParent) |
void | setObjectValue (const C_FLOAT64 &value) |
void | setObjectValue (const C_INT32 &value) |
void | setObjectValue (const bool &value) |
template<class CType > | |
void | setRefresh (CType *pType, void(CType::*method)(void)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const bool &)) |
virtual | ~CCopasiObject () |
![]() | |
CObjectInterface () | |
virtual | ~CObjectInterface () |
Private Member Functions | |
void | addElement (CCopasiVector< CChemEqElement > &structure, const CChemEqElement &element, CChemEq::MetaboliteRole role=CChemEq::PRODUCT) |
Private Attributes | |
CCopasiVector< CChemEqElement > | mBalances |
CCopasiVector< CChemEqElement > | mModifiers |
CCopasiVector< CChemEqElement > | mProducts |
bool | mReversible |
CCopasiVector< CChemEqElement > | mSubstrates |
Friends | |
std::ostream & | operator<< (std::ostream &os, const CChemEq &d) |
Additional Inherited Members | |
![]() | |
static std::vector< Refresh * > | buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet()) |
static void | setRenameHandler (CRenameHandler *rh) |
![]() | |
static const std::vector < CCopasiContainer * > | EmptyList |
![]() | |
enum | Flag { Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8, Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80, ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800, Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000, Root = 0x10000, Gui = 0x20000 } |
![]() | |
template<class CType > | |
CCopasiObject * | addMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0) |
template<class CType > | |
CCopasiObject * | addObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0) |
template<class CType > | |
CCopasiObject * | addVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0) |
void | initObjects () |
![]() | |
CCopasiObject () | |
CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0) | |
![]() | |
objectMap | mObjects |
![]() | |
static CRenameHandler * | smpRenameHandler = NULL |
Enumerator | |
---|---|
PRODUCT | |
SUBSTRATE | |
MODIFIER | |
NOROLE |
CChemEq::CChemEq | ( | const std::string & | name = "NoName" , |
const CCopasiContainer * | pParent = NULL |
||
) |
Default constructor
const | std::string & name (default: "NoName") |
const | CCopasiContainer * pParent (default: NULL) |
Definition at line 30 of file CChemEq.cpp.
References CONSTRUCTOR_TRACE.
CChemEq::CChemEq | ( | const CChemEq & | src, |
const CCopasiContainer * | pParent = NULL |
||
) |
Copy constructor
const CChemEq & | src |
const | CCopasiContainer * pParent (default: NULL) |
Definition at line 40 of file CChemEq.cpp.
References CONSTRUCTOR_TRACE.
|
virtual |
|
private |
Adds an element to the vector given by structure. The element is either SUBSTRATE or PRODUCT.
CCopasiVector < CChemEqElement > & | structure |
const CChemEqElement & | element |
CChemEq::MetaboliteRole | role ( |
Definition at line 180 of file CChemEq.cpp.
References CCopasiVector< T >::add(), CChemEqElement::getMetaboliteKey(), CChemEqElement::getMultiplicity(), CChemEqElement::setMultiplicity(), CCopasiVector< T >::size(), and SUBSTRATE.
Referenced by addMetabolite(), and setMultiplicity().
bool CChemEq::addMetabolite | ( | const std::string & | key, |
const C_FLOAT64 | multiplicity, | ||
const MetaboliteRole & | role | ||
) |
Add a species to the equation
const | std::string & speciesKey |
const | C_FLOAT64 & multiplicity |
const | MetaboliteRole & role |
Definition at line 80 of file CChemEq.cpp.
References addElement(), fatalError, mBalances, mModifiers, MODIFIER, mProducts, mSubstrates, PRODUCT, CChemEqElement::setMetabolite(), CChemEqElement::setMultiplicity(), and SUBSTRATE.
Referenced by CReaction::addModifier(), CReaction::addProduct(), CReaction::addSubstrate(), SBMLImporter::applyStoichiometricExpressions(), SBMLImporter::isMassActionExpression(), CReaction::loadOneRole(), and CChemEqInterface::writeToChemEq().
void CChemEq::cleanup | ( | ) |
Cleanup
Definition at line 52 of file CChemEq.cpp.
References CCopasiVector< T >::cleanup(), mBalances, mModifiers, mProducts, and mSubstrates.
Referenced by CChemEqInterface::writeToChemEq(), and ~CChemEq().
const CCopasiVector< CChemEqElement > & CChemEq::getBalances | ( | ) | const |
Retrieves the vector of metabolites and their total balance in the chemical reaction.
Definition at line 69 of file CChemEq.cpp.
References mBalances.
Referenced by CMathReaction::initialize(), and CMMLOutput::writeRHS().
size_t CChemEq::getCompartmentNumber | ( | ) | const |
Returns the number of compartments the chemical equation is associated with.
Definition at line 110 of file CChemEq.cpp.
References getCompartments().
Referenced by CChemEqInterface::getCompartment(), CReaction::getCompartmentNumber(), test000091::test_delay_in_kinetic_law(), test000091::test_delay_in_kinetic_law_local_parameter(), test000033::test_hasOnlySubstanceUnits(), test000022::test_hasOnlySubstanceUnits(), test000043::test_hasOnlySubstanceUnits(), test000026::test_hasOnlySubstanceUnits(), test000041::test_hasOnlySubstanceUnits(), test000040::test_hasOnlySubstanceUnits(), test000039::test_hasOnlySubstanceUnits(), test000038::test_hasOnlySubstanceUnits(), test000037::test_hasOnlySubstanceUnits(), test000036::test_hasOnlySubstanceUnits(), test000034::test_hasOnlySubstanceUnits(), test000035::test_hasOnlySubstanceUnits(), test000021::test_hasOnlySubstanceUnits(), test000025::test_hasOnlySubstanceUnits(), test000031::test_hasOnlySubstanceUnits(), test000042::test_hasOnlySubstanceUnits(), test000029::test_hasOnlySubstanceUnits(), test000028::test_hasOnlySubstanceUnits(), test000027::test_hasOnlySubstanceUnits(), test000023::test_hasOnlySubstanceUnits(), test000032::test_hasOnlySubstanceUnits(), test000030::test_hasOnlySubstanceUnits(), test000024::test_hasOnlySubstanceUnits(), test000045::test_stoichiometricExpression(), test000044::test_stoichiometricExpression(), and test000046::test_stoichiometricExpression().
std::set< const CCompartment * > CChemEq::getCompartments | ( | ) | const |
Retrieves a set of the compartments.
Definition at line 115 of file CChemEq.cpp.
References CCopasiVector< T >::begin(), CCopasiVector< T >::end(), and mBalances.
Referenced by CMathObject::compileFlux(), and getCompartmentNumber().
const CCompartment * CChemEq::getLargestCompartment | ( | ) | const |
Retrieve the largest compartment that the reaction touches. This is time dependent it can only be called after update initial values has been called. Note for an empty reaction a NULL pointer is returned.
Definition at line 137 of file CChemEq.cpp.
References C_FLOAT64, C_INVALID_INDEX, mProducts, mSubstrates, and CCopasiVector< T >::size().
Referenced by CReaction::getLargestCompartment().
const CCopasiVector< CChemEqElement > & CChemEq::getModifiers | ( | ) | const |
Retrieves the vector of Modifiers and their multiplicity
Definition at line 66 of file CChemEq.cpp.
References mModifiers.
Referenced by CModelAdd::addReactions(), CModelAnalyzer::checkReaction(), CReaction::compile(), ReactionsWidget1::copy(), SBMLImporter::createCReactionFromReaction(), CSBMLExporter::createReaction(), CLayoutInitializer::createReactionGlyph(), SBMLImporter::doMapping(), CModelExpansion::duplicateReaction(), CChemEqInterface::loadFromChemEq(), CModelMerging::mergeMetabolites(), CReaction::object2variable(), CModelAdd::reactionInvolvesCompartment(), CModelExpansion::replaceInReaction(), CCopasiXML::saveModel(), SBMLImporter::setCorrectUsage(), CLLayoutRenderer::setDeduceSpeciesReferenceRoles(), test000091::test_delay_in_kinetic_law(), test000091::test_delay_in_kinetic_law_local_parameter(), test000031::test_hasOnlySubstanceUnits(), test000029::test_hasOnlySubstanceUnits(), test000028::test_hasOnlySubstanceUnits(), test000027::test_hasOnlySubstanceUnits(), test000035::test_hasOnlySubstanceUnits(), test000039::test_hasOnlySubstanceUnits(), test000034::test_hasOnlySubstanceUnits(), test000023::test_hasOnlySubstanceUnits(), test000042::test_hasOnlySubstanceUnits(), test000021::test_hasOnlySubstanceUnits(), test000036::test_hasOnlySubstanceUnits(), test000037::test_hasOnlySubstanceUnits(), test000025::test_hasOnlySubstanceUnits(), test000024::test_hasOnlySubstanceUnits(), test000030::test_hasOnlySubstanceUnits(), test000041::test_hasOnlySubstanceUnits(), test000026::test_hasOnlySubstanceUnits(), test000033::test_hasOnlySubstanceUnits(), test000032::test_hasOnlySubstanceUnits(), test000022::test_hasOnlySubstanceUnits(), test000038::test_hasOnlySubstanceUnits(), test000043::test_hasOnlySubstanceUnits(), test000040::test_hasOnlySubstanceUnits(), test000045::test_stoichiometricExpression(), test000044::test_stoichiometricExpression(), test000046::test_stoichiometricExpression(), and CLLayoutRenderer::update_associations().
size_t CChemEq::getMolecularity | ( | const MetaboliteRole | role | ) | const |
Checks if it is possible to figure out a compartment from the information in the chemical equation. If there are substrates and if all the substrates are in the same compartment this compartment will be returned. If there are no substrates and there are Products and all Products are in the same compartment this compartment will be returned, else an exception will be thrown. This returns the sum of the multiplicities
Definition at line 210 of file CChemEq.cpp.
References fatalError, mModifiers, MODIFIER, mProducts, mSubstrates, PRODUCT, CCopasiVector< T >::size(), and SUBSTRATE.
Referenced by CFindDimensions::setChemicalEquation().
const CCopasiVector< CChemEqElement > & CChemEq::getProducts | ( | ) | const |
Retrieves the vector of products and their multiplicity in the chemical reaction.
Definition at line 63 of file CChemEq.cpp.
References mProducts.
Referenced by CModelAdd::addReactions(), CModelAnalyzer::checkReaction(), CReaction::compile(), CModel::convert2NonReversible(), ReactionsWidget1::copy(), SBMLImporter::createCReactionFromReaction(), CSBMLExporter::createKineticLaw(), CSBMLExporter::createReaction(), CLayoutInitializer::createReactionGlyph(), SBMLImporter::doMapping(), CModelExpansion::duplicateReaction(), CODEExporter::exportKineticFunction(), SBMLImporter::findCorrespondingFunction(), CChemEqInterface::getCompartment(), CEFMTask::getNetReactionData(), CEFMTask::getSpeciesChanges(), is_mass_action(), SBMLImporter::isMassActionExpression(), CODEExporterC::KineticFunction2ODEmember(), CChemEqInterface::loadFromChemEq(), CModelMerging::mergeMetabolites(), CReaction::object2variable(), CModelAdd::reactionInvolvesCompartment(), CModelExpansion::replaceInReaction(), CCopasiXML::saveModel(), SBMLImporter::setCorrectUsage(), CLLayoutRenderer::setDeduceSpeciesReferenceRoles(), CReaction::setScalingFactor(), test000091::test_delay_in_kinetic_law(), test000091::test_delay_in_kinetic_law_local_parameter(), test000029::test_hasOnlySubstanceUnits(), test000021::test_hasOnlySubstanceUnits(), test000022::test_hasOnlySubstanceUnits(), test000034::test_hasOnlySubstanceUnits(), test000023::test_hasOnlySubstanceUnits(), test000037::test_hasOnlySubstanceUnits(), test000043::test_hasOnlySubstanceUnits(), test000041::test_hasOnlySubstanceUnits(), test000035::test_hasOnlySubstanceUnits(), test000033::test_hasOnlySubstanceUnits(), test000039::test_hasOnlySubstanceUnits(), test000031::test_hasOnlySubstanceUnits(), test000038::test_hasOnlySubstanceUnits(), test000032::test_hasOnlySubstanceUnits(), test000025::test_hasOnlySubstanceUnits(), test000036::test_hasOnlySubstanceUnits(), test000027::test_hasOnlySubstanceUnits(), test000042::test_hasOnlySubstanceUnits(), test000028::test_hasOnlySubstanceUnits(), test000030::test_hasOnlySubstanceUnits(), test000026::test_hasOnlySubstanceUnits(), test000024::test_hasOnlySubstanceUnits(), test000040::test_hasOnlySubstanceUnits(), test000045::test_stoichiometricExpression(), test000044::test_stoichiometricExpression(), test000046::test_stoichiometricExpression(), and CLLayoutRenderer::update_associations().
const bool & CChemEq::getReversibility | ( | ) | const |
Retrieve the reversibility of the equation
Definition at line 77 of file CChemEq.cpp.
References mReversible.
Referenced by SBMLImporter::doMapping(), is_mass_action(), SBMLImporter::isMassActionExpression(), CReaction::isReversible(), and CChemEqInterface::loadFromChemEq().
const CCopasiVector< CChemEqElement > & CChemEq::getSubstrates | ( | ) | const |
Retrieves the vector of substrates and their multiplicity in the chemical reaction.
Definition at line 60 of file CChemEq.cpp.
References mSubstrates.
Referenced by CModelAdd::addReactions(), SBMLImporter::applyStoichiometricExpressions(), CModelAnalyzer::checkReaction(), CReaction::compile(), CMathObject::compilePropensity(), CModel::convert2NonReversible(), ReactionsWidget1::copy(), SBMLImporter::createCReactionFromReaction(), CSBMLExporter::createKineticLaw(), CSBMLExporter::createReaction(), CLayoutInitializer::createReactionGlyph(), SBMLImporter::doMapping(), CModelExpansion::duplicateReaction(), CODEExporter::exportKineticFunction(), SBMLImporter::findCorrespondingFunction(), CChemEqInterface::getCompartment(), CEFMTask::getNetReactionData(), CEFMTask::getSpeciesChanges(), is_mass_action(), SBMLImporter::isMassActionExpression(), CODEExporterC::KineticFunction2ODEmember(), CChemEqInterface::loadFromChemEq(), CModelMerging::mergeMetabolites(), CReaction::object2variable(), CModelAdd::reactionInvolvesCompartment(), CModelExpansion::replaceInReaction(), CCopasiXML::saveModel(), SBMLImporter::setCorrectUsage(), CLLayoutRenderer::setDeduceSpeciesReferenceRoles(), CReaction::setScalingFactor(), test000091::test_delay_in_kinetic_law(), test000091::test_delay_in_kinetic_law_local_parameter(), test000034::test_hasOnlySubstanceUnits(), test000028::test_hasOnlySubstanceUnits(), test000042::test_hasOnlySubstanceUnits(), test000043::test_hasOnlySubstanceUnits(), test000021::test_hasOnlySubstanceUnits(), test000035::test_hasOnlySubstanceUnits(), test000022::test_hasOnlySubstanceUnits(), test000040::test_hasOnlySubstanceUnits(), test000029::test_hasOnlySubstanceUnits(), test000036::test_hasOnlySubstanceUnits(), test000039::test_hasOnlySubstanceUnits(), test000031::test_hasOnlySubstanceUnits(), test000032::test_hasOnlySubstanceUnits(), test000041::test_hasOnlySubstanceUnits(), test000030::test_hasOnlySubstanceUnits(), test000024::test_hasOnlySubstanceUnits(), test000037::test_hasOnlySubstanceUnits(), test000033::test_hasOnlySubstanceUnits(), test000026::test_hasOnlySubstanceUnits(), test000027::test_hasOnlySubstanceUnits(), test000038::test_hasOnlySubstanceUnits(), test000023::test_hasOnlySubstanceUnits(), test000025::test_hasOnlySubstanceUnits(), test000044::test_stoichiometricExpression(), test000045::test_stoichiometricExpression(), test000046::test_stoichiometricExpression(), and CLLayoutRenderer::update_associations().
bool CChemEq::setMultiplicity | ( | const CMetab * | pMetab, |
C_FLOAT64 | newMult, | ||
MetaboliteRole | role | ||
) |
Sets the stoichiometry of the chemical element that corresponds to the given metabolite and role to the new value. The role has to be either CChemEqElement::SUBSTRATE or CChemEqElement::PRODUCT. If the role is invalid, the multiplicity is negative or zero or if the element for the metabolite and role can not be found in the chemical equation, false is returned and nothing is changed.
Sets the stoichiometry of the chemical element that corresponds to the given metabolite and role to the new value. The role has to be either CChemEqElement::SUBSTRATE or CChemEqElement::PRODUCT. If the role is invalid, the multiplicity if negative or if the element for the metabolite and role can not be found in the chemical equation, false is returned and nothing is changed.
Definition at line 268 of file CChemEq.cpp.
References addElement(), CCopasiVector< T >::begin(), C_FLOAT64, CCopasiVector< T >::end(), CModelEntity::getKey(), mBalances, mProducts, mSubstrates, PRODUCT, CChemEqElement::setMultiplicity(), and SUBSTRATE.
void CChemEq::setReversibility | ( | const bool & | reversible | ) |
Set the reversibility of the of the equation
const | bool & const bool & reversible |
Definition at line 72 of file CChemEq.cpp.
References mReversible.
Referenced by CReaction::load(), CReaction::setReversible(), and CChemEqInterface::writeToChemEq().
|
friend |
Friend declaration for ostream operator
std::ostream | & os |
const | CChemEq & d |
Definition at line 242 of file CChemEq.cpp.
|
private |
A vector of metabolites and their total balance in the chemical reaction 0..* Stoichiometry
Definition at line 216 of file CChemEq.h.
Referenced by addMetabolite(), cleanup(), getBalances(), getCompartments(), operator<<(), and setMultiplicity().
|
private |
A vector of modifiers in the chemical reaction.
Definition at line 209 of file CChemEq.h.
Referenced by addMetabolite(), cleanup(), getModifiers(), and getMolecularity().
|
private |
A vector of products and their multiplicity in the chemical reaction 0..* Products
Definition at line 204 of file CChemEq.h.
Referenced by addMetabolite(), cleanup(), getLargestCompartment(), getMolecularity(), getProducts(), operator<<(), and setMultiplicity().
|
private |
Indicates whether the chemical equation is reversible
Definition at line 190 of file CChemEq.h.
Referenced by getReversibility(), and setReversibility().
|
private |
A vector of substrates and their multiplicity in the chemical reaction 0..* Substrates
Definition at line 197 of file CChemEq.h.
Referenced by addMetabolite(), cleanup(), getLargestCompartment(), getMolecularity(), getSubstrates(), operator<<(), and setMultiplicity().