COPASI API
4.16.103
|
#include <SBMLImporter.h>
Public Member Functions | |
void | deleteCopasiModel () |
std::string | findIdInASTTree (const ASTNode *pMath, const std::set< std::string > &reactionIds) |
std::string | findIdInASTTree (const ASTNode *pMath, const std::map< std::string, double > &reactionIds) |
bool | getImportCOPASIMIRIAM () const |
CProcessReport * | getImportHandlerAddr () |
CModel * | parseSBML (const std::string &sbmlDocumentText, CFunctionDB *funDB, SBMLDocument *&pSBMLDocument, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap, CListOfLayouts *&prLol, CCopasiDataModel *pDataModel) |
CModel * | readSBML (std::string filename, CFunctionDB *funDB, SBMLDocument *&pSBMLDocument, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap, CListOfLayouts *&prLol, CCopasiDataModel *pDataModel) |
void | restoreFunctionDB () |
SBMLImporter () | |
void | setImportCOPASIMIRIAM (bool import) |
void | setImportHandler (CProcessReport *pHandler) |
~SBMLImporter () | |
Static Public Member Functions | |
static bool | areEqualFunctions (const CFunction *pFun, const CFunction *pFun2) |
static bool | areEqualSubtrees (const CEvaluationNode *pNode1, const CEvaluationNode *pNode2) |
static bool | areSBMLUnitDefinitionsIdentical (const UnitDefinition *pUdef1, const UnitDefinition *pUdef2) |
static CEvaluationNode * | divideByObject (const CEvaluationNode *pOrigNode, const CCopasiObject *pObject) |
static UnitDefinition * | getSBMLUnitDefinitionForId (const std::string &unitId, const Model *pSBMLModel) |
static bool | importNotes (CAnnotation *pAnno, const SBase *pSBase) |
Protected Member Functions | |
void | applyStoichiometricExpressions (std::map< CCopasiObject *, SBase * > &copasi2sbmlmap, Model *pSBMLModel) |
void | areRulesUnique (const Model *copasiMode) |
void | checkElementUnits (const Model *pSBMLModel, CModel *pCopasiModel, int level, int version) |
void | checkRuleMathConsistency (const Rule *pRule, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap) |
bool | containsVolume (const ASTNode *pNode, const std::string &compartmentCN) |
std::map< std::string, ASTNode * > | createBVarMap (const ASTNode *uDefFunction, const ASTNode *function) |
CCompartment * | createCCompartmentFromCompartment (const Compartment *sbmlComp, CModel *copasiModel, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap, const Model *pSBMLModel) |
CFunction * | createCFunctionFromFunctionDefinition (const FunctionDefinition *sbmlFunction, CFunctionDB *pTmpFunctionDB, Model *pSBMLModel, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap) |
CFunction * | createCFunctionFromFunctionTree (const FunctionDefinition *pSBMLFunction, Model *pSBMLModel, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap) |
CMetab * | createCMetabFromSpecies (const Species *sbmlSpecies, CModel *copasiModel, CCompartment *copasiCompartment, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap, const Model *pSBMLModel) |
CModel * | createCModelFromSBMLDocument (SBMLDocument *doc, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap) |
CModelValue * | createCModelValueFromParameter (const Parameter *sbmlParameter, CModel *copasiModel, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap) |
CReaction * | createCReactionFromReaction (Reaction *sbmlReaction, Model *sbmlModel, CModel *cmodel, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap, CFunctionDB *pTmpFunctionDB) |
void | createDelayFunctionDefinition () |
CEvaluationTree * | createExpressionFromFunction (const CFunction *pFun, const std::vector< std::vector< std::string > > &functionArgumentCNs) |
void | createHasOnlySubstanceUnitFactor (Model *pSBMLModel, double factor, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap) |
void | doMapping (CReaction *pCopasiReaction, const CEvaluationNodeCall *pCallNode) |
void | find_local_parameters_in_delay (ASTNode *pNode, Reaction *pSBMLReaction, Model *pModel, std::map< std::string, std::string > &localReplacementMap, const std::set< std::string > &localIds, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap) |
void | findAvogadroConstant (Model *pSBMLModel, double factor) |
CFunction * | findCorrespondingFunction (const CExpression *pExpression, const CReaction *reaction) |
void | findFunctionCalls (const CEvaluationNode *pNode, std::set< std::string > &functionNameSet) |
const FunctionDefinition * | getFunctionDefinitionForName (const std::string name, const Model *model) |
void | getIdsFromNode (const ASTNode *pNode, std::set< std::string > &idSet) |
std::pair< CModel::AreaUnit, bool > | handleAreaUnit (const UnitDefinition *uDef) |
std::pair< CModel::LengthUnit, bool > | handleLengthUnit (const UnitDefinition *uDef) |
std::pair < CModel::QuantityUnit, bool > | handleSubstanceUnit (const UnitDefinition *uDef) |
std::pair< CModel::TimeUnit, bool > | handleTimeUnit (const UnitDefinition *uDef) |
std::pair< CModel::VolumeUnit, bool > | handleVolumeUnit (const UnitDefinition *uDef) |
void | importEvent (const Event *pEvent, Model *pSBMLModel, CModel *pCopasiModel, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap) |
void | importEvents (Model *pSBMLModel, CModel *pCopasiModel, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap) |
CFunctionDB * | importFunctionDefinitions (Model *pSBMLModel, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap) |
void | importInitialAssignments (Model *pSBMLModel, std::map< CCopasiObject *, SBase * > &copasi2sbmlMap, const CModel *pCOPASIModel) |
bool | importMIRIAM (const SBase *pSBMLObject, CCopasiObject *pCOPASIObject) |
void | importRule (const Rule *rule, CModelEntity::Status ruleType, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap, Model *pSBMLModel) |
void | importRuleForModelEntity (const Rule *rule, CModelEntity *pMV, CModelEntity::Status ruleType, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap, Model *pSBMLModel) |
void | importSBMLRule (const Rule *sbmlRule, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap, Model *pSBMLModel) |
CCopasiObject * | isConstantFlux (const CEvaluationNode *pRoot, CModel *pModel, CFunctionDB *pFunctionDB) |
bool | isDelayFunctionUsed (ConverterASTNode *pNode) |
std::vector < CEvaluationNodeObject * > * | isMassAction (const CEvaluationTree *pTree, const CChemEq &chemicalEquation, const CEvaluationNodeCall *pCallNode=NULL) |
std::vector < CEvaluationNodeObject * > * | isMassActionExpression (const CEvaluationNode *pRootNode, const CChemEq &chemicalEquation) |
std::vector < CEvaluationNodeObject * > * | isMassActionFunction (const CFunction *pFun, const CChemEq &chemicalEquation, const std::vector< std::vector< std::string > > &functionArgumentCNs) |
ConverterASTNode * | isMultipliedByVolume (const ASTNode *node, const std::string &compartmentSBMLId) |
bool | isSimpleFunctionCall (const CEvaluationNode *pRootNode) |
bool | isStochasticModel (const Model *pSBMLModel) |
void | multiplySubstanceOnlySpeciesByVolume (ConverterASTNode *pNode) |
void | preprocessNode (ConverterASTNode *pNode, Model *pSBMLModel, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap, Reaction *pSBMLReaction=NULL) |
bool | removeUnusedFunctions (CFunctionDB *pTmpFunctionDB, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap) |
void | renameMassActionParameters (CEvaluationNodeCall *pCallNode) |
void | replace_delay_nodes (ConverterASTNode *pNode, Model *pModel, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap, Reaction *pSBMLReaction, std::map< std::string, std::string > &localReplacementMap) |
void | replace_name_nodes (ASTNode *pNode, const std::map< std::string, std::string > &replacementMap) |
void | replace_time_with_initial_time (ASTNode *pNode, const CModel *pCOPASIModel) |
void | replaceAmountReferences (ConverterASTNode *pNode, Model *pSBMLModel, double factor, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap) |
void | replaceCallNodeNames (ASTNode *pNode) |
void | replaceLog (ConverterASTNode *sourceNode) |
void | replaceObjectNames (ASTNode *pNode, const std::map< CCopasiObject *, SBase * > &copasi2sbmlmap, bool initialExpression=false) |
void | replacePowerFunctionNodes (ASTNode *node) |
void | replaceRoot (ConverterASTNode *sourceNode) |
void | replaceTimeAndAvogadroNodeNames (ASTNode *pNode) |
void | replaceTimeDependentFunctionCalls (ASTNode *root) |
bool | replaceTimeNodesInFunctionDefinition (ASTNode *root, std::string newNodeName) |
bool | sbmlId2CopasiCN (ASTNode *pNode, std::map< CCopasiObject *, SBase * > &copasi2sbmlmap, CCopasiParameterGroup &pParamGroup) |
void | separateProductArguments (const CEvaluationNode *pRootNode, std::vector< const CEvaluationNode * > &arguments) |
void | setCorrectUsage (CReaction *pCopasiReaction, const CEvaluationNodeCall *pCallNode) |
bool | setInitialValues (CModel *pModel, const std::map< CCopasiObject *, SBase * > &copasi2sbmlmap) |
CEvaluationNode * | variables2objects (const CEvaluationNode *pOrigNode, const std::map< std::string, std::string > &replacementMap) |
Static Protected Member Functions | |
static bool | areApproximatelyEqual (const double &x, const double &y, const double &t=1e-9) |
static Unit * | convertSBMLCubicmetresToLitres (const Unit *pU) |
static void | findDirectDependencies (const FunctionDefinition *pFunDef, std::map< const FunctionDefinition *, std::set< std::string > > &dependencies) |
static void | findDirectDependencies (const ASTNode *pNode, std::set< std::string > &dependencies) |
static void | normalizeSBMLUnit (Unit *pU) |
static C_FLOAT64 | round (const C_FLOAT64 &x) |
Definition at line 44 of file SBMLImporter.h.
SBMLImporter::SBMLImporter | ( | ) |
Constructor that initializes speciesMap and the FunctionDB object
Definition at line 3045 of file SBMLImporter.cpp.
References functionDB, mAssignmentToSpeciesReferenceFound, mAvogadroCreated, mDelayFound, mIgnoredSBMLMessages, mIncompleteModel, mpImportHandler, mUnitOnNumberFound, mUnsupportedAssignmentRuleFound, mUnsupportedRateRuleFound, mUnsupportedRuleFound, and speciesMap.
SBMLImporter::~SBMLImporter | ( | ) |
|
protected |
This method evaluates all stoichiometric expressions and sets them as constants on the CChemEqElement.
Definition at line 8980 of file SBMLImporter.cpp.
References CChemEq::addMetabolite(), CCopasiVector< T >::begin(), CExpression::calcValue(), CExpression::compile(), CCopasiVector< T >::end(), fatalError, CChemEqElement::getMetabolite(), CChemEqElement::getMetaboliteKey(), CChemEqElement::getMultiplicity(), CCopasiObject::getObjectParent(), CEvaluationTree::getRoot(), CModelEntity::getSBMLId(), CReaction::getSBMLId(), CChemEq::getSubstrates(), MCSBML, mpCopasiModel, mpDataModel, mStoichiometricExpressionMap, preprocessNode(), CChemEq::PRODUCT, replaceObjectNames(), CEvaluationTree::setTree(), CChemEq::SUBSTRATE, and CCopasiMessage::WARNING.
Referenced by createCModelFromSBMLDocument().
|
staticprotected |
Definition at line 177 of file SBMLImporter.cpp.
References min.
Referenced by areSBMLUnitDefinitionsIdentical(), findAvogadroConstant(), handleAreaUnit(), handleLengthUnit(), handleSubstanceUnit(), handleTimeUnit(), handleVolumeUnit(), isMassActionExpression(), and replaceAmountReferences().
Definition at line 5121 of file SBMLImporter.cpp.
References areEqualSubtrees(), CCopasiObject::getObjectName(), CEvaluationTree::getRoot(), CFunction::getVariables(), and CFunctionParameters::size().
Referenced by createCFunctionFromFunctionDefinition(), findCorrespondingFunction(), and CReaction::setFunctionFromExpressionTree().
|
static |
Compares to CEvaluationNode based subtrees recursively.
Definition at line 5159 of file SBMLImporter.cpp.
References CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getData(), CCopasiNode< _Data >::getSibling(), and CEvaluationNode::getType().
Referenced by areEqualFunctions().
|
protected |
Checks if no id is used in more than one Assignment and RateRule.
Definition at line 6662 of file SBMLImporter.cpp.
References CCopasiMessage::EXCEPTION, and MCSBML.
Referenced by createCModelFromSBMLDocument().
|
static |
Enhanced method to identify identical SBML unit definitions. This method uses the areIdentical method from libSBML, but if the method return false, it does some extra checks. Right now it check for example if two volumes, one given in litre and one given in cubic meters are identical.
Enhanced method to identify identical sbml unit definitions. The method first converts the unit definitions to SI units and simplifies them, only then they are compared.
Definition at line 8297 of file SBMLImporter.cpp.
References areApproximatelyEqual().
Referenced by CSBMLExporter::check_for_spatial_size_units(), checkElementUnits(), CSBMLExporter::createAreaUnit(), createCModelFromSBMLDocument(), CSBMLExporter::createLengthUnit(), CSBMLExporter::createSubstanceUnit(), CSBMLExporter::createTimeUnit(), and CSBMLExporter::createVolumeUnit().
|
protected |
Definition at line 7353 of file SBMLImporter.cpp.
References areSBMLUnitDefinitionsIdentical(), CModel::dimensionlessArea, CModel::dimensionlessLength, CModel::dimensionlessVolume, CCopasiMessage::EXCEPTION, fatalError, getSBMLUnitDefinitionForId(), handleAreaUnit(), handleLengthUnit(), handleSubstanceUnit(), handleTimeUnit(), handleVolumeUnit(), MCSBML, CModel::setAreaUnit(), CModel::setLengthUnit(), CModel::setTimeUnit(), CModel::setVolumeUnit(), and CCopasiMessage::WARNING.
Referenced by createCModelFromSBMLDocument().
|
protected |
Checks the expression for a give rate or assignment rule for consistency. This basically means it checks that no id present in the expression is the target for one of the following rate or assignment rules.
Definition at line 6793 of file SBMLImporter.cpp.
References CCopasiMessage::EXCEPTION, fatalError, findIdInASTTree(), getIdsFromNode(), MCSBML, mLevel, mpCopasiModel, and mVersion.
Referenced by importRuleForModelEntity().
|
protected |
Checks if the volume with the given CN is one of the parameters to the given call node.
Definition at line 6065 of file SBMLImporter.cpp.
Referenced by createCReactionFromReaction().
|
staticprotected |
If the given UnitDefinition can be converted to a form of litre, the function return the UnitDefinition in litre, otherwise NULL is returned.
Definition at line 8361 of file SBMLImporter.cpp.
References normalizeSBMLUnit(), and pResult.
Referenced by handleVolumeUnit().
|
protected |
Creates a map of each parameter of the function definition and its corresponding parameter in the function call.
Definition at line 2953 of file SBMLImporter.cpp.
References fatalError.
|
protected |
Creates and returns a COPASI CCompartment from the SBML Compartment given as argument.
Definition at line 1950 of file SBMLImporter.cpp.
References C_INVALID_INDEX, CModel::createCompartment(), CModel::getCompartments(), CCopasiVectorN< CType >::getIndex(), CCopasiContainer::getUnits(), importMIRIAM(), importNotes(), MCSBML, mLevel, CCompartment::setDimensionality(), CModelEntity::setSBMLId(), and CCopasiMessage::WARNING.
Referenced by createCModelFromSBMLDocument().
|
protected |
Creates and returns a COPASI CFunction from the SBML FunctionDefinition given as argument.
Definition at line 1727 of file SBMLImporter.cpp.
References CFunctionDB::add(), addToKnownFunctionToMap(), areEqualFunctions(), createCFunctionFromFunctionTree(), ensureAllArgsAreBeingUsedInFunctionDefinition(), CCopasiMessage::EXCEPTION, CFunctionDB::findFunction(), functionDB, CFunction::getSBMLId(), CEvaluationTree::getType(), importMIRIAM(), importNotes(), CFunctionDB::loadedFunctions(), MCSBML, mKnownCustomUserDefinedFunctions, pdelete, CCopasiObject::setObjectName(), CFunction::setSBMLId(), CCopasiVector< T >::size(), and CEvaluationTree::UserDefined.
Referenced by importFunctionDefinitions().
|
protected |
Definition at line 1806 of file SBMLImporter.cpp.
References CFunction::addVariable(), CEvaluationNodeVariable::ANY, CEvaluationTree::compile(), CCopasiMessage::EXCEPTION, CEvaluationTree::getRoot(), isDelayFunctionUsed(), MCSBML, mExplicitelyTimeDependentFunctionDefinitions, preprocessNode(), replaceTimeNodesInFunctionDefinition(), CEvaluationTree::setRoot(), CEvaluationTree::setTree(), and CEvaluationTree::updateTree().
Referenced by createCFunctionFromFunctionDefinition().
|
protected |
Creates and returns a COPASI CMetab from the given SBML Species object.
Creates and returns a Copasi CMetab from the given SBML Species object.
Definition at line 2044 of file SBMLImporter.cpp.
References C_INVALID_INDEX, CModel::createMetabolite(), fatalError, CModelEntity::FIXED, CCopasiVectorN< CType >::getIndex(), CCompartment::getMetabolites(), CCopasiObject::getObjectName(), if(), importMIRIAM(), importNotes(), mLevel, mSubstanceOnlySpecies, CModelEntity::REACTIONS, CModelEntity::setSBMLId(), and CMetab::setStatus().
Referenced by createCModelFromSBMLDocument().
|
protected |
Creates and returns a COPASI CModel from the SBMLDocument given as argument.
Creates and returns a Copasi CModel from the SBMLDocument given as argument.
Definition at line 243 of file SBMLImporter.cpp.
References CProcessReport::addItem(), applyStoichiometricExpressions(), areRulesUnique(), areSBMLUnitDefinitionsIdentical(), C_INT32, C_INVALID_INDEX, checkElementUnits(), createCCompartmentFromCompartment(), createCMetabFromSpecies(), createCModelValueFromParameter(), createCReactionFromReaction(), CModel::deterministic, CCopasiMessage::EXCEPTION, fatalError, findAvogadroConstant(), CProcessReport::finishItem(), CModel::forceCompile(), functionDB, getInitialCNForSBase(), CCopasiContainer::getObject(), getOriginalSBMLId(), CModel::getQuantity2NumberFactor(), CFunction::getSBMLId(), CCopasiMessage::getText(), handleAreaUnit(), handleLengthUnit(), handleSubstanceUnit(), handleTimeUnit(), handleVolumeUnit(), importEvents(), importFunctionDefinitions(), importInitialAssignments(), importMIRIAM(), importNotes(), importSBMLRule(), INIT_DEFAULTS, isStochasticModel(), CModel::l, CFunctionDB::loadedFunctions(), CModel::m, CModel::m2, mAvogadroCreated, mAvogadroSet, MCSBML, mDelayFound, mDivisionByCompartmentReactions, mFastReactions, mhImportStep, mIgnoredParameterUnits, mImportStep, mKnownInitalValues, mLevel, CModel::Mol, mpCopasiModel, mpDataModel, mpImportHandler, mPotentialAvogadroNumbers, mReactionsWithReplacedLocalParameters, mSubstanceOnlySpecies, mUnitOnNumberFound, mUnsupportedRuleFound, mVersion, CCopasiMessage::peekLastMessage(), CProcessReport::progressItem(), removeUnusedFunctions(), CModel::s, sbmlIdMap, CModel::setAreaUnit(), CModel::setAvogadro(), CModel::setCompileFlag(), setInitialValues(), CModel::setLengthUnit(), CModel::setModelType(), CCopasiObject::setObjectName(), CModel::setQuantityUnit(), CFunction::setSBMLId(), CModelEntity::setSBMLId(), CModel::setTimeUnit(), CModel::setVolumeUnit(), CCopasiVector< T >::size(), speciesMap, CModel::stochastic, and CCopasiMessage::WARNING.
Referenced by parseSBML().
|
protected |
Creates and returns a COPASI CModelValue from the given SBML Parameter object.
Definition at line 4436 of file SBMLImporter.cpp.
References C_INVALID_INDEX, CModel::createModelValue(), CCopasiVectorN< CType >::getIndex(), CModel::getModelValues(), importMIRIAM(), importNotes(), mIgnoredParameterUnits, mLevel, and CModelEntity::setSBMLId().
Referenced by createCModelFromSBMLDocument(), createHasOnlySubstanceUnitFactor(), find_local_parameters_in_delay(), and replace_delay_nodes().
|
protected |
Creates and returns a COPASI CReaction object from the given SBML Reaction object.
Definition at line 2146 of file SBMLImporter.cpp.
References CFunctionDB::add(), CEvaluationNodeCall::addChild(), CReaction::addModifier(), CCopasiParameterGroup::addParameter(), CReaction::addProduct(), CReaction::addSubstrate(), CCopasiVector< T >::begin(), C_FLOAT64, C_INVALID_INDEX, containsVolume(), CEvaluationNode::copyBranch(), CModel::createReaction(), doMapping(), CCopasiParameter::DOUBLE, CCopasiVector< T >::end(), CCopasiMessage::EXCEPTION, CEvaluationNodeCall::EXPRESSION, fatalError, findCorrespondingFunction(), CFunctionDB::findFunction(), findIdInASTTree(), CEvaluationTree::fromAST(), functionDB, CReaction::getChemEq(), CCopasiNode< _Data >::getChild(), CCopasiObject::getCN(), CCopasiNode< _Data >::getData(), CCompartment::getDimensionality(), CCopasiVectorN< CType >::getIndex(), CChemEq::getModifiers(), CCopasiObject::getObjectName(), CCopasiObject::getObjectType(), CReaction::getParameters(), CChemEq::getProducts(), CModel::getReactions(), CEvaluationTree::getRoot(), CModelEntity::getSBMLId(), CCopasiNode< _Data >::getSibling(), CChemEq::getSubstrates(), CEvaluationTree::getType(), CEvaluationNode::getType(), CFunction::getVariables(), importMIRIAM(), importNotes(), isConstantFlux(), isMassAction(), isMultipliedByVolume(), CReaction::isReversible(), isSimpleFunctionCall(), CFunction::isSuitable(), MCSBML, mDivisionByCompartmentReactions, mFastReactions, mIncompleteModel, mLevel, mStoichiometricExpressionMap, mUsedFunctions, CEvaluationNode::OBJECT, pdelete, preprocessNode(), CChemEq::PRODUCT, renameMassActionParameters(), sbmlId2CopasiCN(), CReaction::setFunction(), CReaction::setFunctionFromExpressionTree(), CCopasiObject::setObjectName(), CFunction::setReversible(), CReaction::setReversible(), CEvaluationTree::setRoot(), CReaction::setSBMLId(), CFunctionParameters::size(), CCopasiVector< T >::size(), speciesMap, CChemEq::SUBSTRATE, TriFalse, TriTrue, TriUnspecified, CEvaluationNode::type(), CEvaluationTree::UserDefined, variables2objects(), and CCopasiMessage::WARNING.
Referenced by createCModelFromSBMLDocument().
|
protected |
Creates a function definition for the delay function.
|
protected |
Definition at line 5516 of file SBMLImporter.cpp.
References CEvaluationTree::create(), CEvaluationTree::Expression, CCopasiObject::getObjectName(), CEvaluationTree::getRoot(), CFunction::getVariables(), CEvaluationTree::setRoot(), CFunctionParameters::size(), and variables2objects().
Referenced by isMassActionFunction().
|
protected |
This method creates a global parameter the represents the factor that is used to convert a particle number into the amount units set on the model. The parameter is only created if it is needed and after exporting the model, the parameter is deleted from the COPASI model again.
Definition at line 9106 of file SBMLImporter.cpp.
References createCModelValueFromParameter(), mAvogadroCreated, mpCopasiModel, and mPotentialAvogadroNumbers.
Referenced by replaceAmountReferences().
void SBMLImporter::deleteCopasiModel | ( | ) |
This call deletes an existing COPASI model. The method can e.g. be called to clean up if an import fails.
Definition at line 10681 of file SBMLImporter.cpp.
References mpCopasiModel.
Referenced by SEDMLImporter::importFirstSBMLModel(), CCopasiDataModel::importSBML(), and CCopasiDataModel::importSBMLFromString().
|
static |
This method divides the given expression by the given object and returns a new expression. The caller is responsible for freeing the memory for the new expression.
Definition at line 10533 of file SBMLImporter.cpp.
References CCopasiNode< _Data >::addChild(), CEvaluationNodeObject::CN, CEvaluationNode::copyBranch(), CEvaluationNodeOperator::DIVIDE, CCopasiNode< _Data >::getChild(), CCopasiObject::getCN(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::getType(), CEvaluationNodeOperator::MULTIPLY, CEvaluationNode::OBJECT, CEvaluationNode::OPERATOR, pResult, CEvaluationNode::subType(), and CEvaluationNode::type().
Referenced by importEvent(), importInitialAssignments(), and importRuleForModelEntity().
|
protected |
Definition at line 5740 of file SBMLImporter.cpp.
References CReaction::addParameterMapping(), containsKey(), fatalError, CReaction::getChemEq(), CCopasiNode< _Data >::getChild(), CEvaluationNodeObject::getData(), CReaction::getFunction(), CCopasiObject::getKey(), CChemEq::getModifiers(), CCopasiObject::getObjectParent(), CCopasiObject::getObjectType(), CChemEq::getProducts(), CChemEq::getReversibility(), CCopasiNode< _Data >::getSibling(), CChemEq::getSubstrates(), CFunction::getVariables(), CCopasiObject::isReference(), CReaction::isReversible(), CFunctionParameter::MODIFIER, mpCopasiModel, mpDataModel, CCopasiDataModel::ObjectFromName(), CFunctionParameter::PARAMETER, CFunctionParameter::PRODUCT, CReaction::setParameterMapping(), CFunctionParameters::size(), CCopasiVector< T >::size(), CFunctionParameter::SUBSTRATE, CFunctionParameter::TIME, CFunctionParameter::VARIABLE, and CFunctionParameter::VOLUME.
Referenced by createCReactionFromReaction().
|
protected |
If we replace delay nodes within kineitc laws, we have to make sure that there is no reference to a local parameter within the replaced delay node because that would mean that we end up with a reference to a local parameter in the rule for the delay replacement which is not allowed in SBML. Therefore we have to convert all local parameters which occur within a delay call into global parameters. This method finds all local parameters that have to be converted to global parameters and it already creates the necessary global parameters. The localReplacementMap returns a mapping between the is of the original parameter and the id of the new parameter it will be replaced with. This map is used in a second step to actually replace the nodes in the expression.
If we replace delay nodes within kinetic laws, we have to make sure that there is no reference to a local parameter within the replaced delay node because that would mean that we end up with a reference to a local parameter in the rule for the delay replacement which is not allowed in SBML. Therefore we have to convert all local parameters which occur within a delay call into global parameters.
Definition at line 10234 of file SBMLImporter.cpp.
References createCModelValueFromParameter(), CNodeContextIterator< Node, int >::end(), CCopasiMessage::EXCEPTION, fatalError, mpCopasiModel, mUsedSBMLIds, and CNodeContextIterator< Node, int >::next().
Referenced by replace_delay_nodes().