COPASI API  4.40.278
CChemEqInterface Class Reference

#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 CCompartmentgetCompartment () 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_FLOAT64mModifierMult
 
std::vector< std::string > mModifierNames
 
const CChemEqmpChemEq
 
CModelmpModel
 
std::vector< std::string > mProductCompartments
 
std::vector< std::string > mProductDisplayNames
 
std::vector< C_FLOAT64mProductMult
 
std::vector< std::string > mProductNames
 
bool mReversibility
 
std::vector< std::string > mSubstrateCompartments
 
std::vector< std::string > mSubstrateDisplayNames
 
std::vector< C_FLOAT64mSubstrateMult
 
std::vector< std::string > mSubstrateNames
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CChemEqInterface()

CChemEqInterface::CChemEqInterface ( )

◆ ~CChemEqInterface()

CChemEqInterface::~CChemEqInterface ( )

Member Function Documentation

◆ addModifier()

void CChemEqInterface::addModifier ( const std::string &  name)

◆ buildDisplayNames()

◆ clearAll()

◆ clearModifiers()

void CChemEqInterface::clearModifiers ( )

◆ completeCompartments()

◆ createNonExistingMetabs()

bool CChemEqInterface::createNonExistingMetabs ( std::vector< std::string > &  createdKeys)

creates all necessary metabolites (and volumes)

Parameters
createdKeysthis vector will be filled with keys of created elements
Returns
true, in case some elements were created, false otherwise

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

◆ displayNameToNamePair()

std::pair< std::string, std::string > CChemEqInterface::displayNameToNamePair ( CFunctionParameter::Role  role,
const std::string  displayName 
) const

◆ fromDataValue()

bool CChemEqInterface::fromDataValue ( const std::string &  dataValue)

References setChemEqString().

Referenced by CReaction::applyData().

◆ getChemEqString() [1/2]

◆ getChemEqString() [2/2]

std::string CChemEqInterface::getChemEqString ( const CReaction rea,
bool  expanded 
)
static

◆ getCompartment()

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

◆ getCompartments()

std::set< std::string > CChemEqInterface::getCompartments ( ) const

◆ getDefaultCompartment()

std::string CChemEqInterface::getDefaultCompartment ( ) const

◆ getListOfCompartments()

const std::vector< std::string > & CChemEqInterface::getListOfCompartments ( CFunctionParameter::Role  role) const

◆ getListOfDisplayNames()

◆ getListOfMultiplicities()

◆ getListOfSpecies()

const std::vector< std::string > & CChemEqInterface::getListOfSpecies ( CFunctionParameter::Role  role) const

◆ getMolecularity()

◆ getReversibility()

bool CChemEqInterface::getReversibility ( ) const

◆ init()

◆ isMulticompartment()

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

◆ isValidEq()

bool CChemEqInterface::isValidEq ( const std::string &  eq)
static

◆ listOfNonExistingMetabNames()

std::set< std::pair< std::string, std::string > > CChemEqInterface::listOfNonExistingMetabNames ( ) const

◆ listOfNonUniqueMetabNames()

std::set< std::string > CChemEqInterface::listOfNonUniqueMetabNames ( ) const

◆ reverse()

◆ setChemEqFromString()

bool CChemEqInterface::setChemEqFromString ( CReaction rea,
const std::string &  ces 
)
static

◆ setChemEqString()

◆ setReversibility()

void CChemEqInterface::setReversibility ( bool  rev)

◆ toDataValue()

◆ writeElement()

std::string CChemEqInterface::writeElement ( const std::string &  name,
C_FLOAT64  mult,
bool  expanded 
)
staticprivate

References C_INT32, and isNumber().

Referenced by getChemEqString().

◆ writeToChemEq()

Member Data Documentation

◆ mModifierCompartments

◆ mModifierDisplayNames

std::vector< std::string > CChemEqInterface::mModifierDisplayNames
private

◆ mModifierMult

std::vector< C_FLOAT64 > CChemEqInterface::mModifierMult
private

◆ mModifierNames

◆ mpChemEq

const CChemEq* CChemEqInterface::mpChemEq
private

Referenced by init(), and writeToChemEq().

◆ mpModel

◆ mProductCompartments

◆ mProductDisplayNames

std::vector< std::string > CChemEqInterface::mProductDisplayNames
private

◆ mProductMult

std::vector< C_FLOAT64 > CChemEqInterface::mProductMult
private

◆ mProductNames

◆ mReversibility

bool CChemEqInterface::mReversibility
private

◆ mSubstrateCompartments

◆ mSubstrateDisplayNames

std::vector< std::string > CChemEqInterface::mSubstrateDisplayNames
private

◆ mSubstrateMult

std::vector< C_FLOAT64 > CChemEqInterface::mSubstrateMult
private

◆ mSubstrateNames


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