COPASI API
4.40.278
|
#include <CModelExpansion.h>
Classes | |
class | ElementsMap |
class | SetOfModelElements |
Public Member Functions | |
CModelExpansion (CModel *pModel) | |
std::set< const CDataObject * > | copyCompleteModel (const CModel *pSourceModel) |
void | createDiffusionReaction (const std::string &name, const CDataObject *pSubstrate, const CDataObject *pProduct, const CDataObject *pParameter) |
void | createLinearArray (const SetOfModelElements &source, size_t n, const std::set< const CDataObject * > &setOfMetabolites) |
void | createRectangularArray (const SetOfModelElements &source, size_t nx, size_t ny, const std::set< const CDataObject * > &setOfMetabolites) |
CUndoData | duplicate (const SetOfModelElements &source, const std::string &index, ElementsMap &emap) |
void | duplicateCompartment (const CCompartment *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap, CUndoData &undoData) |
void | duplicateEvent (CEvent *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap, CUndoData &undoData) |
void | duplicateGlobalQuantity (const CModelValue *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap, CUndoData &undoData) |
void | duplicateMetab (const CMetab *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap, CUndoData &undoData) |
void | duplicateReaction (const CReaction *source, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap, CUndoData &undoData) |
bool | existDependentEntities (const CDataObject *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< const CDataObject * > listOfMetabolites, int mult, bool diff) |
void | updateExpression (CExpression *exp, const std::string &index, const SetOfModelElements &sourceSet, ElementsMap &emap, CUndoData &undoData) |
Protected Attributes | |
CModel * | mpModel |
const CModel * | mpSourceModel |
CModelExpansion::CModelExpansion | ( | CModel * | pModel | ) |
std::set< const CDataObject * > CModelExpansion::copyCompleteModel | ( | const CModel * | pSourceModel | ) |
adds the contents of the source model to the current model. A list of created model elements is returned
References CModelExpansion::ElementsMap::add(), CModel::compileIfNecessary(), duplicate(), CModelExpansion::SetOfModelElements::fillComplete(), CModelExpansion::ElementsMap::getMap(), mpModel, and mpSourceModel.
Referenced by CDataModel::addModel().
void CModelExpansion::createDiffusionReaction | ( | const std::string & | name, |
const CDataObject * | pSubstrate, | ||
const CDataObject * | pProduct, | ||
const CDataObject * | pParameter | ||
) |
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.
References CReaction::addProduct(), CReaction::addSubstrate(), CModel::createReaction(), CDataObject::getKey(), mpModel, CReaction::setFunction(), CReaction::setParameterObjects(), and CReaction::setReversible().
Referenced by createLinearArray(), createRectangularArray(), and simpleCall().
void CModelExpansion::createLinearArray | ( | const SetOfModelElements & | source, |
size_t | n, | ||
const std::set< const CDataObject * > & | 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.
References CModel::compileIfNecessary(), createDiffusionReaction(), CModel::createModelValue(), duplicate(), CMetab::getCompartment(), CDataObject::getObjectName(), and mpModel.
void CModelExpansion::createRectangularArray | ( | const SetOfModelElements & | source, |
size_t | nx, | ||
size_t | ny, | ||
const std::set< const CDataObject * > & | 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.
References CModel::compileIfNecessary(), createDiffusionReaction(), CModel::createModelValue(), duplicate(), CMetab::getCompartment(), CDataObject::getObjectName(), and mpModel.
CUndoData 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
References duplicateCompartment(), duplicateEvent(), duplicateGlobalQuantity(), duplicateMetab(), duplicateReaction(), CModelExpansion::SetOfModelElements::mCompartments, CModelExpansion::SetOfModelElements::mEvents, CModelExpansion::SetOfModelElements::mGlobalQuantities, CModelExpansion::SetOfModelElements::mMetabs, and CModelExpansion::SetOfModelElements::mReactions.
Referenced by copyCompleteModel(), createLinearArray(), createRectangularArray(), replaceInExpression(), simpleCall(), and updateExpression().
void CModelExpansion::duplicateCompartment | ( | const CCompartment * | source, |
const std::string & | index, | ||
const SetOfModelElements & | sourceSet, | ||
ElementsMap & | emap, | ||
CUndoData & | undoData | ||
) |
References CModelExpansion::ElementsMap::add(), CUndoData::addPostProcessData(), CModel::createCompartment(), CUndoData::empty(), CModelExpansion::ElementsMap::exists(), CCompartment::getDimensionality(), CModelEntity::getExpression(), CModelEntity::getExpressionPtr(), CModelEntity::getInitialExpression(), CModelEntity::getInitialExpressionPtr(), CModelEntity::getInitialValue(), CModelEntity::getKey(), CAnnotation::getMiriamAnnotation(), CModelEntity::getNoiseExpression(), CModelEntity::getNoiseExpressionPtr(), CAnnotation::getNotes(), CDataObject::getObjectName(), CModelEntity::getStatus(), CModelEntity::hasNoise(), CUndoData::INSERT, mpModel, CCompartment::setDimensionality(), CModelEntity::setExpression(), CModelEntity::setHasNoise(), CModelEntity::setInitialExpression(), CAnnotation::setMiriamAnnotation(), CModelEntity::setNoiseExpression(), 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, | ||
CUndoData & | undoData | ||
) |
References CModelExpansion::ElementsMap::add(), CDataVectorN< CType >::add(), CUndoData::addPostProcessData(), CUndoData::CHANGE, CExpression::compile(), CModelExpansion::SetOfModelElements::contains(), CModel::createEvent(), CEvent::createUndoData(), CObjectInterface::DataObject(), CUndoData::empty(), CModelExpansion::ElementsMap::exists(), expressionContainsObject(), CEvent::getAssignments(), CDataObject::getCN(), CEvent::getDelayAssignment(), CEvent::getDelayExpression(), CEvent::getDelayExpressionPtr(), CModelExpansion::ElementsMap::getDuplicateFromObject(), CEventAssignment::getExpression(), CEventAssignment::getExpressionPtr(), CEvent::getFireAtInitialTime(), CDataObject::getKey(), CEvent::getKey(), CModelEntity::getKey(), CAnnotation::getMiriamAnnotation(), CAnnotation::getNotes(), CDataContainer::getObject(), CDataObject::getObjectAncestor(), CDataObject::getObjectDataModel(), CDataObject::getObjectName(), CEvent::getPersistentTrigger(), CEvent::getPriorityExpression(), CEvent::getPriorityExpressionPtr(), CEventAssignment::getTargetCN(), CEvent::getTriggerExpression(), CEvent::getTriggerExpressionPtr(), CUndoData::INSERT, mpModel, CEvent::setDelayAssignment(), CEvent::setDelayExpression(), CEventAssignment::setExpression(), CEvent::setFireAtInitialTime(), CAnnotation::setMiriamAnnotation(), CAnnotation::setNotes(), CEvent::setPersistentTrigger(), CEvent::setPriorityExpression(), CEvent::setTriggerExpression(), CEvent::toData(), and updateExpression().
Referenced by duplicate().
void CModelExpansion::duplicateGlobalQuantity | ( | const CModelValue * | source, |
const std::string & | index, | ||
const SetOfModelElements & | sourceSet, | ||
ElementsMap & | emap, | ||
CUndoData & | undoData | ||
) |
References CModelExpansion::ElementsMap::add(), CUndoData::addPostProcessData(), CModel::createModelValue(), CUndoData::empty(), CModelExpansion::ElementsMap::exists(), CModelEntity::getExpression(), CModelEntity::getExpressionPtr(), CModelEntity::getInitialExpression(), CModelEntity::getInitialExpressionPtr(), CModelEntity::getInitialValue(), CModelEntity::getKey(), CAnnotation::getMiriamAnnotation(), CModelEntity::getNoiseExpression(), CModelEntity::getNoiseExpressionPtr(), CAnnotation::getNotes(), CDataObject::getObjectName(), CModelEntity::getStatus(), CModelEntity::hasNoise(), CUndoData::INSERT, mpModel, CModelEntity::setExpression(), CModelEntity::setHasNoise(), CModelEntity::setInitialExpression(), CAnnotation::setMiriamAnnotation(), CModelEntity::setNoiseExpression(), 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, | ||
CUndoData & | undoData | ||
) |
References CModelExpansion::ElementsMap::add(), CUndoData::addPostProcessData(), CModelExpansion::SetOfModelElements::contains(), CModel::createMetabolite(), duplicateCompartment(), CUndoData::empty(), CModelExpansion::ElementsMap::exists(), CMetab::getCompartment(), CModelExpansion::ElementsMap::getDuplicateFromObject(), CModelEntity::getExpression(), CModelEntity::getExpressionPtr(), CMetab::getInitialConcentration(), CModelEntity::getInitialExpression(), CModelEntity::getInitialExpressionPtr(), CModelEntity::getKey(), CAnnotation::getMiriamAnnotation(), CModelEntity::getNoiseExpression(), CModelEntity::getNoiseExpressionPtr(), CAnnotation::getNotes(), CDataObject::getObjectName(), CModelEntity::getStatus(), CModelEntity::hasNoise(), CUndoData::INSERT, mpModel, CModelEntity::setExpression(), CModelEntity::setHasNoise(), CModelEntity::setInitialExpression(), CAnnotation::setMiriamAnnotation(), CModelEntity::setNoiseExpression(), CAnnotation::setNotes(), and updateExpression().
Referenced by duplicate(), duplicateReaction(), and updateExpression().
void CModelExpansion::duplicateReaction | ( | const CReaction * | source, |
const std::string & | index, | ||
const SetOfModelElements & | sourceSet, | ||
ElementsMap & | emap, | ||
CUndoData & | undoData | ||
) |
References CModelExpansion::ElementsMap::add(), CReaction::addModifier(), CUndoData::addPostProcessData(), CReaction::addProduct(), CReaction::addSubstrate(), CModelExpansion::SetOfModelElements::contains(), CModel::createReaction(), duplicateCompartment(), duplicateGlobalQuantity(), duplicateMetab(), CUndoData::empty(), CModelExpansion::ElementsMap::exists(), CReaction::getChemEq(), CModelExpansion::ElementsMap::getDuplicateFromObject(), CReaction::getFunction(), CReaction::getFunctionParameters(), CReaction::getKey(), CModelEntity::getKey(), CReaction::getKineticLawUnitType(), CChemEqElement::getMetabolite(), CAnnotation::getMiriamAnnotation(), CChemEq::getModifiers(), CChemEqElement::getMultiplicity(), CReaction::getNoiseExpression(), CReaction::getNoiseExpressionPtr(), CAnnotation::getNotes(), CDataObject::getObjectName(), CCopasiParameterGroup::getParameter(), CReaction::getParameterObjects(), CReaction::getParameters(), CReaction::getParameterValue(), CChemEq::getProducts(), CReaction::getScalingCompartment(), CChemEq::getSubstrates(), CReaction::hasNoise(), CUndoData::INSERT, CReaction::isFast(), CReaction::isLocalParameter(), CReaction::isReversible(), CFunctionParameter::MODIFIER, mpModel, CFunctionParameter::PARAMETER, CFunctionParameter::PRODUCT, CReaction::setFast(), CReaction::setFunction(), CReaction::setHasNoise(), CReaction::setKineticLawUnitType(), CAnnotation::setMiriamAnnotation(), CReaction::setNoiseExpression(), CAnnotation::setNotes(), CReaction::setParameterObjects(), CReaction::setParameterValue(), CReaction::setReversible(), CReaction::setScalingCompartment(), CDataVector< CType >::size(), CFunctionParameters::size(), CFunctionParameter::SUBSTRATE, CFunctionParameter::TIME, updateExpression(), and CFunctionParameter::VOLUME.
Referenced by duplicate(), and updateExpression().
bool CModelExpansion::existDependentEntities | ( | const CDataObject * | pObj | ) |
Tests if there are model elements that refer to the given model entity
References CModelExpansion::SetOfModelElements::addObject(), CModelExpansion::SetOfModelElements::fillDependencies(), CModelExpansion::SetOfModelElements::mCompartments, CModelExpansion::SetOfModelElements::mEvents, CModelExpansion::SetOfModelElements::mGlobalQuantities, CModelExpansion::SetOfModelElements::mMetabs, mpModel, and CModelExpansion::SetOfModelElements::mReactions.
bool CModelExpansion::expressionContainsObject | ( | const CExpression * | exp, |
const SetOfModelElements & | sourceSet | ||
) |
Check if a given expression contains any of the objects in the sourceSet
References CModelExpansion::SetOfModelElements::contains(), CEvaluationTree::getNodeList(), CEvaluationNodeObject::getObjectInterfacePtr(), and CDataObject::getObjectParent().
Referenced by duplicateEvent().
void CModelExpansion::replaceInCompartment | ( | CCompartment * | pX, |
const ElementsMap & | emap | ||
) |
References replaceInModelEntity().
Referenced by replaceInModel().
void CModelExpansion::replaceInEvent | ( | CEvent * | pX, |
const ElementsMap & | emap | ||
) |
References CEvent::getAssignments(), CDataObject::getCN(), CEvent::getDelayExpressionPtr(), CModelExpansion::ElementsMap::getDuplicateFromObject(), CEventAssignment::getExpressionPtr(), CEventAssignment::getTargetObject(), CEvent::getTriggerExpressionPtr(), replaceInExpression(), and CEventAssignment::setTargetCN().
Referenced by replaceInModel().
void CModelExpansion::replaceInExpression | ( | CExpression * | exp, |
const ElementsMap & | emap | ||
) |
References duplicate(), CDataObject::getCN(), CModelExpansion::ElementsMap::getDuplicateFromObject(), CEvaluationTree::getNodeList(), CUndoData::getObject(), CEvaluationNodeObject::getObjectInterfacePtr(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CDataObject::getObjectType(), and CEvaluationNodeObject::setData().
Referenced by replaceInEvent(), and replaceInModelEntity().
void CModelExpansion::replaceInMetab | ( | CMetab * | pX, |
const ElementsMap & | emap | ||
) |
References CCompartment::addMetabolite(), CModelExpansion::ElementsMap::exists(), CDataObject::getCN(), CMetab::getCompartment(), CModelExpansion::ElementsMap::getDuplicateFromObject(), CCompartment::getMetabolites(), CDataObject::getObjectName(), CRegisteredCommonName::handle(), CModel::initializeMetabolites(), CRegisteredCommonName::isEnabled(), mpModel, CDataVectorN< CType >::remove(), replaceInModelEntity(), CModel::setCompileFlag(), CRegisteredCommonName::setEnabled(), and CDataObject::setObjectName().
Referenced by replaceInModel().
void CModelExpansion::replaceInModel | ( | const ElementsMap & | emap, |
bool | remove | ||
) |
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(), and replaceInReaction().
void CModelExpansion::replaceInModelEntity | ( | CModelEntity * | pX, |
const ElementsMap & | emap | ||
) |
References CModelEntity::getExpressionPtr(), CModelEntity::getInitialExpressionPtr(), CModelEntity::getNoiseExpressionPtr(), and replaceInExpression().
Referenced by replaceInCompartment(), replaceInMetab(), and replaceInModel().
void CModelExpansion::replaceInReaction | ( | CReaction * | pX, |
const ElementsMap & | emap | ||
) |
References CReaction::compile(), CChemEq::getBalances(), CReaction::getChemEq(), CModelExpansion::ElementsMap::getDuplicateFromObject(), CReaction::getFunctionParameters(), CModelEntity::getKey(), CChemEqElement::getMetabolite(), CChemEq::getModifiers(), CReaction::getParameterObjects(), CChemEq::getProducts(), CChemEq::getSubstrates(), CFunctionParameter::MODIFIER, CFunctionParameter::PARAMETER, CFunctionParameter::PRODUCT, CChemEqElement::setMetabolite(), CReaction::setParameterObjects(), CDataVector< CType >::size(), CFunctionParameters::size(), CFunctionParameter::SUBSTRATE, CFunctionParameter::TIME, and CFunctionParameter::VOLUME.
Referenced by replaceInModel().
void CModelExpansion::setModel | ( | CModel * | pModel | ) |
References mpModel.
Referenced by CModelExpansion::SetOfModelElements::addObject(), and CModelExpansion::SetOfModelElements::fillComplete().
void CModelExpansion::simpleCall | ( | const CCompartment * | source, |
std::vector< const CDataObject * > | listOfMetabolites, | ||
int | mult, | ||
bool | diff | ||
) |
void CModelExpansion::updateExpression | ( | CExpression * | exp, |
const std::string & | index, | ||
const SetOfModelElements & | sourceSet, | ||
ElementsMap & | emap, | ||
CUndoData & | undoData | ||
) |
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)
References CModelExpansion::SetOfModelElements::contains(), duplicate(), duplicateCompartment(), duplicateGlobalQuantity(), duplicateMetab(), duplicateReaction(), CModelExpansion::ElementsMap::exists(), CDataObject::getCN(), CModelExpansion::ElementsMap::getDuplicateFromObject(), CEvaluationTree::getNodeList(), CDataContainer::getObject(), CUndoData::getObject(), CEvaluationNodeObject::getObjectCN(), CEvaluationNodeObject::getObjectInterfacePtr(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CCommonName::getObjectType(), CDataObject::getObjectType(), CCommonName::getPrimary(), CCommonName::getRemainder(), mpSourceModel, and CEvaluationNodeObject::setData().
Referenced by duplicateCompartment(), duplicateEvent(), duplicateGlobalQuantity(), duplicateMetab(), and duplicateReaction().
|
protected |
Referenced by CModelExpansion::SetOfModelElements::contains(), copyCompleteModel(), createDiffusionReaction(), createLinearArray(), createRectangularArray(), duplicateCompartment(), duplicateEvent(), duplicateGlobalQuantity(), duplicateMetab(), duplicateReaction(), existDependentEntities(), CModelExpansion::SetOfModelElements::fillDependencies(), replaceInMetab(), replaceInModel(), setModel(), CModelExpansion::SetOfModelElements::setModel(), and simpleCall().
|
protected |
Referenced by copyCompleteModel(), and updateExpression().