copasi API  0.1
Public Member Functions
CReactionInterface Class Reference

#include <CReactionInterface.h>

List of all members.

Public Member Functions

 CReactionInterface (CModel *pModel)
 ~CReactionInterface ()
void setReactionName (const std::string &name)
const std::string & getReactionName () const
void setChemEqString (const std::string &eq, const std::string &newFunction)
std::string getChemEqString () const
const CChemEqInterfacegetChemEqInterface () const
bool isReversible () const
bool isMulticompartment () const
void setReversibility (bool rev, const std::string &newFunction)
void reverse (bool rev, const std::string &newFunction)
const std::vector< std::string > & getListOfMetabs (CFunctionParameter::Role role) const
void setFunctionWithEmptyMapping (const std::string &fn)
void setFunctionAndDoMapping (const std::string &fn)
const std::string & getFunctionName () const
const std::string & getFunctionDescription () const
const CFunctiongetFunction () const
std::vector< std::string > getListOfPossibleFunctions () const
C_INT32 size () const
bool isVector (unsigned C_INT32 index) const
CFunctionParameter::Role getUsage (unsigned C_INT32 index) const
std::string getParameterName (unsigned C_INT32 index) const
void setMapping (unsigned C_INT32 index, std::string mn)
void removeMapping (unsigned C_INT32 index, std::string mn)
const std::vector< std::string > & getMappings (unsigned C_INT32 index) const
const std::string & getMapping (unsigned C_INT32 index) const
void setLocalValue (unsigned C_INT32 index, C_FLOAT64 value)
void setLocal (unsigned C_INT32 index)
const C_FLOAT64 & getLocalValue (unsigned C_INT32 index) const
bool isLocalValue (unsigned C_INT32 index) const
void initFromReaction (const std::string &key)
void initFromReaction (const C_INT32 index)
void initFromReaction (const CReaction *rea)
bool writeBackToReaction (CReaction *rea)
bool createMetabolites ()
bool createOtherObjects () const
bool isValid () const
bool isLocked (unsigned C_INT32 index) const
bool isLocked (CFunctionParameter::Role usage) const
std::set< const CCopasiObject * > getDeletedParameters () const

Detailed Description

This class provides an interface for dealing with reactions. For representing the parameter mappings it uses object names. A CReactionInterface allows editing a reaction while trying to keep everything consistent.

Note: Many of the methods need to be provided with a model. While handling of the metabolites is completely independent of the model (they are handled by name, and they don't need to exist), the mapping of Compartments and global parameters is done with the entities that exist in the model. This may seem inconsistent, but the idea is that metabolites can be created from the gui by entering them into the reaction equation. Compartments and global parameters can only be chosen from the list of existing objects.


Constructor & Destructor Documentation

CReactionInterface::CReactionInterface ( CModel pModel)
CReactionInterface::~CReactionInterface ( )

Member Function Documentation

bool CReactionInterface::createMetabolites ( )

create all metabolites that are needed by the reaction but do not exist in the model yet.

bool CReactionInterface::createOtherObjects ( ) const

create all other objects that are needed by the reaction but do not exist in the model yet.

const CChemEqInterface& CReactionInterface::getChemEqInterface ( ) const [inline]
std::string CReactionInterface::getChemEqString ( ) const [inline]
std::set< const CCopasiObject * > CReactionInterface::getDeletedParameters ( ) const

Retrieve the list of parameters which will be deleted

Returns:
std::set< const CCopasiObject * > DeletedParameters
const CFunction* CReactionInterface::getFunction ( ) const [inline]
const std::string& CReactionInterface::getFunctionDescription ( ) const [inline]
const std::string& CReactionInterface::getFunctionName ( ) const [inline]
const std::vector< std::string > & CReactionInterface::getListOfMetabs ( CFunctionParameter::Role  role) const

This produces a list of metab names (from the chem eq) for use in the combo boxes. The role must be given like a usage, e.g. "SUBSTRATE".

std::vector< std::string > CReactionInterface::getListOfPossibleFunctions ( ) const
const C_FLOAT64& CReactionInterface::getLocalValue ( unsigned C_INT32  index) const [inline]
const std::string& CReactionInterface::getMapping ( unsigned C_INT32  index) const [inline]
const std::vector< std::string >& CReactionInterface::getMappings ( unsigned C_INT32  index) const [inline]
std::string CReactionInterface::getParameterName ( unsigned C_INT32  index) const [inline]
const std::string& CReactionInterface::getReactionName ( ) const [inline]
CFunctionParameter::Role CReactionInterface::getUsage ( unsigned C_INT32  index) const [inline]
void CReactionInterface::initFromReaction ( const std::string &  key)

associate the function parameter referenced by "index" with the global parameter named pn. Only valid if the role for this function parameter is "PARAMETER". returns success

void CReactionInterface::initFromReaction ( const C_INT32  index)
void CReactionInterface::initFromReaction ( const CReaction rea)
bool CReactionInterface::isLocalValue ( unsigned C_INT32  index) const [inline]
bool CReactionInterface::isLocked ( unsigned C_INT32  index) const

Is the mapping of this parameter locked? The bahaviour of this method is different for different roles: SUBSTRATE, PRODUCT: according to the chemical equation MODIFIER: always unlocked TIME: always locked VOLUME, PARAMETER: according to the model

The idea is that in the reaction GUI new species can be entered in the chemical equation that are then created automatically. Compartments and global parameters can only be chosen from those existing in the model.

bool CReactionInterface::isLocked ( CFunctionParameter::Role  usage) const
bool CReactionInterface::isMulticompartment ( ) const

this method tries to find out if the REACTION involves several compartments 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

bool CReactionInterface::isReversible ( ) const [inline]
bool CReactionInterface::isValid ( ) const
bool CReactionInterface::isVector ( unsigned C_INT32  index) const [inline]
void CReactionInterface::removeMapping ( unsigned C_INT32  index,
std::string  mn 
)
void CReactionInterface::reverse ( bool  rev,
const std::string &  newFunction 
)

reverse the reaction and set the reversibility. newFunction suggests a new kinetic function which is only used if adequate.

void CReactionInterface::setChemEqString ( const std::string &  eq,
const std::string &  newFunction 
)

set a new chemical equation. newFunction suggests a new kinetic function which is only used if adequate.

void CReactionInterface::setFunctionAndDoMapping ( const std::string &  fn)

set the function. a new mapping is created that tries to preserve as much information as possible from the old mapping. Then a default mapping is set from the chemical equation and the model (if possible).

void CReactionInterface::setFunctionWithEmptyMapping ( const std::string &  fn)

set the function. an empty mapping is created

void CReactionInterface::setLocal ( unsigned C_INT32  index) [inline]
void CReactionInterface::setLocalValue ( unsigned C_INT32  index,
C_FLOAT64  value 
) [inline]
void CReactionInterface::setMapping ( unsigned C_INT32  index,
std::string  mn 
)
void CReactionInterface::setReactionName ( const std::string &  name) [inline]
void CReactionInterface::setReversibility ( bool  rev,
const std::string &  newFunction 
)

set the reversibility. newFunction suggests a new kinetic function which is only used if adequate.

C_INT32 CReactionInterface::size ( ) const [inline]
bool CReactionInterface::writeBackToReaction ( CReaction rea)

writes the information back to a CReaction. createMetabolites() and createOtherObjects() should be called before.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines