COPASI API
4.16.103
|
#include <CModelExpansion.h>
Classes | |
class | ElementsMap |
class | SetOfModelElements |
Public Member Functions | |
CModelExpansion (CModel *pModel) | |
std::set< CCopasiObject * > | copyCompleteModel (const CModel *pSourceModel) |
void | createDiffusionReaction (const std::string &name, const std::string &metabkey1, const std::string &metabkey2, const std::string ¶meterkey) |
void | createLinearArray (const SetOfModelElements &source, size_t n, const std::set< std::string > &setOfMetabolites) |
void | createRectangularArray (const SetOfModelElements &source, size_t nx, size_t ny, const std::set< std::string > &setOfMetabolites) |
bool | duplicate (const SetOfModelElements &source, const std::string &index, ElementsMap &emap) |
void | duplicateCompartment (const CCompartment *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap) |
void | duplicateEvent (CEvent *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap) |
void | duplicateGlobalQuantity (const CModelValue *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap) |
void | duplicateMetab (const CMetab *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap) |
void | duplicateReaction (const CReaction *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap) |
bool | existDependentEntities (const CCopasiObject *pObj) |
bool | expressionContainsObject (const CExpression *exp, const SetOfModelElements &sourceSet) |
void | replaceInCompartment (CCompartment *pX, const ElementsMap &emap) |
void | replaceInEvent (CEvent *pX, const ElementsMap &emap) |
void | replaceInExpression (CExpression *exp, const ElementsMap &emap) |
void | replaceInMetab (CMetab *pX, const ElementsMap &emap) |
void | replaceInModel (const ElementsMap &emap, bool remove) |
void | replaceInModelEntity (CModelEntity *pX, const ElementsMap &emap) |
void | replaceInReaction (CReaction *pX, const ElementsMap &emap) |
void | setModel (CModel *pModel) |
void | simpleCall (const CCompartment *source, std::vector< std::string > listOfMetabolites, int mult, bool diff) |
void | updateExpression (CExpression *exp, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap) |
Protected Attributes | |
CModel * | mpModel |
const CModel * | mpSourceModel |
Definition at line 41 of file CModelExpansion.h.
CModelExpansion::CModelExpansion | ( | CModel * | pModel | ) |
Definition at line 262 of file CModelExpansion.cpp.
std::set< CCopasiObject * > CModelExpansion::copyCompleteModel | ( | const CModel * | pSourceModel | ) |
adds the contents of the source model to the current model. A list of created model elements is returned
Definition at line 478 of file CModelExpansion.cpp.
References CModel::compileIfNecessary(), duplicate(), CModelExpansion::SetOfModelElements::fillComplete(), CModelExpansion::ElementsMap::getMap(), mpModel, and mpSourceModel.
void CModelExpansion::createDiffusionReaction | ( | const std::string & | name, |
const std::string & | metabkey1, | ||
const std::string & | metabkey2, | ||
const std::string & | parameterkey | ||
) |
Create a first order reversible mass action reaction. This is intended for diffusion between copies of model parts. The method takes a reaction name, and keys of two metabolites and a global quantity that is used as a rate constant.
Definition at line 1066 of file CModelExpansion.cpp.
References CReaction::addParameterMapping(), CReaction::addProduct(), CReaction::addSubstrate(), CModel::createReaction(), mpModel, CReaction::setFunction(), CReaction::setParameterMapping(), and CReaction::setReversible().
Referenced by createLinearArray(), createRectangularArray(), and simpleCall().
void CModelExpansion::createLinearArray | ( | const SetOfModelElements & | source, |
size_t | n, | ||
const std::set< std::string > & | setOfMetabolites | ||
) |
creates n copies of the objects in souce. Diffusion reactions are created for each of the metabs in listOfMetabolites, so that a linear chain is formed.
Definition at line 336 of file CModelExpansion.cpp.
References CModel::compileIfNecessary(), createDiffusionReaction(), CModel::createModelValue(), duplicate(), CKeyFactory::get(), CMetab::getCompartment(), CCopasiRootContainer::getKeyFactory(), CCopasiObject::getObjectName(), and mpModel.
Referenced by CQExpandModelData::slotOK().
void CModelExpansion::createRectangularArray | ( | const SetOfModelElements & | source, |
size_t | nx, | ||
size_t | ny, | ||
const std::set< std::string > & | setOfMetabolites | ||
) |
creates nx*ny copies of the objects in souce. Diffusion reactions are created for each of the metabs in listOfMetabolites, so that a rectangular array is formed.
Definition at line 397 of file CModelExpansion.cpp.
References CModel::compileIfNecessary(), createDiffusionReaction(), CModel::createModelValue(), duplicate(), CKeyFactory::get(), CMetab::getCompartment(), CCopasiRootContainer::getKeyFactory(), CCopasiObject::getObjectName(), and mpModel.
Referenced by CQExpandModelData::slotOK().
bool CModelExpansion::duplicate | ( | const SetOfModelElements & | source, |
const std::string & | index, | ||
ElementsMap & | emap | ||
) |
creates one duplicate of the set of elements specified by source. the string index is added to the object names
Definition at line 500 of file CModelExpansion.cpp.
References duplicateCompartment(), duplicateEvent(), duplicateGlobalQuantity(), duplicateMetab(), duplicateReaction(), CModelExpansion::SetOfModelElements::mCompartments, CModelExpansion::SetOfModelElements::mEvents, CModelExpansion::SetOfModelElements::mGlobalQuantities, CModelExpansion::SetOfModelElements::mMetabs, and CModelExpansion::SetOfModelElements::mReactions.
Referenced by CQCompartment::copy(), copyCompleteModel(), createLinearArray(), createRectangularArray(), replaceInExpression(), simpleCall(), and updateExpression().
void CModelExpansion::duplicateCompartment | ( | const CCompartment * | source, |
const std::string & | index, | ||
const SetOfModelElements & | sourceSet, | ||
ElementsMap & | emap | ||
) |
Definition at line 542 of file CModelExpansion.cpp.
References CModelExpansion::ElementsMap::add(), CModel::createCompartment(), CModelExpansion::ElementsMap::exists(), CCompartment::getDimensionality(), CModelEntity::getExpression(), CModelEntity::getExpressionPtr(), CModelEntity::getInitialExpression(), CModelEntity::getInitialExpressionPtr(), CModelEntity::getInitialValue(), CModelEntity::getKey(), CAnnotation::getMiriamAnnotation(), CAnnotation::getNotes(), CCopasiObject::getObjectName(), CModelEntity::getStatus(), mpModel, CCompartment::setDimensionality(), CModelEntity::setExpression(), CModelEntity::setInitialExpression(), CAnnotation::setMiriamAnnotation(), CAnnotation::setNotes(), CModelEntity::setStatus(), and updateExpression().
Referenced by duplicate(), duplicateMetab(), duplicateReaction(), and updateExpression().
void CModelExpansion::duplicateEvent | ( | CEvent * | source, |
const std::string & | index, | ||
const SetOfModelElements & | sourceSet, | ||
ElementsMap & | emap | ||
) |
Definition at line 869 of file CModelExpansion.cpp.
References CModelExpansion::ElementsMap::add(), CCopasiVectorN< CType >::add(), CExpression::compile(), CModelExpansion::SetOfModelElements::contains(), CModel::createEvent(), CModelExpansion::ElementsMap::exists(), expressionContainsObject(), CEvent::getAssignments(), CEvent::getDelayAssignment(), CEvent::getDelayExpression(), CEvent::getDelayExpressionPtr(), CModelExpansion::ElementsMap::getDuplicateKey(), CEventAssignment::getExpression(), CEventAssignment::getExpressionPtr(), CEvent::getKey(), CAnnotation::getMiriamAnnotation(), CAnnotation::getNotes(), CCopasiObject::getObjectName(), CEventAssignment::getTargetKey(), CEvent::getTriggerExpression(), CEvent::getTriggerExpressionPtr(), mpModel, CEvent::setDelayAssignment(), CEvent::setDelayExpression(), CEventAssignment::setExpression(), CAnnotation::setMiriamAnnotation(), CAnnotation::setNotes(), CEvent::setTriggerExpression(), CCopasiVector< T >::size(), and updateExpression().
Referenced by duplicate().
void CModelExpansion::duplicateGlobalQuantity | ( | const CModelValue * | source, |
const std::string & | index, | ||
const SetOfModelElements & | sourceSet, | ||
ElementsMap & | emap | ||
) |
Definition at line 832 of file CModelExpansion.cpp.
References CModelExpansion::ElementsMap::add(), CModel::createModelValue(), CModelExpansion::ElementsMap::exists(), CModelEntity::getExpression(), CModelEntity::getExpressionPtr(), CModelEntity::getInitialExpression(), CModelEntity::getInitialExpressionPtr(), CModelEntity::getInitialValue(), CModelEntity::getKey(), CAnnotation::getMiriamAnnotation(), CAnnotation::getNotes(), CCopasiObject::getObjectName(), CModelEntity::getStatus(), mpModel, CModelEntity::setExpression(), CModelEntity::setInitialExpression(), CAnnotation::setMiriamAnnotation(), CAnnotation::setNotes(), CModelEntity::setStatus(), and updateExpression().
Referenced by duplicate(), duplicateReaction(), and updateExpression().
void CModelExpansion::duplicateMetab | ( | const CMetab * | source, |
const std::string & | index, | ||
const SetOfModelElements & | sourceSet, | ||
ElementsMap & | emap | ||
) |
Definition at line 582 of file CModelExpansion.cpp.
References CModelExpansion::ElementsMap::add(), CModelExpansion::SetOfModelElements::contains(), CModel::createMetabolite(), duplicateCompartment(), CModelExpansion::ElementsMap::exists(), CMetab::getCompartment(), CModelExpansion::ElementsMap::getDuplicatePtr(), CModelEntity::getExpression(), CModelEntity::getExpressionPtr(), CMetab::getInitialConcentration(), CModelEntity::getInitialExpression(), CModelEntity::getInitialExpressionPtr(), CModelEntity::getKey(), CAnnotation::getMiriamAnnotation(), CAnnotation::getNotes(), CCopasiObject::getObjectName(), CModelEntity::getStatus(), mpModel, CModelEntity::setExpression(), CModelEntity::setInitialExpression(), CAnnotation::setMiriamAnnotation(), CAnnotation::setNotes(), and updateExpression().
Referenced by CQSpeciesDetail::copy(), ReactionsWidget1::copy(), duplicate(), duplicateReaction(), and updateExpression().
void CModelExpansion::duplicateReaction | ( | const CReaction * | source, |
const std::string & | index, | ||
const SetOfModelElements & | sourceSet, | ||
ElementsMap & | emap | ||
) |
Definition at line 644 of file CModelExpansion.cpp.
References CModelExpansion::ElementsMap::add(), CReaction::addModifier(), CReaction::addParameterMapping(), CReaction::addProduct(), CReaction::addSubstrate(), CReaction::clearParameterMapping(), CModelExpansion::SetOfModelElements::contains(), CModel::createReaction(), duplicateCompartment(), duplicateGlobalQuantity(), duplicateMetab(), CModelExpansion::ElementsMap::exists(), CKeyFactory::get(), CReaction::getChemEq(), CModelExpansion::ElementsMap::getDuplicateKey(), CModelExpansion::ElementsMap::getDuplicatePtr(), CReaction::getFunction(), CReaction::getFunctionParameters(), CModelEntity::getKey(), CReaction::getKey(), CCopasiRootContainer::getKeyFactory(), CChemEqElement::getMetabolite(), CAnnotation::getMiriamAnnotation(), CChemEq::getModifiers(), CChemEqElement::getMultiplicity(), CAnnotation::getNotes(), CCopasiObject::getObjectName(), CReaction::getParameterMappings(), CReaction::getParameterValue(), CChemEq::getProducts(), CChemEq::getSubstrates(), CReaction::isLocalParameter(), CReaction::isReversible(), CFunctionParameter::MODIFIER, mpModel, CFunctionParameter::PARAMETER, CFunctionParameter::PRODUCT, CReaction::setFunction(), CAnnotation::setMiriamAnnotation(), CAnnotation::setNotes(), CReaction::setParameterMapping(), CReaction::setParameterValue(), CReaction::setReversible(), CFunctionParameters::size(), CCopasiVector< T >::size(), CFunctionParameter::SUBSTRATE, CFunctionParameter::TIME, CFunctionParameter::VFLOAT64, and CFunctionParameter::VOLUME.
Referenced by ReactionsWidget1::copy(), duplicate(), and updateExpression().
bool CModelExpansion::existDependentEntities | ( | const CCopasiObject * | pObj | ) |
Tests if there are model elements that refer to the given model entity
Definition at line 1339 of file CModelExpansion.cpp.
References CModelExpansion::SetOfModelElements::addObject(), CModelExpansion::SetOfModelElements::fillDependencies(), CModelExpansion::SetOfModelElements::mCompartments, CModelExpansion::SetOfModelElements::mEvents, CModelExpansion::SetOfModelElements::mGlobalQuantities, CModelExpansion::SetOfModelElements::mMetabs, mpModel, and CModelExpansion::SetOfModelElements::mReactions.
Referenced by CQMergingData::fillTree().
bool CModelExpansion::expressionContainsObject | ( | const CExpression * | exp, |
const SetOfModelElements & | sourceSet | ||
) |
Check if a given expression contains any of the objects in the sourceSet
Definition at line 1034 of file CModelExpansion.cpp.
References CModelExpansion::SetOfModelElements::contains(), CEvaluationTree::getNodeList(), CEvaluationNodeObject::getObjectInterfacePtr(), and CCopasiObject::getObjectParent().
Referenced by duplicateEvent().
void CModelExpansion::replaceInCompartment | ( | CCompartment * | pX, |
const ElementsMap & | emap | ||
) |
Definition at line 1160 of file CModelExpansion.cpp.
References replaceInModelEntity().
Referenced by replaceInModel().
void CModelExpansion::replaceInEvent | ( | CEvent * | pX, |
const ElementsMap & | emap | ||
) |
Definition at line 1275 of file CModelExpansion.cpp.
References CEvent::getAssignments(), CEvent::getDelayExpressionPtr(), CModelExpansion::ElementsMap::getDuplicateKey(), CEventAssignment::getExpressionPtr(), CEventAssignment::getTargetKey(), CEvent::getTriggerExpressionPtr(), replaceInExpression(), CEventAssignment::setTargetKey(), and CCopasiVector< T >::size().
Referenced by replaceInModel().
void CModelExpansion::replaceInExpression | ( | CExpression * | exp, |
const ElementsMap & | emap | ||
) |
Definition at line 1295 of file CModelExpansion.cpp.
References duplicate(), CCopasiObject::getCN(), CModelExpansion::ElementsMap::getDuplicatePtr(), CEvaluationTree::getNodeList(), CCopasiObject::getObject(), CEvaluationNodeObject::getObjectInterfacePtr(), CCopasiObject::getObjectName(), CCopasiObject::getObjectParent(), CCopasiObject::getObjectType(), and CEvaluationNodeObject::setData().
Referenced by replaceInEvent(), and replaceInModelEntity().
void CModelExpansion::replaceInMetab | ( | CMetab * | pX, |
const ElementsMap & | emap | ||
) |
Definition at line 1165 of file CModelExpansion.cpp.
References CCompartment::addMetabolite(), CModelExpansion::ElementsMap::exists(), CMetab::getCompartment(), CModelExpansion::ElementsMap::getDuplicatePtr(), CCompartment::getMetabolites(), CCopasiObject::getObjectName(), CModel::initializeMetabolites(), mpModel, CCopasiVectorN< CType >::remove(), replaceInModelEntity(), CModel::setCompileFlag(), and CCopasiObject::setObjectName().
Referenced by replaceInModel().
void CModelExpansion::replaceInModel | ( | const ElementsMap & | emap, |
bool | remove | ||
) |
Definition at line 1092 of file CModelExpansion.cpp.
References CModel::forceCompile(), CModel::getCompartments(), CModel::getEvents(), CModelExpansion::ElementsMap::getMap(), CModel::getMetabolites(), CModel::getModelValues(), CModel::getReactions(), mpModel, CModel::removeCompartment(), CModel::removeEvent(), CModel::removeMetabolite(), CModel::removeModelValue(), CModel::removeReaction(), replaceInCompartment(), replaceInEvent(), replaceInMetab(), replaceInModelEntity(), replaceInReaction(), and CCopasiVector< T >::size().
Referenced by CQMergingData::slotBtnMerge().
void CModelExpansion::replaceInModelEntity | ( | CModelEntity * | pX, |
const ElementsMap & | emap | ||
) |
Definition at line 1266 of file CModelExpansion.cpp.
References CModelEntity::getExpressionPtr(), CModelEntity::getInitialExpressionPtr(), and replaceInExpression().
Referenced by replaceInCompartment(), replaceInMetab(), and replaceInModel().
void CModelExpansion::replaceInReaction | ( | CReaction * | pX, |
const ElementsMap & | emap | ||
) |
Definition at line 1198 of file CModelExpansion.cpp.
References CReaction::getChemEq(), CModelExpansion::ElementsMap::getDuplicateKey(), CModelExpansion::ElementsMap::getDuplicatePtr(), CReaction::getFunctionParameters(), CModelEntity::getKey(), CChemEqElement::getMetabolite(), CChemEq::getModifiers(), CReaction::getParameterMappings(), CChemEq::getProducts(), CChemEq::getSubstrates(), CFunctionParameter::MODIFIER, CFunctionParameter::PARAMETER, CFunctionParameter::PRODUCT, CChemEqElement::setMetabolite(), CFunctionParameters::size(), CCopasiVector< T >::size(), CFunctionParameter::SUBSTRATE, CFunctionParameter::TIME, and CFunctionParameter::VOLUME.
Referenced by replaceInModel().
void CModelExpansion::simpleCall | ( | const CCompartment * | source, |
std::vector< std::string > | listOfMetabolites, | ||
int | mult, | ||
bool | diff | ||
) |
Definition at line 273 of file CModelExpansion.cpp.
References CModelExpansion::SetOfModelElements::addCompartment(), CModel::compileIfNecessary(), createDiffusionReaction(), CModel::createModelValue(), duplicate(), CModelExpansion::SetOfModelElements::fillDependencies(), CModelExpansion::ElementsMap::getDuplicateKey(), CModelEntity::getKey(), and mpModel.
void CModelExpansion::updateExpression | ( | CExpression * | exp, |
const std::string & | index, | ||
const SetOfModelElements & | sourceSet, | ||
ElementsMap & | emap | ||
) |
steps through an expression and replaces references to objects with references to their duplicate. (In case an object that should be duplicated according to sourceSet is not yet duplicated according to emap, the duplication is performed also)
Definition at line 952 of file CModelExpansion.cpp.
References CModelExpansion::SetOfModelElements::contains(), duplicate(), duplicateCompartment(), duplicateGlobalQuantity(), duplicateMetab(), duplicateReaction(), CModelExpansion::ElementsMap::exists(), CCopasiObject::getCN(), CModelExpansion::ElementsMap::getDuplicatePtr(), CEvaluationTree::getNodeList(), CCopasiContainer::getObject(), CCopasiObject::getObject(), CEvaluationNodeObject::getObjectCN(), CEvaluationNodeObject::getObjectInterfacePtr(), CCopasiObject::getObjectName(), CCopasiObject::getObjectParent(), CCopasiObjectName::getObjectType(), CCopasiObject::getObjectType(), CCopasiObjectName::getPrimary(), CCopasiObjectName::getRemainder(), mpSourceModel, and CEvaluationNodeObject::setData().
Referenced by duplicateCompartment(), duplicateEvent(), duplicateGlobalQuantity(), and duplicateMetab().
|
protected |
Definition at line 194 of file CModelExpansion.h.
Referenced by copyCompleteModel(), createDiffusionReaction(), createLinearArray(), createRectangularArray(), duplicateCompartment(), duplicateEvent(), duplicateGlobalQuantity(), duplicateMetab(), duplicateReaction(), existDependentEntities(), replaceInMetab(), replaceInModel(), setModel(), and simpleCall().
|
protected |
Definition at line 195 of file CModelExpansion.h.
Referenced by copyCompleteModel(), and updateExpression().