COPASI API
4.40.278
|
#include <CChemEq.h>
Public Types | |
enum | MetaboliteRole { PRODUCT = 0 , SUBSTRATE , MODIFIER , NOROLE } |
Public Types inherited from CDataContainer | |
typedef CDataObjectMap | objectMap |
Public Types inherited from CDataObject | |
typedef std::set< const CDataObject * > | DataObjectSet |
enum | Flag { Container , Vector , Matrix , NameVector , Reference , ValueBool , ValueInt , ValueInt64 , ValueDbl , NonUniqueName , StaticString , ValueString , Separator , DisplayName , ModelEntity , Array , DataModel , Root , Gui , __SIZE } |
Public Types inherited from CObjectInterface | |
typedef std::vector< const CDataContainer * > | ContainerList |
typedef std::set< const CObjectInterface * > | ObjectSet |
Public Member Functions | |
bool | addMetabolite (const std::string &key, const C_FLOAT64 multiplicity, const MetaboliteRole &role) |
CChemEq (const CChemEq &src, const CDataContainer *pParent) | |
CChemEq (const std::string &name="NoName", const CDataContainer *pParent=NO_PARENT) | |
void | cleanup () |
const CDataVector< CChemEqElement > & | getBalances () const |
size_t | getCompartmentNumber () const |
std::set< const CCompartment * > | getCompartments () const |
const CCompartment * | getLargestCompartment () const |
const CDataVector< CChemEqElement > & | getModifiers () const |
size_t | getMolecularity (const MetaboliteRole role) const |
const CDataVector< CChemEqElement > & | getProducts () const |
const bool & | getReversibility () const |
const CDataVector< CChemEqElement > & | getSubstrates () const |
bool | setMultiplicity (const CMetab *pMetab, C_FLOAT64 newMult, MetaboliteRole role) |
void | setReversibility (const bool &reversible) |
virtual | ~CChemEq () |
Public Member Functions inherited from CDataContainer | |
virtual bool | add (CDataObject *pObject, const bool &adopt=true) |
virtual bool | appendDeletedDependentData (CUndoData &undoData) const |
virtual bool | applyData (const CData &data, CUndoData::CChangeSet &changes) override |
CDataContainer (const CDataContainer &src, const CDataContainer *pParent) | |
CDataContainer (const std::string &name, const CDataContainer *pParent=NO_PARENT, const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None) | |
virtual void | createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const override |
virtual std::string | getChildObjectUnits (const CDataObject *pObject) const |
void | getDescendants (CDataObject::DataObjectSet &descendants, const bool &recursive=false) const |
virtual size_t | getIndex (const CDataObject *pObject) const |
virtual const CObjectInterface * | getObject (const CCommonName &cn) const override |
virtual objectMap & | getObjects () |
virtual const objectMap & | getObjects () const |
virtual const std::string | getUnits () const override |
virtual const CDataObject * | getValueObject () const override |
virtual CUndoObjectInterface * | insert (const CData &data) override |
void | objectRenamed (CDataObject *pObject, const std::string &oldName) |
virtual bool | remove (CDataObject *pObject) |
virtual CData | toData () const override |
virtual | ~CDataContainer () |
Public Member Functions inherited from CDataObject | |
void | addIssue (const CIssue &issue) |
void | addReference (const CDataContainer *pReference) |
virtual void | calculateValue () override |
CDataObject (const CDataObject &src, const CDataContainer *pParent=NULL) | |
virtual void | destruct () override |
virtual CCommonName | getCN () const override |
virtual const CDataObject * | getDataObject () const override |
virtual const std::string & | getKey () const |
CDataContainer * | getObjectAncestor (const std::string &type) const |
CDataModel * | getObjectDataModel () const |
virtual std::string | getObjectDisplayName () const override |
const CObjectInterface * | getObjectFromCN (const CCommonName &cn) const |
const std::string & | getObjectName () const |
CDataContainer * | getObjectParent () const |
const std::string & | getObjectType () const |
virtual const CObjectInterface::ObjectSet & | getPrerequisites () const override |
virtual const CValidity & | getValidity () const override |
virtual void * | getValuePointer () const override |
bool | hasFlag (const Flag &flag) const |
virtual bool | isPrerequisiteForContext (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const override |
bool | prerequisitsContains (const DataObjectSet &objects) const |
virtual void | print (std::ostream *ostream) const override |
void | removeIssue (const CIssue &issue) |
void | removeReference (const CDataContainer *pReference) |
bool | setObjectName (const std::string &name) |
virtual bool | setObjectParent (const CDataContainer *pParent) |
void | validityChanged (const CValidity &changedValidity) override |
void | validityRemoved (const CValidity &changedValidity) |
virtual | ~CDataObject () |
Public Member Functions inherited from CObjectInterface | |
CObjectInterface () | |
CObjectInterface (const CObjectInterface &src) | |
virtual | ~CObjectInterface () |
Public Member Functions inherited from CUndoObjectInterface | |
CUndoObjectInterface () | |
CUndoObjectInterface (const CUndoObjectInterface &src) | |
bool | generateUuid () |
const xg::Guid & | getUuid () const |
bool | setUuid (const std::string &uuid) |
bool | setUuid (const xg::Guid &uuid) |
virtual void | updateIndex (const size_t &index, const CUndoObjectInterface *pUndoObject) |
virtual | ~CUndoObjectInterface () |
Private Member Functions | |
void | addElement (CDataVector< CChemEqElement > &structure, const CChemEqElement &element, CChemEq::MetaboliteRole role=CChemEq::PRODUCT) |
Private Attributes | |
CDataVector< CChemEqElement > | mBalances |
CDataVector< CChemEqElement > | mModifiers |
CDataVector< CChemEqElement > | mProducts |
bool | mReversible |
CDataVector< CChemEqElement > | mSubstrates |
Friends | |
std::ostream & | operator<< (std::ostream &os, const CChemEq &d) |
Additional Inherited Members | |
Static Public Member Functions inherited from CDataContainer | |
static CDataContainer * | fromData (const CData &data, CUndoObjectInterface *pParent) |
Static Public Member Functions inherited from CDataObject | |
static CDataObject * | fromData (const CData &data, CUndoObjectInterface *pParent) |
static void | sanitizeObjectName (std::string &name) |
Static Public Member Functions inherited from CObjectInterface | |
static const CDataObject * | DataObject (const CObjectInterface *pInterface) |
static CObjectInterface * | GetObjectFromCN (const ContainerList &listOfContainer, const CCommonName &objName) |
Static Public Member Functions inherited from CUndoObjectInterface | |
template<class CType > | |
static CType * | fromData (const CData &, CUndoObjectInterface *) |
Static Public Attributes inherited from CDataContainer | |
static const CObjectInterface::ContainerList | EmptyList |
Protected Member Functions inherited from CDataContainer | |
template<class CType > | |
CDataMatrixReference< CType > * | addMatrixReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
template<class CType > | |
CDataObjectReference< CType > * | addObjectReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
template<class CType > | |
CDataVectorReference< CType > * | addVectorReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
CDataContainer (const CDataContainer &src) | |
void | initObjects () |
Protected Member Functions inherited from CDataObject | |
CDataObject () | |
CDataObject (const std::string &name, const CDataContainer *pParent=static_cast< CDataContainer * >((void *) 0), const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None) | |
Protected Attributes inherited from CDataContainer | |
objectMap | mObjects |
Protected Attributes inherited from CDataObject | |
ObjectSet | mPrerequisits |
std::set< CDataContainer * > | mReferences |
Protected Attributes inherited from CObjectInterface | |
CValidity | mValidity |
CChemEq::CChemEq | ( | const std::string & | name = "NoName" , |
const CDataContainer * | pParent = NO_PARENT |
||
) |
Default constructor
const | std::string & name (default: "NoName") |
const | CDataContainer * pParent (default: NULL) |
References CONSTRUCTOR_TRACE.
CChemEq::CChemEq | ( | const CChemEq & | src, |
const CDataContainer * | pParent | ||
) |
Copy constructor
const CChemEq & | src |
const | CDataContainer * pParent (default: NULL) |
References CONSTRUCTOR_TRACE.
|
virtual |
Destructor
References cleanup(), and DESTRUCTOR_TRACE.
|
private |
Adds an element to the vector given by structure. The element is either SUBSTRATE or PRODUCT.
CDataVector < CChemEqElement > & | structure |
const CChemEqElement & | element |
CChemEq::MetaboliteRole | role ( |
References CDataVector< CType >::add(), CChemEqElement::getMetaboliteKey(), CChemEqElement::getMultiplicity(), NO_PARENT, CChemEqElement::setMultiplicity(), CDataVector< CType >::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 |
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
References CDataVector< CType >::cleanup(), mBalances, mModifiers, mProducts, and mSubstrates.
Referenced by CChemEqInterface::writeToChemEq(), and ~CChemEq().
const CDataVector< CChemEqElement > & CChemEq::getBalances | ( | ) | const |
Retrieves the vector of metabolites and their total balance in the chemical reaction.
References mBalances.
Referenced by CModel::appendAllDependents(), CMathReaction::initialize(), CModelExpansion::replaceInReaction(), and CMMLOutput::writeRHS().
size_t CChemEq::getCompartmentNumber | ( | ) | const |
Returns the number of compartments the chemical equation is associated with.
References getCompartments().
Referenced by CReaction::getCompartmentNumber(), and CReaction::getEffectiveKineticLawUnitType().
std::set< const CCompartment * > CChemEq::getCompartments | ( | ) | const |
Retrieves a set of the compartments.
References CDataVector< CType >::begin(), CDataVector< CType >::end(), mModifiers, mProducts, and mSubstrates.
Referenced by CReaction::createFunctionFromExpression(), 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.
References C_FLOAT64, C_INVALID_INDEX, mProducts, mSubstrates, and CDataVector< CType >::size().
Referenced by CReaction::getLargestCompartment().
const CDataVector< CChemEqElement > & CChemEq::getModifiers | ( | ) | const |
Retrieves the vector of Modifiers and their multiplicity
References mModifiers.
Referenced by CModelAdd::addReactions(), CModelAnalyzer::checkReaction(), CReaction::compile(), SBMLImporter::createCReactionFromReaction(), CReaction::createFunctionFromExpression(), CSBMLExporter::createReaction(), CLayoutInitializer::createReactionGlyph(), SBMLImporter::doMapping(), CModelExpansion::duplicateReaction(), CChemEqInterface::init(), CModelMerging::mergeMetabolites(), CReaction::object2variable(), CModelAdd::reactionInvolvesCompartment(), CModelExpansion::replaceInReaction(), CCopasiXML::saveModel(), SBMLImporter::setCorrectUsage(), CLLayoutRenderer::setDeduceSpeciesReferenceRoles(), 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
References fatalError, mModifiers, MODIFIER, mProducts, mSubstrates, PRODUCT, CDataVector< CType >::size(), and SUBSTRATE.
const CDataVector< CChemEqElement > & CChemEq::getProducts | ( | ) | const |
Retrieves the vector of products and their multiplicity in the chemical reaction.
References mProducts.
Referenced by CModelAdd::addReactions(), CModelAnalyzer::checkReaction(), CReaction::compile(), CModel::convert2NonReversible(), SBMLImporter::createCReactionFromReaction(), CReaction::createFunctionFromExpression(), CSBMLExporter::createKineticLaw(), CSBMLExporter::createReaction(), CLayoutInitializer::createReactionGlyph(), SBMLImporter::doMapping(), CModelExpansion::duplicateReaction(), CODEExporter::exportKineticFunction(), SBMLImporter::findCorrespondingFunction(), CChemEqInterface::getCompartment(), CEFMTask::getNetReactionData(), CEFMTask::getSpeciesChanges(), CChemEqInterface::init(), SBMLImporter::isMassActionExpression(), CODEExporterC::KineticFunction2ODEmember(), CModelMerging::mergeMetabolites(), CReaction::object2variable(), CModelAdd::reactionInvolvesCompartment(), CModelExpansion::replaceInReaction(), CCopasiXML::saveModel(), SBMLImporter::setCorrectUsage(), CLLayoutRenderer::setDeduceSpeciesReferenceRoles(), CReaction::setScalingFactor(), and CLLayoutRenderer::update_associations().
const bool & CChemEq::getReversibility | ( | ) | const |
Retrieve the reversibility of the equation
References mReversible.
Referenced by SBMLImporter::doMapping(), CChemEqInterface::init(), SBMLImporter::isMassActionExpression(), and CReaction::isReversible().
const CDataVector< CChemEqElement > & CChemEq::getSubstrates | ( | ) | const |
Retrieves the vector of substrates and their multiplicity in the chemical reaction.
References mSubstrates.
Referenced by CModelAdd::addReactions(), SBMLImporter::applyStoichiometricExpressions(), CModelAnalyzer::checkReaction(), CReaction::compile(), CMathObject::compilePropensity(), CModel::convert2NonReversible(), SBMLImporter::createCReactionFromReaction(), CReaction::createFunctionFromExpression(), CSBMLExporter::createKineticLaw(), CSBMLExporter::createReaction(), CLayoutInitializer::createReactionGlyph(), SBMLImporter::doMapping(), CModelExpansion::duplicateReaction(), CODEExporter::exportKineticFunction(), SBMLImporter::findCorrespondingFunction(), CChemEqInterface::getCompartment(), CEFMTask::getNetReactionData(), CEFMTask::getSpeciesChanges(), CChemEqInterface::init(), SBMLImporter::isMassActionExpression(), CODEExporterC::KineticFunction2ODEmember(), CModelMerging::mergeMetabolites(), CReaction::object2variable(), CModelAdd::reactionInvolvesCompartment(), CModelExpansion::replaceInReaction(), CCopasiXML::saveModel(), SBMLImporter::setCorrectUsage(), CLLayoutRenderer::setDeduceSpeciesReferenceRoles(), CReaction::setScalingFactor(), 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.
References addElement(), CDataVector< CType >::begin(), C_FLOAT64, CDataVector< CType >::end(), CModelEntity::getKey(), mBalances, mProducts, mSubstrates, NO_PARENT, PRODUCT, CChemEqElement::setMultiplicity(), and SUBSTRATE.
Referenced by SBMLImporter::applyConversionFactors().
void CChemEq::setReversibility | ( | const bool & | reversible | ) |
Set the reversibility of the of the equation
const | bool & const bool & reversible |
References mReversible.
Referenced by CReaction::load(), CReaction::setReversible(), and CChemEqInterface::writeToChemEq().
|
friend |
Friend declaration for ostream operator
std::ostream | & os |
const | CChemEq & d |
|
private |
A vector of metabolites and their total balance in the chemical reaction @supplierCardinality 0..* @label Stoichiometry
Referenced by addMetabolite(), cleanup(), getBalances(), and setMultiplicity().
|
private |
A vector of modifiers in the chemical reaction.
Referenced by addMetabolite(), cleanup(), getCompartments(), getModifiers(), and getMolecularity().
|
private |
A vector of products and their multiplicity in the chemical reaction @supplierCardinality 0..* @label Products
Referenced by addMetabolite(), cleanup(), getCompartments(), getLargestCompartment(), getMolecularity(), getProducts(), and setMultiplicity().
|
private |
Indicates whether the chemical equation is reversible
Referenced by getReversibility(), and setReversibility().
|
private |
A vector of substrates and their multiplicity in the chemical reaction @supplierCardinality 0..* @label Substrates
Referenced by addMetabolite(), cleanup(), getCompartments(), getLargestCompartment(), getMolecularity(), getSubstrates(), and setMultiplicity().