COPASI API
4.40.278
|
#include <SBMLImporter.h>
Public Member Functions | |
void | applyConversionFactors () |
virtual void | clearCallBack () |
void | deleteCopasiModel () |
std::string | findIdInASTTree (const ASTNode *pMath, const std::map< std::string, double > &reactionIds) |
std::string | findIdInASTTree (const ASTNode *pMath, const std::set< std::string > &reactionIds) |
bool | getImportCOPASIMIRIAM () const |
const CProcessReport * | getProcessReport () const |
CModel * | parseSBML (const std::string &sbmlDocumentText, SBMLDocument *&pSBMLDocument, std::map< const CDataObject *, SBase * > &copasi2sbmlmap, CListOfLayouts *&prLol, CDataModel *pDataModel) |
CModel * | readSBML (std::string filename, SBMLDocument *&pSBMLDocument, std::map< const CDataObject *, SBase * > &copasi2sbmlmap, CListOfLayouts *&prLol, CDataModel *pDataModel) |
void | restoreFunctionDB () |
SBMLImporter () | |
void | setImportCOPASIMIRIAM (bool import) |
void | setImportHandler (CProcessReport *pProcessReport) |
~SBMLImporter () | |
Public Member Functions inherited from SBMLUnitSupport | |
void | checkElementUnits (const Model *pSBMLModel, CModel *pCopasiModel) |
bool | createUnitExpressionFor (SUnitInfo &unitInfo) const |
const SUnitInfo & | importUnit (const std::string unitId, const Model *pSBMLModel) |
const SUnitInfo & | importUnit (const UnitDefinition *pUnitDefinition, const bool &allocated) |
void | importUnitsFromSBMLDocument (Model *sbmlModel, CModel *pCopasiModel) |
imports the units from the given sbml model More... | |
void | setLevelAndVersion (int level, int version) |
bool | validateUnit (SUnitInfo &unitInfo, const std::string &constraint) const |
~SBMLUnitSupport () | |
Static Public Member Functions | |
static bool | areApproximatelyEqual (const double &x, const double &y, const double &t=1e-9) |
static bool | areEqualFunctions (const CFunction *pFun, const CFunction *pFun2) |
static bool | areEqualSubtrees (const CEvaluationNode *pNode1, const CEvaluationNode *pNode2) |
static bool | checkForUnitsOnNumbers (const ASTNode *pNode) |
static CEvaluationNode * | divideByObject (const CEvaluationNode *pOrigNode, const CDataObject *pObject) |
static bool | importNotes (CAnnotation *pAnno, const SBase *pSBase) |
static bool | isEmptyOrWhiteSpace (const std::string &name) |
static void | updateSBMLSpeciesReferenceIds (Model *pModel, std::map< std::string, double > &ids) |
Static Public Member Functions inherited from SBMLUnitSupport | |
static bool | areSBMLUnitDefinitionsIdentical (const SUnitInfo &unitInfo1, const SUnitInfo &unitInfo2) |
static void | checkForSpatialSizeUnits (const CDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static std::string | unitKindToString (UnitKind_t kind) |
Protected Member Functions | |
void | applyStoichiometricExpressions (std::map< const CDataObject *, SBase * > &copasi2sbmlmap, Model *pSBMLModel) |
void | areRulesUnique (const Model *copasiMode) |
void | checkRuleMathConsistency (const Rule *pRule, std::map< const CDataObject *, SBase * > &copasi2sbmlmap) |
bool | checkValidityOfSourceDocument (SBMLDocument *sbmlDoc) |
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< const CDataObject *, SBase * > &copasi2sbmlmap, const Model *pSBMLModel) |
CFunction * | createCFunctionFromFunctionDefinition (const FunctionDefinition *sbmlFunction, Model *pSBMLModel, std::map< const CDataObject *, SBase * > &copasi2sbmlmap) |
CFunction * | createCFunctionFromFunctionTree (const FunctionDefinition *pSBMLFunction, Model *pSBMLModel, std::map< const CDataObject *, SBase * > &copasi2sbmlmap) |
CMetab * | createCMetabFromSpecies (const Species *sbmlSpecies, CModel *copasiModel, CCompartment *copasiCompartment, std::map< const CDataObject *, SBase * > &copasi2sbmlmap, const Model *pSBMLModel) |
CModel * | createCModelFromSBMLDocument (SBMLDocument *doc, std::map< const CDataObject *, SBase * > &copasi2sbmlmap) |
CModelValue * | createCModelValueFromParameter (const Parameter *sbmlParameter, CModel *copasiModel, std::map< const CDataObject *, SBase * > &copasi2sbmlmap) |
CReaction * | createCReactionFromReaction (Reaction *sbmlReaction, Model *sbmlModel, CModel *cmodel, std::map< const CDataObject *, SBase * > &copasi2sbmlmap) |
void | createDelayFunctionDefinition () |
CEvaluationTree * | createExpressionFromFunction (const CFunction *pFun, const std::vector< std::vector< std::string > > &functionArgumentCNs) |
void | createHasOnlySubstanceUnitFactor (Model *pSBMLModel, double factor, std::map< const CDataObject *, SBase * > &copasi2sbmlmap) |
bool | createProgressStepOrStop (unsigned C_INT32 globalStep, unsigned C_INT32 currentTotal, const std::string &title) |
bool | divideByVolume (ASTNode *node, const std::string &compartmentSBMLId) |
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< const CDataObject *, 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) |
void | finishCurrentStep () |
void | finishImport () |
const FunctionDefinition * | getFunctionDefinitionForName (const std::string &name, const Model *model) |
void | getIdsFromNode (const ASTNode *pNode, std::set< std::string > &idSet) |
void | importEvent (const Event *pEvent, Model *pSBMLModel, CModel *pCopasiModel, std::map< const CDataObject *, SBase * > &copasi2sbmlmap) |
void | importEvents (Model *pSBMLModel, CModel *pCopasiModel, std::map< const CDataObject *, SBase * > &copasi2sbmlmap) |
void | importFunctionDefinitions (Model *pSBMLModel, std::map< const CDataObject *, SBase * > &copasi2sbmlmap) |
void | importInitialAssignments (Model *pSBMLModel, std::map< const CDataObject *, SBase * > &copasi2sbmlMap, const CModel *pCOPASIModel) |
bool | importMIRIAM (const SBase *pSBMLObject, CDataObject *pCOPASIObject) |
void | importRule (const Rule *rule, CModelEntity::Status ruleType, std::map< const CDataObject *, SBase * > &copasi2sbmlmap, Model *pSBMLModel) |
void | importRuleForModelEntity (const Rule *rule, const CModelEntity *pMV, CModelEntity::Status ruleType, std::map< const CDataObject *, SBase * > &copasi2sbmlmap, Model *pSBMLModel) |
void | importSBMLRule (const Rule *sbmlRule, std::map< const CDataObject *, SBase * > &copasi2sbmlmap, Model *pSBMLModel) |
const CDataObject * | isConstantFlux (const CEvaluationNode *pRoot, CModel *pModel) |
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) |
bool | isSimpleFunctionCall (const CEvaluationNode *pRootNode) |
bool | isStochasticModel (const Model *pSBMLModel) |
void | multiplySubstanceOnlySpeciesByVolume (ConverterASTNode *pNode) |
void | preprocessNode (ConverterASTNode *pNode, Model *pSBMLModel, std::map< const CDataObject *, SBase * > &copasi2sbmlmap, Reaction *pSBMLReaction=NULL) |
bool | removeUnusedFunctions (std::map< const CDataObject *, SBase * > &copasi2sbmlmap) |
void | renameMassActionParameters (CEvaluationNodeCall *pCallNode) |
void | replace_delay_nodes (ConverterASTNode *pNode, Model *pModel, std::map< const CDataObject *, 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< const CDataObject *, SBase * > &copasi2sbmlmap) |
void | replaceCallNodeNames (ASTNode *pNode) |
void | replaceLog (ConverterASTNode *sourceNode) |
void | replaceObjectNames (ASTNode *pNode, const std::map< const CDataObject *, 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 | reportCurrentProgressOrStop () |
bool | sbmlId2CopasiCN (ASTNode *pNode, std::map< const CDataObject *, SBase * > &copasi2sbmlmap, CCopasiParameterGroup &pParamGroup, SBase *pParentObject=NULL) |
void | separateProductArguments (const CEvaluationNode *pRootNode, std::vector< const CEvaluationNode * > &arguments) |
void | setCorrectUsage (CReaction *pCopasiReaction, const CEvaluationNodeCall *pCallNode) |
bool | setInitialValues (CModel *pModel, const std::map< const CDataObject *, SBase * > &copasi2sbmlmap) |
CEvaluationNode * | variables2objects (const CEvaluationNode *pOrigNode, const std::map< std::string, std::string > &replacementMap) |
Static Protected Member Functions | |
static void | findDirectDependencies (const ASTNode *pNode, std::set< std::string > &dependencies) |
static void | findDirectDependencies (const FunctionDefinition *pFunDef, std::map< const FunctionDefinition *, std::set< std::string > > &dependencies) |
static C_FLOAT64 | round (const C_FLOAT64 &x) |
Additional Inherited Members | |
Public Types inherited from SBMLUnitSupport | |
enum class | UnitType { dimensionless , substance , time , volume , area , length , other , __SIZE } |
SBMLImporter::SBMLImporter | ( | ) |
Constructor that initializes speciesMap and the FunctionDB object
References mAssignmentToSpeciesReferenceFound, mAvogadroCreated, mChemEqElementSpeciesIdMap, mConversionFactorFound, mDelayFound, mEventAssignmentForSpeciesReferenceIgnored, mIgnoredSBMLMessages, mIncompleteModel, mpModelConversionFactor, mpProcessReport, mRateRuleForSpeciesReferenceIgnored, mSBMLIdModelValueMap, mSpeciesConversionParameterMap, mUnitOnNumberFound, mUnsupportedAssignmentRuleFound, mUnsupportedRateRuleFound, mUnsupportedRuleFound, and speciesMap.
SBMLImporter::~SBMLImporter | ( | ) |
Destructor that does nothing.
References mpSbmlCallback, and pdelete.
void SBMLImporter::applyConversionFactors | ( | ) |
This method checks if there are conversion factors that need to be applied to ChemicalEquationElements and applies them.
References CCopasiMessage::EXCEPTION, CModelEntity::getInitialValue(), mChemEqElementSpeciesIdMap, mpModelConversionFactor, mSpeciesConversionParameterMap, and CChemEq::setMultiplicity().
Referenced by createCModelFromSBMLDocument().
|
protected |
This method evaluates all stoichiometric expressions and sets them as constants on the CChemEqElement.
References CChemEq::addMetabolite(), CDataVector< CType >::begin(), CExpression::calcValue(), CExpression::compile(), CDataVector< CType >::end(), fatalError, CChemEqElement::getMetabolite(), CChemEqElement::getMetaboliteKey(), CChemEqElement::getMultiplicity(), CDataObject::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().
|
static |
References min.
Referenced by findAvogadroConstant(), CEvaluationNodeFunction::fromAST(), isMassActionExpression(), and replaceAmountReferences().
References areEqualSubtrees(), CDataObject::getObjectName(), CEvaluationTree::getRoot(), CFunctionParameter::getUsage(), CFunction::getVariables(), CFunctionParameters::size(), and CFunctionParameter::VARIABLE.
Referenced by createCFunctionFromFunctionDefinition(), findCorrespondingFunction(), and CReaction::setFunctionFromExpressionTree().
|
static |
Compares to CEvaluationNode based subtrees recursively.
References CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getData(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::mainType(), and CEvaluationNode::subType().
Referenced by areEqualFunctions().
|
protected |
Checks if no id is used in more than one Assignment and RateRule.
References CCopasiMessage::EXCEPTION, and MCSBML.
Referenced by createCModelFromSBMLDocument().
|
static |
This method check if a unit has been set on a number node. If such a node is found in the tree, true is returned.
References CNodeContextIterator< Node, Context >::end(), and CNodeContextIterator< Node, Context >::next().
Referenced by preprocessNode().
|
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.
References CCopasiMessage::EXCEPTION, fatalError, findIdInASTTree(), getIdsFromNode(), MCSBML, SBMLUnitSupport::mLevel, mpCopasiModel, mReactions, and SBMLUnitSupport::mVersion.
Referenced by importRuleForModelEntity().
|
protected |
checks the given document, and if not valid stops
sbmlDoc | the document to be checked |
References CCopasiMessage::ERROR, CCopasiMessage::ERROR_FILTERED, CCopasiMessage::EXCEPTION, finishCurrentStep(), finishImport(), CRootContainer::getConfiguration(), CDataModel::getReferenceDirectory(), MCSBML, MCXML, mIgnoredSBMLMessages, mpDataModel, CCopasiMessage::RAW, CCopasiMessage::WARNING, and CCopasiMessage::WARNING_FILTERED.
Referenced by parseSBML().
|
virtual |
clears the currently set progress handler
References setImportHandler().
|
protected |
Checks if the volume with the given CN is one of the parameters to the given call node.
|
protected |
Creates a map of each parameter of the function definition and its corresponding parameter in the function call.
References fatalError.
|
protected |
Creates and returns a COPASI CCompartment from the SBML Compartment given as argument.
References C_INVALID_INDEX, CModel::createCompartment(), CModel::getCompartments(), CDataVectorN< CType >::getIndex(), CCompartment::getUnits(), importMIRIAM(), importNotes(), isEmptyOrWhiteSpace(), MCSBML, SBMLUnitSupport::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.
References CFunctionDB::add(), addToKnownFunctionToMap(), areEqualFunctions(), createCFunctionFromFunctionTree(), ensureAllArgsAreBeingUsedInFunctionDefinition(), CCopasiMessage::EXCEPTION, findFunction(), CRootContainer::getFunctionList(), CDataObject::getObjectName(), CFunction::getSBMLId(), CEvaluationTree::getType(), importMIRIAM(), importNotes(), isEmptyOrWhiteSpace(), CFunctionDB::loadedFunctions(), mCreatedFunctions, MCSBML, mKnownCustomUserDefinedFunctions, pdelete, CDataObject::setObjectName(), CFunction::setSBMLId(), CDataVector< CType >::size(), and CEvaluationTree::UserDefined.
Referenced by importFunctionDefinitions().
|
protected |
References CFunction::addVariable(), CEvaluationTree::compile(), CCopasiMessage::ERROR, CCopasiMessage::EXCEPTION, CEvaluationTree::getRoot(), isDelayFunctionUsed(), isEmptyOrWhiteSpace(), MCSBML, mExplicitelyTimeDependentFunctionDefinitions, preprocessNode(), ConverterASTNode::removeChild(), replaceTimeNodesInFunctionDefinition(), and CEvaluationTree::setTree().
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.
References C_INVALID_INDEX, CModel::createMetabolite(), fatalError, CModelEntity::FIXED, CDataVectorN< CType >::getIndex(), CCompartment::getMetabolites(), CDataObject::getObjectName(), importMIRIAM(), importNotes(), isEmptyOrWhiteSpace(), SBMLUnitSupport::mLevel, mSubstanceOnlySpecies, CModelEntity::REACTIONS, CModelEntity::setSBMLId(), and CModelEntity::setStatus().
Referenced by createCModelFromSBMLDocument().
|
protected |
Creates and returns a COPASI CModel from the SBMLDocument given as argument.
References CModel::appendAllDependents(), applyConversionFactors(), applyStoichiometricExpressions(), areRulesUnique(), CDataVector< CType >::begin(), C_INT32, C_INVALID_INDEX, CModel::compileIfNecessary(), CCore::Concentration, createCCompartmentFromCompartment(), createCMetabFromSpecies(), createCModelValueFromParameter(), createCReactionFromReaction(), createProgressStepOrStop(), CModel::deterministic, CDataVector< CType >::end(), CCopasiMessage::ERROR, CCopasiMessage::EXCEPTION, fatalError, findAvogadroConstant(), CDataObject::getCN(), CReaction::getFluxReference(), CRootContainer::getFunctionList(), getInitialCNForSBase(), CModelEntity::getModel(), CModel::getModelValues(), CDataContainer::getObject(), getOriginalSBMLId(), CModel::getQuantity2NumberFactor(), CModel::getReactions(), CFunction::getSBMLId(), CReaction::getSBMLId(), CCopasiMessage::getText(), importEvents(), importFunctionDefinitions(), importInitialAssignments(), importMIRIAM(), importNotes(), importSBMLRule(), SBMLUnitSupport::importUnitsFromSBMLDocument(), isEmptyOrWhiteSpace(), isStochasticModel(), CFunctionDB::loadedFunctions(), mAvogadroCreated, mCompartmentMap, mConversionFactorFound, MCSBML, mCurrentStepCounter, mCurrentStepHandle, mCurrentStepTotal, mDelayFound, mDivisionByCompartmentReactions, mEventAssignmentForSpeciesReferenceIgnored, mFastReactions, mIgnoredParameterUnits, mKnownInitalValues, SBMLUnitSupport::mLevel, mParameterFluxMap, mpCopasiModel, mpDataModel, mpModelConversionFactor, mPotentialAvogadroNumbers, mpProcessReport, mRateRuleForSpeciesReferenceIgnored, mReactions, mReactionsWithReplacedLocalParameters, mSBMLIdModelValueMap, mSBMLSpeciesReferenceIds, mSpeciesConversionParameterMap, mSubstanceOnlySpecies, mUnitOnNumberFound, mUnsupportedRuleFound, CCopasiMessage::peekLastMessage(), CModel::removeModelValue(), removeUnusedFunctions(), reportCurrentProgressOrStop(), sbmlIdMap, CModel::setAreaUnit(), setInitialValues(), CModel::setLengthUnit(), CModel::setModelType(), CDataObject::setObjectName(), CModel::setQuantityUnit(), CFunction::setSBMLId(), CModelEntity::setSBMLId(), CModel::setTimeUnit(), CModel::setVolumeUnit(), CDataVector< CType >::size(), speciesMap, CModel::stochastic, updateSBMLSpeciesReferenceIds(), and CCopasiMessage::WARNING.
Referenced by parseSBML().
|
protected |
Creates and returns a COPASI CModelValue from the given SBML Parameter object.
References C_INVALID_INDEX, CModel::createModelValue(), SBMLUnitSupport::SUnitInfo::expression, CDataVectorN< CType >::getIndex(), CModel::getModelValues(), importMIRIAM(), importNotes(), SBMLUnitSupport::importUnit(), isEmptyOrWhiteSpace(), SBMLUnitSupport::mLevel, mSBMLIdModelValueMap, CModelEntity::setSBMLId(), CModelEntity::setUnitExpression(), SBMLUnitSupport::unitKindToString(), and SBMLUnitSupport::SUnitInfo::valid.
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.
References CEvaluationNodeCall::addChild(), CReaction::addModifier(), CCopasiParameterGroup::addParameter(), CReaction::addProduct(), CReaction::addSubstrate(), CModelEntity::ASSIGNMENT, CDataVector< CType >::begin(), C_FLOAT64, C_INVALID_INDEX, CEvaluationNode::copyBranch(), CModel::createModelValue(), CModel::createReaction(), divideByVolume(), doMapping(), CCopasiParameter::DOUBLE, CDataVector< CType >::end(), CCopasiMessage::EXCEPTION, CEvaluationNode::EXPRESSION, fatalError, findCorrespondingFunction(), CFunctionDB::findFunction(), findIdInASTTree(), CEvaluationTree::fromAST(), CReaction::getChemEq(), CCopasiNode< _Data >::getChild(), CDataObject::getCN(), CCopasiNode< _Data >::getData(), CCompartment::getDimensionality(), CRootContainer::getFunctionList(), CDataVectorN< CType >::getIndex(), CDataObject::getKey(), CChemEq::getModifiers(), CDataObject::getObjectName(), CDataObject::getObjectType(), CReaction::getParameters(), CChemEq::getProducts(), CModel::getReactions(), CEvaluationTree::getRoot(), CModelEntity::getSBMLId(), CCopasiNode< _Data >::getSibling(), CChemEq::getSubstrates(), CEvaluationTree::getType(), CFunction::getVariables(), importMIRIAM(), importNotes(), isConstantFlux(), isEmptyOrWhiteSpace(), isMassAction(), CReaction::isReversible(), isSimpleFunctionCall(), CFunction::isSuitable(), CFunctionDB::loadedFunctions(), CEvaluationNode::mainType(), mChemEqElementSpeciesIdMap, mCreatedFunctions, MCSBML, mDivisionByCompartmentReactions, mFastReactions, mIncompleteModel, SBMLUnitSupport::mLevel, mParameterFluxMap, mpCopasiModel, mpModelConversionFactor, mReactions, mSBMLSpeciesReferenceIds, mSpeciesConversionParameterMap, mStoichiometricExpressionMap, CEvaluationNode::OBJECT, pdelete, preprocessNode(), CChemEq::PRODUCT, renameMassActionParameters(), renameShadowingFluxReferences(), replace_name_nodes(), sbmlId2CopasiCN(), CReaction::setFunction(), CReaction::setFunctionFromExpressionTree(), CModelEntity::setInitialExpression(), CDataObject::setObjectName(), CReaction::setReversible(), CFunction::setReversible(), CEvaluationTree::setRoot(), CModelEntity::setSBMLId(), CReaction::setSBMLId(), CModelEntity::setStatus(), CDataVector< CType >::size(), CFunctionParameters::size(), speciesMap, CChemEq::SUBSTRATE, TriFalse, TriTrue, TriUnspecified, CEvaluationTree::UserDefined, variables2objects(), and CCopasiMessage::WARNING.
Referenced by createCModelFromSBMLDocument().
|
protected |
Creates a function definition for the delay function.
|
protected |
|
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.
References createCModelValueFromParameter(), mAvogadroCreated, mpCopasiModel, mPotentialAvogadroNumbers, and CModelEntity::setInitialValue().
Referenced by replaceAmountReferences().
|
protected |
This utility functions adds a new step to the progress dialog (if present)
globalStep | the global steps that have been completed |
currentTotal | the total for current task |
title | the title of the current task |
References CProcessReport::addItem(), C_INVALID_INDEX, CProcessReport::finishItem(), mCurrentStepCounter, mCurrentStepHandle, mCurrentStepTotal, mGlobalStepCounter, mGlobalStepHandle, mpProcessReport, and CProcessReport::progressItem().
Referenced by createCModelFromSBMLDocument(), parseSBML(), and removeUnusedFunctions().
void SBMLImporter::deleteCopasiModel | ( | ) |
This call deletes an existing COPASI model. The method can e.g. be called to clean up if an import fails.
References mpCopasiModel.
Referenced by SEDMLImporter::importModel(), CDataModel::importSBML(), and CDataModel::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.
References CCopasiNode< _Data >::addChild(), CEvaluationNode::CN, CEvaluationNode::copyBranch(), CEvaluationNode::DIVIDE, CCopasiNode< _Data >::getChild(), CDataObject::getCN(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::mainType(), CEvaluationNode::MULTIPLY, CEvaluationNode::OBJECT, CEvaluationNode::OPERATOR, and CEvaluationNode::subType().
Referenced by importEvent(), importInitialAssignments(), and importRuleForModelEntity().
|
protected |
Checks if a compartment size node occurs multiplicatively in the tree. If so, it is removed from the tree. If it returns false, the tree was not changed
Referenced by createCReactionFromReaction().
|
protected |
References containsKey(), CObjectInterface::DataObject(), fatalError, CReaction::getChemEq(), CCopasiNode< _Data >::getChild(), CEvaluationNodeObject::getData(), CReaction::getFunction(), CDataObject::getKey(), CChemEq::getModifiers(), CDataObject::getObjectFromCN(), CDataObject::getObjectParent(), CDataObject::getObjectType(), CChemEq::getProducts(), CChemEq::getReversibility(), CCopasiNode< _Data >::getSibling(), CChemEq::getSubstrates(), CFunction::getVariables(), CDataObject::hasFlag(), CReaction::isReversible(), CFunctionParameter::MODIFIER, mpCopasiModel, CFunctionParameter::PARAMETER, CFunctionParameter::PRODUCT, CDataObject::Reference, CReaction::setParameterObjects(), CDataVector< CType >::size(), CFunctionParameters::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.
References createCModelValueFromParameter(), CNodeContextIterator< Node, Context >::end(), CCopasiMessage::EXCEPTION, fatalError, mpCopasiModel, mUsedSBMLIds, and CNodeContextIterator< Node, Context >::next().
Referenced by replace_delay_nodes().
|
protected |
This method goes through the list of global parameters and tries to find a parameter that could correspond to avogadros number.
References areApproximatelyEqual(), and mPotentialAvogadroNumbers.
Referenced by createCModelFromSBMLDocument().
|
protected |
The methods gets a function where all the parameters have a usage of "PARAMETER". In addition it get the root node of a call to that function which is an expression and contains the actual objects with which the function is called in a certain reaction. From this expression we can determine if there already is a function in the database that does the same. Or we can find out if this function is a Mass Action kinetic.
References areEqualFunctions(), C_INVALID_INDEX, CFunctionDB::findFunction(), CReaction::getChemEq(), CCopasiNode< _Data >::getData(), CRootContainer::getFunctionList(), CDataObject::getObjectName(), CReaction::getParameterIndex(), CChemEq::getProducts(), CEvaluationTree::getRoot(), CChemEq::getSubstrates(), CFunction::getVariables(), CReaction::isReversible(), CDataVector< CType >::size(), CEvaluationTree::size(), CFunctionParameters::size(), TriFalse, and TriTrue.
Referenced by createCReactionFromReaction().
|
staticprotected |
static method that recursively finds all direct function dependencies of the expression rooted at the given node.
References findDirectDependencies().
|
staticprotected |
static method that finds all direct function dependencies of a given function definition.
Referenced by findDirectDependencies(), and importFunctionDefinitions().
|
protected |
Finds all functions calls directly or indirectly used in a function tree.
References CEvaluationNode::CALL, CFunctionDB::findFunction(), CRootContainer::getFunctionList(), CDataObject::getObjectName(), CEvaluationTree::getRoot(), and CDataContainer::insert().
Referenced by removeUnusedFunctions().
std::string SBMLImporter::findIdInASTTree | ( | const ASTNode * | pASTNode, |
const std::map< std::string, double > & | reactionIds | ||
) |
This method takes an AST node and a set of ids and returns the first id from the set it finds in the AST tree. This is e.g. used to check if expression in L2V1 contain references to reaction ids.
References CNodeContextIterator< Node, Context >::end(), and CNodeContextIterator< Node, Context >::next().
std::string SBMLImporter::findIdInASTTree | ( | const ASTNode * | pMath, |
const std::set< std::string > & | reactionIds | ||
) |
This method takes an AST node and a set of ids and returns the first id from the set it finds in the AST tree. This is e.g. used to check if expression in L2V1 contain references to reaction ids.
References CNodeContextIterator< Node, Context >::end(), and CNodeContextIterator< Node, Context >::next().
Referenced by checkRuleMathConsistency(), createCReactionFromReaction(), importEvent(), and importRuleForModelEntity().
|
protected |
Notifies the progress dialog that a step finished
References C_INVALID_INDEX, CProcessReport::finishItem(), mCurrentStepHandle, and mpProcessReport.
Referenced by checkValidityOfSourceDocument(), finishImport(), importEvents(), importInitialAssignments(), and removeUnusedFunctions().
|
protected |
Notifies the progress dialog that all importing is complete
References finishCurrentStep(), CProcessReport::finishItem(), mGlobalStepHandle, and mpProcessReport.
Referenced by checkValidityOfSourceDocument(), and parseSBML().
|
protected |
Returns the user defined SBML function definition that belongs to the given name, or NULL if none can be found.
|
protected |
Recurses an ASTNode tree and gets all SBML Ids in the tree. The ids are stored in the given set.
References CNodeContextIterator< Node, Context >::end(), and CNodeContextIterator< Node, Context >::next().
Referenced by checkRuleMathConsistency().
bool SBMLImporter::getImportCOPASIMIRIAM | ( | ) | const |
Returns the flag that determines whether COPASI MIRIAM annotation is imported if it is present.
References mImportCOPASIMIRIAM.
const CProcessReport * SBMLImporter::getProcessReport | ( | ) | const |
References mpProcessReport.
|
protected |
Imports the given event.
References CDataVectorN< CType >::add(), C_INVALID_INDEX, CEvaluationTree::create(), CModel::createEvent(), divideByObject(), CCopasiMessage::EXCEPTION, CEvaluationTree::Expression, fatalError, findIdInASTTree(), CEvent::getAssignments(), CDataObject::getCN(), CMetab::getCompartment(), CModel::getEvents(), CDataVectorN< CType >::getIndex(), CDataObject::getKey(), CDataObject::getObjectType(), CEvaluationTree::getRoot(), CCopasiMessage::getText(), CModelEntity::getValueReference(), hasCopasiAnnotation(), importMIRIAM(), importNotes(), isEmptyOrWhiteSpace(), MCSBML, mEventAssignmentForSpeciesReferenceIgnored, SBMLUnitSupport::mLevel, mSBMLSpeciesReferenceIds, pdelete, CCopasiMessage::peekLastMessage(), preprocessNode(), replaceObjectNames(), CEvent::setDelayAssignment(), CEvent::setDelayExpressionPtr(), CEventAssignment::setExpressionPtr(), CEvent::setFireAtInitialTime(), CExpression::setIsBoolean(), CEvent::setPersistentTrigger(), CEvent::setPriorityExpressionPtr(), CEvaluationTree::setRoot(), CEvent::setSBMLId(), CEvaluationTree::setTree(), CEvent::setTriggerExpressionPtr(), and CCopasiMessage::WARNING.
Referenced by importEvents().
|
protected |
Imports all events
References CCopasiMessage::EXCEPTION, finishCurrentStep(), CCopasiMessage::getText(), importEvent(), CCopasiMessage::peekLastMessage(), and reportCurrentProgressOrStop().
Referenced by createCModelFromSBMLDocument().
|
protected |
Starting with SBML Level 2 Version 4, function definitions no longer need to be ordered, i.e. a function definition may refer to another function definition that is defined somewhere further down in the file. So we have to import the function definitions in the correct order.
References CEvaluationTree::compile(), createCFunctionFromFunctionDefinition(), CCopasiMessage::EXCEPTION, findDirectDependencies(), CDataObject::getObjectName(), CCopasiMessage::getText(), MCSBML, mFunctionNameMapping, mKnownCustomUserDefinedFunctions, CCopasiMessage::peekLastMessage(), and CFunction::setInfix().
Referenced by createCModelFromSBMLDocument().
|
protected |
Imports all initial assignments if there are any.
References divideByObject(), CCopasiMessage::EXCEPTION, fatalError, finishCurrentStep(), CMetab::getCompartment(), CCompartment::getDimensionality(), CModelEntity::getInitialExpressionPtr(), CModelEntity::getInitialValueReference(), CEvaluationTree::getRoot(), CCopasiMessage::getText(), MCSBML, mKnownInitalValues, SBMLUnitSupport::mLevel, mSBMLSpeciesReferenceIds, mStoichiometricExpressionMap, CCopasiMessage::peekLastMessage(), preprocessNode(), CCopasiMessage::RAW, replace_time_with_initial_time(), replaceObjectNames(), reportCurrentProgressOrStop(), CModelEntity::setInitialExpressionPtr(), CEvaluationTree::setRoot(), CEvaluationTree::setTree(), and CCopasiMessage::WARNING.
Referenced by createCModelFromSBMLDocument().
|
protected |
Imports the MIRIAM annotation from the given SBML object and sets it on the given COPASI object.
References CDataVector< CType >::begin(), CAnnotation::castObject(), CMIRIAMInfo::createBiologicalDescription(), CDataVector< CType >::end(), CMIRIAMInfo::getBiologicalDescriptions(), CFunction::getKey(), CAnnotation::getKey(), CReaction::getKey(), CModelEntity::getKey(), CAnnotation::getMiriamAnnotation(), CMIRIAMInfo::load(), mImportCOPASIMIRIAM, CMIRIAMInfo::save(), CRDFGraphConverter::SBML2Copasi(), CBiologicalDescription::setId(), CAnnotation::setMiriamAnnotation(), CBiologicalDescription::setPredicate(), and CBiologicalDescription::setResource().
Referenced by createCCompartmentFromCompartment(), createCFunctionFromFunctionDefinition(), createCMetabFromSpecies(), createCModelFromSBMLDocument(), createCModelValueFromParameter(), createCReactionFromReaction(), and importEvent().
|
static |
This method reads the notes from an arbitrate SBase object and set them on the given CAnnotation instance.
References CAnnotation::addUnsupportedAnnotation(), and CAnnotation::setNotes().
Referenced by createCCompartmentFromCompartment(), createCFunctionFromFunctionDefinition(), createCMetabFromSpecies(), createCModelFromSBMLDocument(), createCModelValueFromParameter(), createCReactionFromReaction(), and importEvent().
|
protected |
Imports the given RateRule if COPASI supports this kind of RateRule, otherwise a warning is created.
References CModelEntity::ASSIGNMENT, CCopasiMessage::ERROR, CCopasiMessage::EXCEPTION, fatalError, importRuleForModelEntity(), MCSBML, SBMLUnitSupport::mLevel, mOriginalLevel, mRateRuleForSpeciesReferenceIgnored, mSBMLSpeciesReferenceIds, mStoichiometricExpressionMap, CModelEntity::ODE, and CCopasiMessage::WARNING.
Referenced by importSBMLRule().
|
protected |
Imports the given AssignmentRule which is for a global parameter.
References checkRuleMathConsistency(), divideByObject(), CCopasiMessage::ERROR, fatalError, findIdInASTTree(), CModelEntity::FIXED, CCompartment::getDimensionality(), CModelEntity::getExpressionPtr(), CEvaluationTree::getRoot(), CModelEntity::getStatus(), CModelEntity::getValueReference(), MCSBML, CModelEntity::ODE, preprocessNode(), CCopasiMessage::RAW, replaceObjectNames(), CModelEntity::setExpressionPtr(), CEvaluationTree::setRoot(), CModelEntity::setStatus(), CEvaluationTree::setTree(), and CCopasiMessage::WARNING.
Referenced by importRule().
|
protected |
Imports the given Rule if COPASI supports this kind of Rule, otherwise a warning is created.
References CModelEntity::ASSIGNMENT, fatalError, importRule(), mUnsupportedRuleFound, and CModelEntity::ODE.
Referenced by createCModelFromSBMLDocument(), and replace_delay_nodes().
|
protected |
Checks if the given node is an object node that represents a parameter or a model value or a function which has a single parameter and a single node which also represents a parameter.
References CEvaluationNode::CALL, CObjectInterface::DataObject(), CFunctionDB::findFunction(), CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getData(), CRootContainer::getFunctionList(), CDataObject::getObjectFromCN(), CDataObject::getObjectParent(), CEvaluationTree::getRoot(), CDataObject::hasFlag(), CEvaluationNode::mainType(), CEvaluationNode::OBJECT, CDataObject::Reference, and CEvaluationNode::VARIABLE.
Referenced by createCReactionFromReaction().
|
protected |
COPASI can not handle the delay function yet, so if it is used in some expression, we have to abort reading the file.
References CNodeContextIterator< Node, Context >::end(), and CNodeContextIterator< Node, Context >::next().
Referenced by createCFunctionFromFunctionTree(), and preprocessNode().
|
static |
|
protected |
References CEvaluationTree::Expression, fatalError, CEvaluationTree::Function, CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getData(), CEvaluationTree::getRoot(), CCopasiNode< _Data >::getSibling(), CEvaluationTree::getType(), isMassActionExpression(), isMassActionFunction(), CEvaluationNode::mainType(), CEvaluationNode::OBJECT, CEvaluationTree::PreDefined, and CEvaluationTree::UserDefined.
Referenced by createCReactionFromReaction().
|
protected |
References CChemEq::addMetabolite(), areApproximatelyEqual(), CEvaluationNode::copyBranch(), CObjectInterface::DataObject(), CCopasiMessage::EXCEPTION, fatalError, CEvaluationNode::FUNCTION, CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getData(), CChemEqElement::getMetaboliteKey(), CChemEqElement::getMultiplicity(), CDataObject::getObjectFromCN(), CDataObject::getObjectParent(), CChemEq::getProducts(), CChemEq::getReversibility(), CCopasiNode< _Data >::getSibling(), CChemEq::getSubstrates(), CEvaluationNode::getValuePointer(), CDataObject::hasFlag(), CEvaluationNode::mainType(), MCSBML, CEvaluationNode::MINUS, mpCopasiModel, CEvaluationNode::NUMBER, CEvaluationNode::OBJECT, CEvaluationNode::OPERATOR, pdelete, CEvaluationNode::POWER, CDataObject::Reference, separateProductArguments(), CDataVector< CType >::size(), CChemEq::SUBSTRATE, and CEvaluationNode::subType().
Referenced by isMassAction(), and isMassActionFunction().
|
protected |
References createExpressionFromFunction(), CEvaluationTree::getRoot(), and isMassActionExpression().
Referenced by isMassAction().
|
protected |
References CCopasiNode< _Data >::getChild(), and CCopasiNode< _Data >::getSibling().
Referenced by createCReactionFromReaction().
|
protected |
Heuristically checks whether a model was meant to be simulated stochastically. If the substance units are set to items and all reaction are irreversible this function will return true;
Referenced by createCModelFromSBMLDocument().
|
protected |
Multiplies all species nodes that belong to species with the hasSubstanceOnlyUnits flag set with the volume of the compartment that the species belongs to. This is only done for kineticLaw, all other mathematical expressions import those references as particle number nodes divided by the quantity2unit factor.
References CNodeIteratorMode::Before, CNodeContextIterator< Node, Context >::end(), mSubstanceOnlySpecies, CNodeContextIterator< Node, Context >::next(), pdelete, CNodeContextIterator< Node, Context >::setProcessingModes(), and CNodeContextIterator< Node, Context >::skipChildren().
Referenced by preprocessNode().
CModel * SBMLImporter::parseSBML | ( | const std::string & | sbmlDocumentText, |
SBMLDocument *& | pSBMLDocument, | ||
std::map< const CDataObject *, SBase * > & | copasi2sbmlmap, | ||
CListOfLayouts *& | prLol, | ||
CDataModel * | pDataModel | ||
) |
Function parses an SBML document with libsbml and converts it to a COPASI CModel object which is returned. Deletion of the returned pointer is up to the caller.
References CProcessReport::addItem(), checkValidityOfSourceDocument(), createCModelFromSBMLDocument(), createProgressStepOrStop(), CCopasiMessage::ERROR, finishImport(), SBMLUnitSupport::mAvogadroSet, MCSBML, mCurrentStepCounter, mCurrentStepHandle, mCurrentStepTotal, mGlobalStepCounter, mGlobalStepHandle, mGlobalStepTotal, SBMLUnitSupport::mLevel, mOriginalLevel, mpCopasiModel, mpDataModel, mpProcessReport, mUsedSBMLIdsPopulated, SBMLUnitSupport::mVersion, SBMLDocumentLoader::readListOfLayouts(), and CProcessReport::setName().
Referenced by CDataModel::importSBMLFromString(), and readSBML().
|
protected |
In a preprocessing step each expression tree that is imported, e.g. for function definitions, rules, event or kinetic laws is preprocessed to replace some of the nodes data. See also replaceCallNodeNames and replaceTimeNodeNames.
References checkForUnitsOnNumbers(), SBMLUtils::collectIds(), CModel::getQuantity2NumberFactor(), isDelayFunctionUsed(), MCSBML, mDelayFound, SBMLUnitSupport::mLevel, mpCopasiModel, mReactionsWithReplacedLocalParameters, mSubstanceOnlySpecies, multiplySubstanceOnlySpeciesByVolume(), mUnitOnNumberFound, mUsedSBMLIds, mUsedSBMLIdsPopulated, pdelete, replace_delay_nodes(), replace_name_nodes(), replaceAmountReferences(), replaceCallNodeNames(), replaceTimeAndAvogadroNodeNames(), replaceTimeDependentFunctionCalls(), and CCopasiMessage::WARNING.
Referenced by applyStoichiometricExpressions(), createCFunctionFromFunctionTree(), createCReactionFromReaction(), importEvent(), importInitialAssignments(), and importRuleForModelEntity().
CModel * SBMLImporter::readSBML | ( | std::string | filename, |
SBMLDocument *& | pSBMLDocument, | ||
std::map< const CDataObject *, SBase * > & | copasi2sbmlmap, | ||
CListOfLayouts *& | prLol, | ||
CDataModel * | pDataModel | ||
) |
This functions replaces all species nodes for species that are in the substanceOnlySpeciesVector. With the node multiplied by the volume of the species compartment. void SBMLImporter::replaceSubstanceOnlySpeciesNodes(ConverterASTNode* node, const std::map<Species*, Compartment*>& substanceOnlySpecies) { if (node != NULL) { if (node->getType() == AST_NAME) { std::map<Species*, Compartment*>::const_iterator it = substanceOnlySpecies.begin(); std::map<Species*, Compartment*>::const_iterator endIt = substanceOnlySpecies.end(); while (it != endIt) { if (it->first->getId() == node->getName()) { replace node List* l = new List(); ConverterASTNode* child1 = new ConverterASTNode(AST_NAME); child1->setName(node->getName()); ConverterASTNode* child2 = new ConverterASTNode(AST_NAME); child2->setName(it->second->getId().c_str()); l->add(child1); l->add(child2); node->setChildren(l); node->setType(AST_TIMES); break; } ++it; } } else { unsigned int counter; for (counter = 0;counter < node->getNumChildren();counter++) { this->replaceSubstanceOnlySpeciesNodes((ConverterASTNode*)node->getChild(counter), substanceOnlySpecies); } } } } Function reads an SBML file with libsbml and converts it to a Copasi CModel
References CCopasiMessage::EXCEPTION, CLocaleString::fromUtf8(), MCSBML, and parseSBML().
Referenced by SEDMLImporter::importModel(), and CDataModel::importSBML().
|
protected |
Finds all functions that are used and removes those that are not.
References CModelEntity::ASSIGNMENT, C_INT32, createProgressStepOrStop(), findFunctionCalls(), finishCurrentStep(), CModelEntity::FIXED, CEvent::getAssignments(), CModel::getCompartments(), CEvent::getDelayExpressionPtr(), CModel::getEvents(), CEventAssignment::getExpressionPtr(), CModelEntity::getExpressionPtr(), CRootContainer::getFunctionList(), CModelEntity::getInitialExpressionPtr(), CModel::getMetabolites(), CModel::getModelValues(), CDataObject::getObjectName(), CModel::getReactions(), CEvaluationTree::getRoot(), CModelEntity::getStatus(), CEvent::getTriggerExpressionPtr(), CDataContainer::insert(), CFunctionDB::loadedFunctions(), mConversionFactorFound, mCreatedFunctions, mCurrentStepCounter, mpCopasiModel, CDataVectorN< CType >::remove(), reportCurrentProgressOrStop(), CDataVector< CType >::size(), and TriUnspecified.
Referenced by createCModelFromSBMLDocument().
|
protected |
References CObjectInterface::DataObject(), CCopasiNode< _Data >::getChild(), CDataObject::getCN(), CEvaluationNodeObject::getData(), CDataObject::getObjectFromCN(), CCopasiNode< _Data >::getSibling(), mpCopasiModel, CEvaluationNodeObject::setData(), and CDataObject::setObjectName().
Referenced by createCReactionFromReaction().
|
protected |
This function replaces calls to the delay function in an ASTNode tree by a node that references a new global parameter which the function creates. The global parameter gets an expression which corresponds to the delay call. This is necessary because all knetic laws in COPASI are function calls and function definitions should not contain a call to delay.
This function replaces calls to the delay function in an ASTNode tree by a node that references a new global parameter which the function creates. The global parameter gets an expression which corresponds to the delay call. This is necessary because all kinetic laws in COPASI are function calls and function definitions should not contain a call to delay.
References createCModelValueFromParameter(), CNodeContextIterator< Node, Context >::end(), CCopasiMessage::EXCEPTION, fatalError, find_local_parameters_in_delay(), importSBMLRule(), mDelayNodeMap, SBMLUnitSupport::mLevel, mpCopasiModel, mUsedSBMLIds, CNodeContextIterator< Node, Context >::next(), and replace_name_nodes().
Referenced by preprocessNode().
|
protected |
This method gets an ASTNode and a map between old node names and new node names. All AST_NAME nodes with an "old" name are replaced by a node with the "new" name.
References CNodeContextIterator< Node, Context >::end(), and CNodeContextIterator< Node, Context >::next().
Referenced by createCReactionFromReaction(), preprocessNode(), and replace_delay_nodes().
|
protected |
If an initial expression uses time, we have to import it as initial time instead. This method takes an AST node and converts all time nodes to object nodes that have the common name of the time as the name.
References CNodeContextIterator< Node, Context >::end(), CDataObject::getCN(), CModelEntity::getInitialValueReference(), and CNodeContextIterator< Node, Context >::next().
Referenced by importInitialAssignments().
|
protected |
This method replaces references to the id of species which have the hasOnlySubstanceUnits flag set with the reference divided by avogadros number. The method tries to determine if there already is a multiplication with avogadros number and removes this multiplication rather than adding a new division.
This method replaces references to the id of species which have the hasOnlySubstanceUnits flag set with the reference divided by avogadros number.
References areApproximatelyEqual(), CNodeIteratorMode::Before, createHasOnlySubstanceUnitFactor(), CNodeContextIterator< Node, Context >::end(), mPotentialAvogadroNumbers, mSubstanceOnlySpecies, CNodeContextIterator< Node, Context >::next(), pdelete, CNodeContextIterator< Node, Context >::setProcessingModes(), and CNodeContextIterator< Node, Context >::skipChildren().
Referenced by preprocessNode().
|
protected |
Upon import a function object might change its name due to naming conflicts in the function database. So each ASTNode tree has its call node names replaced before it will be processed further.
References CNodeContextIterator< Node, Context >::end(), CCopasiMessage::EXCEPTION, mCreatedFunctions, MCSBML, mFunctionNameMapping, mKnownCustomUserDefinedFunctions, and CNodeContextIterator< Node, Context >::next().
Referenced by preprocessNode().
|
protected |
This functions replaces all species nodes for species that are in the substanceOnlySpeciesVector. With the node multiplied by the volume of the species compartment. void replaceSubstanceOnlySpeciesNodes(ConverterASTNode* node, const std::map<Species*, Compartment*>& substanceOnlySpecies); Replaces all occurrences of the log function with two arguments by a division of two separate calls to log.
|
protected |
References CNodeContextIterator< Node, Context >::end(), CCopasiMessage::EXCEPTION, fatalError, CDataObject::getCN(), CModelEntity::getSBMLId(), CReaction::getSBMLId(), MCSBML, mKnownInitalValues, mSBMLSpeciesReferenceIds, mSubstanceOnlySpecies, and CNodeContextIterator< Node, Context >::next().
Referenced by applyStoichiometricExpressions(), importEvent(), importInitialAssignments(), and importRuleForModelEntity().
|
protected |
Replaces the variables in a function definition with the actual function parameters that were used when the function was called. The function returns a pointer to the ConverterAST node with the replaced variables. This function replaces the AST_FUNCTION_POWER ASTNodes in a ASTNode tree with the AST_POWER node.
|
protected |
Replaces all occurrences of the root function with two arguments by a call to the power function with the inverse of the first argument.
|
protected |
The data for a CEvaluationNodeObject needs to have the common name of the model it refers to as its data. Since this model is only known via a pointer in the SBMLImporter at the time of import, all AST_NAME_TIME nodes that are imported need to have their name replaced by the common name of this model. Starting with SBML Level 3 this also applies to the avogadro number.
References CNodeContextIterator< Node, Context >::end(), CDataContainer::getObject(), mpCopasiModel, and CNodeContextIterator< Node, Context >::next().
Referenced by preprocessNode().
|
protected |
This function replaces function calls to all functions listed in mExplicitelyTimeDependentFunctionDefinitions with the same call but an additional parameter which is the time. This replacement includes all model entities that have a mathematical expression, so depending on the version of SBML, this would include: initial assignments, rules, constraints, kinetic laws and events. The corresponding replacement for the function definitions is done in replaceTimeNodesInFunctionDefinition.
References CNodeContextIterator< Node, Context >::end(), mExplicitelyTimeDependentFunctionDefinitions, and CNodeContextIterator< Node, Context >::next().
Referenced by preprocessNode().
|
protected |
For function definitions that use the time symbol we have to make this a variable that is passed to the function instead. The function recursively goes through the AST tree rooted in root and changes all time nodes to variable nodes with name newNodeName. If a time node has been found, the function return true, otherwise false is returned.
For function definitions that use the time symbol we have to make this a variable that is passed to the function instead. The function recursively goes through the AST tree rooted in root and changes all time nodes to variable nodes with name newNodeName. Additionally all function calls to functions in mExplicitelyTimeDependentFunctionDefinitions have to be changed to contain the added parameter. If a time node has been found, the function returns true, otherwise false is returned.
References CNodeContextIterator< Node, Context >::end(), mExplicitelyTimeDependentFunctionDefinitions, and CNodeContextIterator< Node, Context >::next().
Referenced by createCFunctionFromFunctionTree().
|
protected |
Notifies the progress dialog of local progress
Creates and returns a Copasi CModel from the SBMLDocument given as argument.
References mCurrentStepHandle, mpProcessReport, and CProcessReport::progressItem().
Referenced by createCModelFromSBMLDocument(), importEvents(), importInitialAssignments(), and removeUnusedFunctions().
void SBMLImporter::restoreFunctionDB | ( | ) |
References CFunctionDB::findFunction(), CRootContainer::getFunctionList(), CDataObject::getKey(), CEvaluationTree::getType(), mCreatedFunctions, CFunctionDB::removeFunction(), sbmlIdMap, and CEvaluationTree::UserDefined.
Referenced by SEDMLImporter::importModel(), CDataModel::importSBML(), and CDataModel::importSBMLFromString().
|
protected |
Replaces the ids of named nodes in an ASTNode tree with the correspondingCopasi Common Names.
References CDataObject::getCN(), CCopasiParameter::getCN(), CReaction::getObject(), CDataContainer::getObject(), CCopasiParameterGroup::getParameter(), CModelEntity::getValueReference(), SBMLUnitSupport::mLevel, and mSBMLSpeciesReferenceIds.
Referenced by createCReactionFromReaction().
|
protected |
This function takes a node and tries to find out whether the tree under this node consists only of multiply operators and object nodes. The arguments to the multiply operators are returned.
References CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::MULTIPLY, CEvaluationNode::POWER, and CEvaluationNode::subType().
Referenced by isMassActionExpression().
|
protected |
References CObjectInterface::DataObject(), fatalError, CReaction::getChemEq(), CCopasiNode< _Data >::getChild(), CEvaluationNodeObject::getData(), CReaction::getFunction(), CChemEq::getModifiers(), CDataObject::getObjectFromCN(), CDataObject::getObjectParent(), CChemEq::getProducts(), CCopasiNode< _Data >::getSibling(), CChemEq::getSubstrates(), CFunction::getVariables(), CFunctionParameter::MODIFIER, CChemEq::MODIFIER, mpCopasiModel, CFunctionParameter::PARAMETER, CFunctionParameter::PRODUCT, CChemEq::PRODUCT, CFunctionParameter::setUsage(), CDataVector< CType >::size(), CFunctionParameter::SUBSTRATE, CChemEq::SUBSTRATE, and CFunctionParameter::VOLUME.
void SBMLImporter::setImportCOPASIMIRIAM | ( | bool | import | ) |
Sets the flag that determines whether COPASI MIRIAM annotation is imported if it is present.
References mImportCOPASIMIRIAM.
Referenced by SEDMLImporter::importModel(), CDataModel::importSBML(), and CDataModel::importSBMLFromString().
void SBMLImporter::setImportHandler | ( | CProcessReport * | pProcessReport | ) |
sets a progress handler to inform about updates
References mpProcessReport, mpSbmlCallback, and pdelete.
Referenced by clearCallBack(), SEDMLImporter::importModel(), CDataModel::importSBML(), and CDataModel::importSBMLFromString().
|
protected |
Sets the initial values on compartments, metabolites and model values if those initial values have been set in the SBML model. Otherwise the routine checks if a rule or an initial assignment has been set for the entity. If the entity has not been set in any way, an error message is created.
References CModelEntity::ASSIGNMENT, CDataVector< CType >::begin(), CObjectInterface::DataObject(), CDataVector< CType >::empty(), CDataVector< CType >::end(), CModelEntity::FIXED, CModel::getCompartments(), CModel::getMetabolites(), CModel::getModelValues(), CDataContainer::getObject(), CModel::getQuantity2NumberFactor(), mChangedObjects, MCSBML, mIncompleteModel, SBMLUnitSupport::mLevel, CModelEntity::ODE, CModelEntity::REACTIONS, CModel::updateInitialValues(), and CCopasiMessage::WARNING.
Referenced by createCModelFromSBMLDocument().
|
static |
Goes through all SBML reactions and collects the ids of all species references.
Referenced by createCModelFromSBMLDocument().
|
protected |
References CCopasiNode< _Data >::addChild(), CEvaluationNode::CN, CEvaluationNode::create(), fatalError, CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getData(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::mainType(), and CEvaluationNode::subType().
Referenced by createCReactionFromReaction(), and createExpressionFromFunction().
|
protected |
Referenced by SBMLImporter().
|
protected |
Referenced by createCModelFromSBMLDocument(), createHasOnlySubstanceUnitFactor(), and SBMLImporter().
|
protected |
Referenced by setInitialValues().
|
protected |
Referenced by applyConversionFactors(), createCReactionFromReaction(), and SBMLImporter().
|
protected |
Referenced by createCModelFromSBMLDocument().
|
protected |
Referenced by createCModelFromSBMLDocument(), removeUnusedFunctions(), and SBMLImporter().
|
protected |
|
protected |
current step counter for current import
Referenced by createCModelFromSBMLDocument(), createProgressStepOrStop(), parseSBML(), and removeUnusedFunctions().
|
protected |
the current import step handle
Referenced by createCModelFromSBMLDocument(), createProgressStepOrStop(), finishCurrentStep(), parseSBML(), and reportCurrentProgressOrStop().
|
protected |
total steps of current import task
Referenced by createCModelFromSBMLDocument(), createProgressStepOrStop(), and parseSBML().
|
protected |
Referenced by createCModelFromSBMLDocument(), preprocessNode(), and SBMLImporter().
|
protected |
Referenced by replace_delay_nodes().
|
protected |
Referenced by createCModelFromSBMLDocument(), and createCReactionFromReaction().
|
protected |
Referenced by createCModelFromSBMLDocument(), importEvent(), and SBMLImporter().
|
protected |
|
protected |
Referenced by createCModelFromSBMLDocument(), and createCReactionFromReaction().
|
protected |
Referenced by importFunctionDefinitions(), and replaceCallNodeNames().
|
protected |
global step counter
Referenced by createProgressStepOrStop(), and parseSBML().
|
protected |
the global import step handle
Referenced by createProgressStepOrStop(), finishImport(), and parseSBML().
|
protected |
total step counter for global import
Referenced by parseSBML().
|
protected |
Referenced by createCModelFromSBMLDocument().
|
protected |
Referenced by checkValidityOfSourceDocument(), and SBMLImporter().
|
protected |
Referenced by getImportCOPASIMIRIAM(), importMIRIAM(), and setImportCOPASIMIRIAM().
|
protected |
Referenced by createCReactionFromReaction(), SBMLImporter(), and setInitialValues().
|
protected |
Referenced by createCFunctionFromFunctionDefinition(), importFunctionDefinitions(), and replaceCallNodeNames().
|
protected |
Referenced by createCModelFromSBMLDocument(), importInitialAssignments(), and replaceObjectNames().
|
protected |
Referenced by importRule(), and parseSBML().
|
protected |
Referenced by createCModelFromSBMLDocument(), and createCReactionFromReaction().
|
protected |
Referenced by applyStoichiometricExpressions(), checkRuleMathConsistency(), createCModelFromSBMLDocument(), createCReactionFromReaction(), createHasOnlySubstanceUnitFactor(), deleteCopasiModel(), doMapping(), find_local_parameters_in_delay(), isMassActionExpression(), parseSBML(), preprocessNode(), removeUnusedFunctions(), renameMassActionParameters(), replace_delay_nodes(), replaceTimeAndAvogadroNodeNames(), and setCorrectUsage().
|
protected |
|
protected |
Referenced by applyConversionFactors(), createCModelFromSBMLDocument(), createCReactionFromReaction(), and SBMLImporter().
|
protected |
|
protected |
the import handler
Referenced by createCModelFromSBMLDocument(), createProgressStepOrStop(), finishCurrentStep(), finishImport(), getProcessReport(), parseSBML(), reportCurrentProgressOrStop(), SBMLImporter(), and setImportHandler().
|
protected |
Referenced by setImportHandler(), and ~SBMLImporter().
|
protected |
Referenced by createCModelFromSBMLDocument(), importRule(), and SBMLImporter().
|
protected |
Referenced by checkRuleMathConsistency(), createCModelFromSBMLDocument(), and createCReactionFromReaction().
|
protected |
Referenced by createCModelFromSBMLDocument(), and preprocessNode().
|
protected |
Referenced by createCModelFromSBMLDocument(), createCModelValueFromParameter(), and SBMLImporter().
|
protected |
|
protected |
Referenced by applyConversionFactors(), createCModelFromSBMLDocument(), createCReactionFromReaction(), and SBMLImporter().
|
protected |
Referenced by applyStoichiometricExpressions(), createCReactionFromReaction(), importInitialAssignments(), and importRule().
|
protected |
|
protected |
Referenced by createCModelFromSBMLDocument(), preprocessNode(), and SBMLImporter().
|
protected |
Referenced by SBMLImporter().
|
protected |
Referenced by SBMLImporter().
|
protected |
Referenced by createCModelFromSBMLDocument(), importSBMLRule(), and SBMLImporter().
|
protected |
Referenced by find_local_parameters_in_delay(), preprocessNode(), and replace_delay_nodes().
|
protected |
Referenced by parseSBML(), and preprocessNode().
|
protected |
Referenced by createCModelFromSBMLDocument(), and restoreFunctionDB().
|
protected |
Referenced by createCModelFromSBMLDocument(), createCReactionFromReaction(), and SBMLImporter().