COPASI API  4.40.278
CChemEq Class Reference

#include <CChemEq.h>

Inheritance diagram for CChemEq:
[legend]

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 CCompartmentgetLargestCompartment () 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 CObjectInterfacegetObject (const CCommonName &cn) const override
 
virtual objectMapgetObjects ()
 
virtual const objectMapgetObjects () const
 
virtual const std::string getUnits () const override
 
virtual const CDataObjectgetValueObject () const override
 
virtual CUndoObjectInterfaceinsert (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 CDataObjectgetDataObject () const override
 
virtual const std::string & getKey () const
 
CDataContainergetObjectAncestor (const std::string &type) const
 
CDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName () const override
 
const CObjectInterfacegetObjectFromCN (const CCommonName &cn) const
 
const std::string & getObjectName () const
 
CDataContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const CObjectInterface::ObjectSetgetPrerequisites () const override
 
virtual const CValiditygetValidity () 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< CChemEqElementmBalances
 
CDataVector< CChemEqElementmModifiers
 
CDataVector< CChemEqElementmProducts
 
bool mReversible
 
CDataVector< CChemEqElementmSubstrates
 

Friends

std::ostream & operator<< (std::ostream &os, const CChemEq &d)
 

Additional Inherited Members

- Static Public Member Functions inherited from CDataContainer
static CDataContainerfromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CDataObject
static CDataObjectfromData (const CData &data, CUndoObjectInterface *pParent)
 
static void sanitizeObjectName (std::string &name)
 
- Static Public Member Functions inherited from CObjectInterface
static const CDataObjectDataObject (const CObjectInterface *pInterface)
 
static CObjectInterfaceGetObjectFromCN (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
 

Member Enumeration Documentation

◆ MetaboliteRole

Enumerator
PRODUCT 
SUBSTRATE 
MODIFIER 
NOROLE 

Constructor & Destructor Documentation

◆ CChemEq() [1/2]

CChemEq::CChemEq ( const std::string &  name = "NoName",
const CDataContainer pParent = NO_PARENT 
)

Default constructor

Parameters
conststd::string & name (default: "NoName")
constCDataContainer * pParent (default: NULL)

References CONSTRUCTOR_TRACE.

◆ CChemEq() [2/2]

CChemEq::CChemEq ( const CChemEq src,
const CDataContainer pParent 
)

Copy constructor

Parameters
const CChemEq &src
constCDataContainer * pParent (default: NULL)

References CONSTRUCTOR_TRACE.

◆ ~CChemEq()

CChemEq::~CChemEq ( )
virtual

Destructor

References cleanup(), and DESTRUCTOR_TRACE.

Member Function Documentation

◆ addElement()

void CChemEq::addElement ( CDataVector< CChemEqElement > &  structure,
const CChemEqElement element,
CChemEq::MetaboliteRole  role = CChemEq::PRODUCT 
)
private

Adds an element to the vector given by structure. The element is either SUBSTRATE or PRODUCT.

Parameters
CDataVector < CChemEqElement > &structure
const CChemEqElement &element
CChemEq::MetaboliteRolerole (

References CDataVector< CType >::add(), CChemEqElement::getMetaboliteKey(), CChemEqElement::getMultiplicity(), NO_PARENT, CChemEqElement::setMultiplicity(), CDataVector< CType >::size(), and SUBSTRATE.

Referenced by addMetabolite(), and setMultiplicity().

◆ addMetabolite()

bool CChemEq::addMetabolite ( const std::string &  key,
const C_FLOAT64  multiplicity,
const MetaboliteRole role 
)

◆ cleanup()

void CChemEq::cleanup ( )

◆ getBalances()

const CDataVector< CChemEqElement > & CChemEq::getBalances ( ) const

Retrieves the vector of metabolites and their total balance in the chemical reaction.

Returns
"vector < CChemEqElement * > &" balances

References mBalances.

Referenced by CModel::appendAllDependents(), CMathReaction::initialize(), CModelExpansion::replaceInReaction(), and CMMLOutput::writeRHS().

◆ getCompartmentNumber()

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().

◆ getCompartments()

std::set< const CCompartment * > CChemEq::getCompartments ( ) const

◆ getLargestCompartment()

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.

Returns
const CCompartment * pCompartment

References C_FLOAT64, C_INVALID_INDEX, mProducts, mSubstrates, and CDataVector< CType >::size().

Referenced by CReaction::getLargestCompartment().

◆ getModifiers()

◆ getMolecularity()

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.

◆ getProducts()

◆ getReversibility()

const bool & CChemEq::getReversibility ( ) const

Retrieve the reversibility of the equation

Returns
const bool & reversible

References mReversible.

Referenced by SBMLImporter::doMapping(), CChemEqInterface::init(), SBMLImporter::isMassActionExpression(), and CReaction::isReversible().

◆ getSubstrates()

◆ setMultiplicity()

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().

◆ setReversibility()

void CChemEq::setReversibility ( const bool &  reversible)

Set the reversibility of the of the equation

Parameters
constbool & const bool & reversible

References mReversible.

Referenced by CReaction::load(), CReaction::setReversible(), and CChemEqInterface::writeToChemEq().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CChemEq d 
)
friend

Friend declaration for ostream operator

Parameters
std::ostream& os
constCChemEq & d
Returns
std::ostream & os

Member Data Documentation

◆ mBalances

CDataVector< CChemEqElement > CChemEq::mBalances
private

A vector of metabolites and their total balance in the chemical reaction @supplierCardinality 0..* @label Stoichiometry

Referenced by addMetabolite(), cleanup(), getBalances(), and setMultiplicity().

◆ mModifiers

CDataVector< CChemEqElement > CChemEq::mModifiers
private

A vector of modifiers in the chemical reaction.

Referenced by addMetabolite(), cleanup(), getCompartments(), getModifiers(), and getMolecularity().

◆ mProducts

CDataVector< CChemEqElement > CChemEq::mProducts
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().

◆ mReversible

bool CChemEq::mReversible
private

Indicates whether the chemical equation is reversible

Referenced by getReversibility(), and setReversibility().

◆ mSubstrates

CDataVector< CChemEqElement > CChemEq::mSubstrates
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().


The documentation for this class was generated from the following files: