COPASI API
4.16.103
|
#include <CSBMLExporter.h>
Public Member Functions | |
CSBMLExporter () | |
void | disownSBMLDocument () |
bool | exportModel (CCopasiDataModel &dataModel, const std::string &filename, unsigned int sbmlLevel=2, unsigned int sbmlVersion=1, bool overwrite=false) |
const std::string | exportModelToString (CCopasiDataModel &dataModel, unsigned int sbmlLevel, unsigned int sbmlVersion) |
const std::map< const CCopasiObject *, SBase * > & | getCOPASI2SBMLMap () const |
SBMLDocument * | getSBMLDocument () |
bool | isSetExportCOPASIMIRIAM () const |
void | setExportCOPASIMIRIAM (bool exportMIRIAM) |
~CSBMLExporter () | |
Static Public Member Functions | |
static const std::string | createUniqueId (const std::map< std::string, const SBase * > &idMap, const std::string &prefix, bool addIndexForFirst, const std::string &separator="_") |
static const std::vector < SBMLIncompatibility > | isModelSBMLCompatible (const CCopasiDataModel &pDataModel, int sbmlLevel, int sbmlVersion) |
Static Protected Member Functions | |
static void | check_for_spatial_size_units (const CCopasiDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | checkForEvents (const CCopasiDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | checkForInitialAssignments (const CCopasiDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | checkForODESpeciesInNonfixedCompartment (const CCopasiDataModel &dataModel, std::vector< SBMLIncompatibility > result) |
static void | checkForPiecewiseFunctions (const CCopasiDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | checkForPiecewiseFunctions (const CEvaluationNode &node, std::vector< SBMLIncompatibility > &result, const std::string &objectName, const std::string &objectType) |
static void | checkForUnsupportedFunctionCalls (const CEvaluationNode &node, const std::set< CEvaluationNodeFunction::SubType > &unsupportedFunctions, std::vector< SBMLIncompatibility > &result, const std::string &objectDescription) |
static void | checkForUnsupportedObjectReferences (const CEvaluationTree &expression, const CCopasiDataModel &dataModel, unsigned int sbmlLevel, unsigned int sbmlVersion, std::vector< SBMLIncompatibility > &result, bool initialExpression=false, std::map< const std::string, Parameter * > *initialMap=NULL) |
static void | convert_to_l1v1 (std::string &l1v2_string) |
static ASTNode * | convertASTTreeToLevel1 (const ASTNode *pNode, const ListOfFunctionDefinitions &functions, std::string &message) |
static const std::set < CFunction * > | createFunctionSetFromFunctionNames (const std::set< std::string > &names, CFunctionDB *pFunDB) |
static CEvaluationNode * | createMassActionExpression (const std::vector< std::vector< std::string > > &arguments, bool isReversible) |
static ASTNode * | createTimesTree (const CCopasiVector< CChemEqElement > &vect, unsigned int pos=0) |
static const std::set < CEvaluationNodeFunction::SubType > | createUnsupportedFunctionTypeSet (unsigned int sbmlLevel) |
static void | findDirectlyUsedFunctions (const CEvaluationNode *pRootNode, std::set< std::string > &result) |
static void | findModelEntityDependencies (const CEvaluationNode *pNode, const CCopasiDataModel &dataModel, std::set< const CModelEntity * > &dependencies) |
static const std::vector < CFunction * > | findUsedFunctions (std::set< CFunction * > &functions, CFunctionDB *pFunctionDB) |
static ASTNode * | isDividedByVolume (const ASTNode *pRootNode, const std::string &compartmentId) |
static void | isEventAssignmentSBMLCompatible (std::string &key, const CExpression *pExpression, const CCopasiDataModel &dataModel, unsigned int sbmlLevel, unsigned int sbmlVersion, const std::string &eventName, std::vector< SBMLIncompatibility > &result) |
static void | isEventSBMLCompatible (const CEvent *pEvent, const CCopasiDataModel &dataModel, unsigned int sbmlLevel, unsigned int sbmlVersion, std::vector< SBMLIncompatibility > &result) |
static void | isExpressionSBMLCompatible (const CEvaluationTree &expr, const CCopasiDataModel &dataModel, int sbmlLevel, int sbmlVersion, std::vector< SBMLIncompatibility > &result, const std::string &objectDescription, bool initialExression=false, std::map< const std::string, Parameter * > *initialMap=NULL) |
static void | isExpressionSBMLL1Compatible (const CEvaluationTree &expr, const CCopasiDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | isExpressionSBMLL2V1Compatible (const CEvaluationTree &expr, const CCopasiDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | isExpressionSBMLL2V3Compatible (const CEvaluationTree &expression, const CCopasiDataModel &pDataModel, std::vector< SBMLIncompatibility > &result) |
static void | isModelSBMLL1Compatible (const CCopasiDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | isModelSBMLL2V1Compatible (const CCopasiDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | isModelSBMLL2V3Compatible (const CCopasiDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static bool | isValidSId (const std::string &id) |
static CEvaluationNode * | multiplyByObject (const CEvaluationNode *pOrigNode, const CCopasiObject *pObject) |
static ASTNode * | replaceL1IncompatibleNodes (const ASTNode *pNode) |
static bool | setSBMLNotes (SBase *pSBase, const CAnnotation *pAnno) |
Definition at line 52 of file CSBMLExporter.h.
CSBMLExporter::CSBMLExporter | ( | ) |
Default Konstruktor
Definition at line 328 of file CSBMLExporter.cpp.
CSBMLExporter::~CSBMLExporter | ( | ) |
Destruktor
Definition at line 331 of file CSBMLExporter.cpp.
References mDocumentDisowned, mpSBMLDocument, and pdelete.
Since we want to replace local reaction parameters by global parameters if they are used in an assignment, we have to create the reactions after creating the rules and events. On the other hand, a reaction flux might also be referenced in an assignment or an event and the creation of this rule or event only works if the reactions already have SBML ids. To solve this problem, the reactions have to be assigned SBML ids prior to creating rules and events. This is what this method does.
Definition at line 7556 of file CSBMLExporter.cpp.
References CCopasiVector< T >::begin(), createUniqueId(), CCopasiVector< T >::end(), CModel::getReactions(), and mIdMap.
Referenced by createSBMLDocument().
|
staticprotected |
Go through all species in the model and check if the corresponding species in the SBML model has the spatialSizeUnits attribute set. This attribute is not supported in SBML L2V3 and above, so we have to get rid of this attribute when we export to a level equal to or higher than L2V3. If the attribute has the same value as the compartments units, we can just delete it without changing the model, otherwise we have to give a corresponding warning.
Definition at line 2597 of file CSBMLExporter.cpp.
References SBMLImporter::areSBMLUnitDefinitionsIdentical(), CCopasiVector< T >::begin(), CCopasiVector< T >::end(), CCopasiMessage::EXCEPTION, CModel::getMetabolites(), CCopasiDataModel::getModel(), SBMLImporter::getSBMLUnitDefinitionForId(), and MCSBML.
Referenced by createMetabolites(), and isModelSBMLL2V3Compatible().
|
staticprotected |
Checks if the given datamodel contains events. This is called if SBML Level 1 is to be exported.
Definition at line 4552 of file CSBMLExporter.cpp.
References CModel::getEvents(), CCopasiDataModel::getModel(), and CCopasiVector< T >::size().
Referenced by createEvents(), and isModelSBMLL1Compatible().
|
staticprotected |
This method checks wether the given model contains any initial assignments.
This method checks whether the given model contains any initial assignments.
Definition at line 2887 of file CSBMLExporter.cpp.
References CCopasiVector< T >::begin(), CCopasiVector< T >::end(), CModel::getCompartments(), CModel::getMetabolites(), CCopasiDataModel::getModel(), and CModel::getModelValues().
Referenced by createSBMLDocument(), isModelSBMLL1Compatible(), and isModelSBMLL2V1Compatible().
|
staticprotected |
Checks wether the model contains a metabolite that is defined by an ODE expression and that is located in a variable volume. Since COPASI interprets the expression differntly from SBML, we can not correctly export this yet. See Bug 903.
Checks whether the model contains a metabolite that is defined by an ODE expression and that is located in a variable volume. Since COPASI interprets the expression differently from SBML, we can not correctly export this yet. See Bug 903.
Definition at line 2738 of file CSBMLExporter.cpp.
References CCopasiVector< T >::begin(), CCopasiVector< T >::end(), CModelEntity::FIXED, CModel::getMetabolites(), CCopasiDataModel::getModel(), CCopasiObject::getObjectName(), CModelEntity::getStatus(), and CModelEntity::ODE.
Referenced by isModelSBMLCompatible().
|
staticprotected |
Checks all expressions in the given datamodel for piecewise defined functions.
Definition at line 5531 of file CSBMLExporter.cpp.
References CModelEntity::ASSIGNMENT, createFunctionSetFromFunctionNames(), findDirectlyUsedFunctions(), findUsedFunctions(), CModel::getCompartments(), CModelEntity::getExpressionPtr(), CReaction::getFunction(), CCopasiRootContainer::getFunctionList(), CModel::getMetabolites(), CCopasiDataModel::getModel(), CModel::getModelValues(), CCopasiObject::getObjectName(), CModel::getReactions(), CEvaluationTree::getRoot(), CModelEntity::getStatus(), CModelEntity::ODE, and CCopasiVector< T >::size().
Referenced by checkForPiecewiseFunctions(), and isModelSBMLL1Compatible().
|
staticprotected |
Checks the given node and all it's children for the occurence of piecewise functions.
Definition at line 5617 of file CSBMLExporter.cpp.
References checkForPiecewiseFunctions(), CEvaluationNode::CHOICE, CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::getType(), and CEvaluationNode::type().
|
protected |
This static methods checks, wether the model uses any function calls that can not be expressed in SBML like the random distribution functions.
This static methods checks, whether the model uses any function calls that can not be expressed in SBML like the random distribution functions.
Definition at line 2786 of file CSBMLExporter.cpp.
References createUnsupportedFunctionTypeSet(), CModelEntity::getExpressionPtr(), CModelEntity::getInitialExpressionPtr(), CCopasiObject::getObjectName(), CCopasiObject::getObjectType(), CEvaluationTree::getRoot(), mAssignmentVector, mInitialAssignmentVector, mODEVector, and mUsedFunctions.
Referenced by checkForUnsupportedFunctionCalls(), and isExpressionSBMLCompatible().
|
staticprotected |
This static methods checks recursively, whether the given CEvaluationNode constains any function calls that can not be expressed in SBML like the random distribution functions.
Definition at line 2861 of file CSBMLExporter.cpp.
References checkForUnsupportedFunctionCalls(), CEvaluationNode::FUNCTION, CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getData(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::getType(), CEvaluationNode::subType(), and CEvaluationNode::type().
|
protected |
Checks all assignments (initial and transient) for references to objects that can not be exported to SBML.
Definition at line 2284 of file CSBMLExporter.cpp.
References CModelEntity::getExpressionPtr(), CModelEntity::getInitialExpressionPtr(), CCopasiDataModel::getModel(), mAssignmentVector, mInitialAssignmentVector, mInitialValueMap, and mODEVector.
Referenced by isExpressionSBMLCompatible().
|
staticprotected |
Checks the given expression for references to objects that can not be exported to SBML.
Definition at line 2376 of file CSBMLExporter.cpp.
References addToInitialValueMap(), CCopasiDataModel::getModel(), CEvaluationTree::getNodeList(), CEvaluationNodeObject::getObjectCN(), CCopasiObject::getObjectName(), CCopasiObject::getObjectParent(), CCopasiObject::getObjectType(), CCopasiObject::isReference(), CEvaluationNode::OBJECT, CCopasiDataModel::ObjectFromName(), and CEvaluationNode::type().
|
protected |
This method goes through the given datamodel and collects all SBML ids.
Definition at line 7465 of file CSBMLExporter.cpp.
References CModel::getCompartments(), CModel::getEvents(), CCopasiRootContainer::getFunctionList(), CModel::getMetabolites(), CCopasiDataModel::getModel(), CModel::getModelValues(), CModel::getReactions(), CFunction::getSBMLId(), CModelEntity::getSBMLId(), CEvent::getSBMLId(), CReaction::getSBMLId(), CFunctionDB::loadedFunctions(), and CCopasiVector< T >::size().
Referenced by createSBMLDocument().
|
staticprotected |
Converts the SBML model given in SBML Level 1 Version 2 format to SBML Level 1 Version 1. The method basically removes the namespace attribute on the sbml element and changes the version from 2 to 1. It also renames all "species" elements to "specie". All other changes between SBML Level 1 Version 2 and Level 1 Version 1 should not be relevant here.
Referenced by exportModelToString().
|
staticprotected |
Creates an ASTNode based tree where all occurences of nodes that are not supported in SBML Level 1 are replaced by supported constructs. On error an exception is created. The caller is responsible for freeing the memory of the returned object.
Definition at line 5507 of file CSBMLExporter.cpp.
References create_expression(), CCopasiMessage::EXCEPTION, MCSBML, and replaceL1IncompatibleNodes().
Referenced by convertToLevel1().
|
protected |
This converts an CEvaluationNode based tree to an ASTNode tree. It makes sure that all functions used in function calls already have a unique SBML id.
Definition at line 7078 of file CSBMLExporter.cpp.
References adjustNames(), mIdMap, mpSBMLDocument, pResult, setFunctionSBMLIds(), and CEvaluationNode::toAST().
Referenced by createEvent(), createFunctionDefinition(), createInitialAssignment(), createKineticLaw(), createRule(), and exportEventAssignments().
|
protected |
This method takes care of expanding all function calls in all expressions and converting functions that are not supported in Level 1 as well as constants that were not supported in Level 1
Definition at line 5230 of file CSBMLExporter.cpp.
References convertASTTreeToLevel1(), fatalError, mExportedFunctions, and mpSBMLDocument.
Referenced by createSBMLDocument().
|
protected |
Creates the volume unit for the SBML model.
Creates the area unit for the SBML model.
Definition at line 798 of file CSBMLExporter.cpp.
References SBMLImporter::areSBMLUnitDefinitionsIdentical(), CModel::cm, CModel::dimensionlessLength, CModel::dm, CCopasiMessage::EXCEPTION, CModel::fm, CModel::getAreaUnitEnum(), CCopasiDataModel::getModel(), INIT_DEFAULTS, CModel::m, CModel::microm, CModel::mm, mpSBMLDocument, mSBMLLevel, mSBMLVersion, CModel::nm, and CModel::pm.
Referenced by createUnits().
|
protected |
Creates the compartment for the given COPASI compartment.
Definition at line 928 of file CSBMLExporter.cpp.
References CModelEntity::ASSIGNMENT, createUniqueId(), fatalError, CCompartment::getDimensionality(), CModelEntity::getInitialExpression(), CModelEntity::getInitialValue(), CCopasiObject::getObjectName(), CModelEntity::getSBMLId(), CModelEntity::getStatus(), INIT_DEFAULTS, mAssignmentVector, mCOPASI2SBMLMap, mHandledSBMLObjects, mIdMap, mInitialAssignmentVector, mMetaIdMap, mODEVector, mpSBMLDocument, mSBMLLevel, CModelEntity::ODE, removeInitialAssignment(), removeRule(), CModelEntity::setSBMLId(), setSBMLNotes(), and updateMIRIAMAnnotation().
Referenced by createCompartments().
|
protected |
Creates the compartments for the model.
Definition at line 911 of file CSBMLExporter.cpp.
References CCopasiVector< T >::begin(), createCompartment(), CCopasiVector< T >::end(), CModel::getCompartments(), CCopasiDataModel::getModel(), and mpSBMLDocument.
Referenced by createSBMLDocument().
|
protected |
Creates an SBML Event for the given COPASI event.
Definition at line 4005 of file CSBMLExporter.cpp.
References convertExpression(), convertToASTNode(), createFunctionSetFromFunctionNames(), createUniqueId(), CCopasiMessage::EXCEPTION, exportEventAssignments(), findDirectlyUsedFunctions(), CEvent::getDelayAssignment(), CCopasiRootContainer::getFunctionList(), CEvaluationTree::getInfix(), CCopasiObject::getObjectName(), CEvaluationTree::getRoot(), CEvent::getSBMLId(), CEvaluationNode::getType(), CEvaluationNode::INVALID, isExpressionSBMLCompatible(), mCOPASI2SBMLMap, MCSBML, mIdMap, mIncompatibilities, mIncompleteExport, mInitialValueMap, mMetaIdMap, mpSBMLDocument, mSBMLLevel, mSBMLVersion, mUsedFunctions, outputIncompatibilities(), replace_local_parameters(), replaceSpeciesReferences(), CEvaluationTree::setInfix(), setSBMLNotes(), CEvaluationNode::type(), updateMIRIAMAnnotation(), and CCopasiMessage::WARNING.
Referenced by createEvents().
|
protected |
Creates the events for the given data model.
Definition at line 3938 of file CSBMLExporter.cpp.
References CCopasiVector< T >::begin(), checkForEvents(), createEvent(), CCopasiVector< T >::end(), CModel::getEvents(), CCopasiDataModel::getModel(), mCOPASI2SBMLMap, mIncompatibilities, mpSBMLDocument, and mSBMLLevel.
Referenced by createSBMLDocument().
|
protected |
Create the SBML function definition from the given COPASI function.
Definition at line 3107 of file CSBMLExporter.cpp.
References convertToASTNode(), createUniqueId(), CCopasiMessage::EXCEPTION, isExpressionSBMLCompatible(), isValidSId(), mCOPASI2SBMLMap, MCSBML, mExportedFunctions, mFunctionMap, mIdMap, mIncompatibilities, mMetaIdMap, mpSBMLDocument, mSBMLLevel, mSBMLVersion, setSBMLNotes(), CFunctionParameters::size(), updateMIRIAMAnnotation(), and CCopasiMessage::WARNING.
Referenced by createFunctionDefinitions().
|
protected |
Create all function definitions.
Definition at line 2940 of file CSBMLExporter.cpp.
References createFunctionDefinition(), fatalError, findUsedFunctions(), CCopasiRootContainer::getFunctionList(), CCopasiObject::getObjectName(), mCOPASI2SBMLMap, mExportedFunctions, mFunctionMap, mpSBMLDocument, and mUsedFunctions.
Referenced by createSBMLDocument().
|
staticprotected |
Definition at line 5054 of file CSBMLExporter.cpp.
References CCopasiMessage::ERROR, CFunctionDB::findFunction(), and MCSBML.
Referenced by checkForPiecewiseFunctions(), createEvent(), createInitialAssignment(), createRule(), exportEventAssignments(), and findUsedFunctions().
|
protected |
Goes through the given SBML model and puts all ids with the corresponding object into a map.
Definition at line 2075 of file CSBMLExporter.cpp.
|
protected |
Creates the initial assignment for the given COPASI model entity.
Definition at line 1673 of file CSBMLExporter.cpp.
References convertToASTNode(), createFunctionSetFromFunctionNames(), CCopasiMessage::EXCEPTION, findDirectlyUsedFunctions(), CMetab::getCompartment(), CCompartment::getDimensionality(), CCopasiRootContainer::getFunctionList(), CModelEntity::getInitialExpressionPtr(), CModelEntity::getInitialValueReference(), CCopasiObject::getObjectName(), CCopasiObject::getObjectType(), CEvaluationTree::getRoot(), CModelEntity::getSBMLId(), CEvaluationNode::getType(), CEvaluationNode::INVALID, isExpressionSBMLCompatible(), mCOPASI2SBMLMap, MCSBML, mHandledSBMLObjects, mIncompatibilities, mIncompleteExport, mInitialValueMap, mpSBMLDocument, mSBMLLevel, mSBMLVersion, multiplyByObject(), mUsedFunctions, outputIncompatibilities(), replace_local_parameters(), replaceSpeciesReferences(), and CEvaluationNode::type().
Referenced by createInitialAssignments().
|
protected |
Creates the initial assignments for the model.
Definition at line 1650 of file CSBMLExporter.cpp.
References createInitialAssignment(), and mInitialAssignmentVector.
Referenced by createSBMLDocument().
|
protected |
Creates an expression from a given node and a set of parameter mappings by replacing the function arguments with the parameters. static CEvaluationNode* createExpressionTree(const CEvaluationNode* const pNode, const std::map<std::string, std::string>& parameterMap, const CCopasiDataModel& dataModel); Creates an expression from a given function and a set of parameters by replacing the function arguments with the parameters. static CEvaluationNode* createExpressionTree(const CFunction* const pFun, const std::vector<std::vector<std::string> >& arguments, const CCopasiDataModel& dataModel); Create an expression that corresponds to a kinetic law. If the kinetic law was mass action, the expression is a mass action term , otherwise it is a function call.
Definition at line 4802 of file CSBMLExporter.cpp.
References CEvaluationNodeCall::addChild(), CEvaluationNodeObject::CN, createMassActionExpression(), fatalError, CEvaluationNodeCall::FUNCTION, CKeyFactory::get(), CCopasiObject::getCN(), CCopasiRootContainer::getKeyFactory(), CCopasiObject::getObjectName(), CEvaluationTree::getType(), CFunction::getVariables(), CFunction::isReversible(), CEvaluationTree::MassAction, mUsedFunctions, pResult, CFunctionParameters::size(), and TriTrue.
Referenced by createKineticLaw().
|
protected |
Create the kinetic law for the given reaction. On failure NULL is returned.
Definition at line 4584 of file CSBMLExporter.cpp.
References convertToASTNode(), createKineticExpression(), fatalError, CKeyFactory::get(), CReaction::getChemEq(), CCopasiParameter::getCN(), CReaction::getCompartmentNumber(), CCompartment::getDimensionality(), CReaction::getFunction(), CReaction::getFunctionParameters(), CCopasiRootContainer::getKeyFactory(), CCopasiObject::getObjectName(), CReaction::getParameterMapping(), CReaction::getParameterMappings(), CReaction::getParameterValue(), CChemEq::getProducts(), CModelEntity::getSBMLId(), CChemEq::getSubstrates(), CFunctionParameter::getUsage(), isDividedByVolume(), CReaction::isLocalParameter(), CFunction::isReversible(), mParameterReplacementMap, mpSBMLDocument, mSBMLLevel, CFunctionParameter::PARAMETER, replaceSpeciesReferences(), restore_local_parameters(), CFunctionParameters::size(), CCopasiVector< T >::size(), TriUnspecified, and CFunctionParameter::VARIABLE.
Referenced by createReaction().
|
protected |
Creates the volume unit for the SBML model.
Creates the length unit for the SBML model.
Definition at line 689 of file CSBMLExporter.cpp.
References SBMLImporter::areSBMLUnitDefinitionsIdentical(), CModel::cm, CModel::dimensionlessLength, CModel::dm, CCopasiMessage::EXCEPTION, CModel::fm, CModel::getLengthUnitEnum(), CCopasiDataModel::getModel(), INIT_DEFAULTS, CModel::m, CModel::microm, CModel::mm, mpSBMLDocument, mSBMLLevel, mSBMLVersion, CModel::nm, and CModel::pm.
Referenced by createUnits().
|
staticprotected |
This method creates the CEvaluationNode based tree for a reversible or irreversible Mass Action call. The first parameter contains the arguments from the COPASI reaction. The second argument determines whether it is reversible or irreversible mass action.
Definition at line 5907 of file CSBMLExporter.cpp.
References CCopasiNode< _Data >::addChild(), CEvaluationNodeObject::CN, CEvaluationNodeNumber::DOUBLE, CKeyFactory::get(), CCopasiObject::getCN(), CCopasiRootContainer::getKeyFactory(), CEvaluationNodeOperator::MINUS, CEvaluationNodeOperator::MULTIPLY, CEvaluationNodeOperator::POWER, and pResult.
Referenced by createKineticExpression().
Creates the species for the given COPASI metabolite.
Definition at line 1105 of file CSBMLExporter.cpp.
References CModelEntity::ASSIGNMENT, createUniqueId(), CModelEntity::FIXED, CMetab::getCompartment(), CMetab::getInitialConcentration(), CModelEntity::getInitialExpression(), CModelEntity::getInitialValue(), CMetab::getObjectDisplayName(), CCopasiObject::getObjectName(), CModelEntity::getSBMLId(), CModelEntity::getStatus(), INIT_DEFAULTS, mAssignmentVector, mCOPASI2SBMLMap, mHandledSBMLObjects, mIdMap, mInitialAssignmentVector, mMetaIdMap, mODEVector, mpSBMLDocument, mSBMLLevel, mSBMLVersion, mSpatialSizeUnitsSpecies, mVariableVolumes, CModelEntity::ODE, CModelEntity::REACTIONS, removeInitialAssignment(), removeRule(), CModelEntity::setSBMLId(), setSBMLNotes(), and updateMIRIAMAnnotation().
Referenced by createMetabolites().
|
protected |
Creates the compartments for the model.
Definition at line 1068 of file CSBMLExporter.cpp.
References CCopasiVector< T >::begin(), check_for_spatial_size_units(), createMetabolite(), CCopasiVector< T >::end(), CModel::getMetabolites(), CCopasiDataModel::getModel(), MCSBML, mIncompatibilities, mpSBMLDocument, mSBMLLevel, mSBMLVersion, mSpatialSizeUnitsSpecies, and CCopasiMessage::WARNING.
Referenced by createSBMLDocument().
|
protected |
Creates the parameter for the given COPASI parameter.
Definition at line 1304 of file CSBMLExporter.cpp.
References CModelEntity::ASSIGNMENT, createUniqueId(), CModelEntity::getInitialExpression(), CModelEntity::getInitialValue(), CCopasiObject::getObjectName(), CModelEntity::getSBMLId(), CModelEntity::getStatus(), INIT_DEFAULTS, mAssignmentVector, mCOPASI2SBMLMap, mHandledSBMLObjects, mIdMap, mInitialAssignmentVector, mMetaIdMap, mODEVector, mpSBMLDocument, mSBMLLevel, CModelEntity::ODE, removeInitialAssignment(), removeRule(), CModelEntity::setSBMLId(), setSBMLNotes(), and updateMIRIAMAnnotation().
Referenced by createParameters().
|
protected |
Creates the parameters for the model.
Definition at line 1287 of file CSBMLExporter.cpp.
References CCopasiVector< T >::begin(), createParameter(), CCopasiVector< T >::end(), CCopasiDataModel::getModel(), CModel::getModelValues(), and mpSBMLDocument.
Referenced by createSBMLDocument().
|
protected |
Creates the reaction for the given COPASI reaction.
Definition at line 1434 of file CSBMLExporter.cpp.
References createKineticLaw(), createUniqueId(), CCopasiMessage::EXCEPTION, CReaction::getChemEq(), CReaction::getFunction(), CChemEqElement::getMetabolite(), CChemEq::getModifiers(), CChemEqElement::getMultiplicity(), CCopasiObject::getObjectName(), CChemEq::getProducts(), CModelEntity::getSBMLId(), CReaction::getSBMLId(), CChemEq::getSubstrates(), CCopasiRootContainer::getUndefinedFunction(), INIT_DEFAULTS, CReaction::isReversible(), mCOPASI2SBMLMap, MCSBML, mHandledSBMLObjects, mIdMap, mIncompleteExport, mMetaIdMap, mpSBMLDocument, mSBMLLevel, CReaction::setSBMLId(), setSBMLNotes(), CCopasiVector< T >::size(), and updateMIRIAMAnnotation().
Referenced by createReactions().
|
protected |
Creates the reactions for the model.
Definition at line 1417 of file CSBMLExporter.cpp.
References CCopasiVector< T >::begin(), createReaction(), CCopasiVector< T >::end(), CCopasiDataModel::getModel(), CModel::getReactions(), and mpSBMLDocument.
Referenced by createSBMLDocument().
|
protected |
Creates the rule for the given COPASI model entity.
Definition at line 1937 of file CSBMLExporter.cpp.
References CModelEntity::ASSIGNMENT, convertExpression(), convertToASTNode(), createFunctionSetFromFunctionNames(), CCopasiMessage::ERROR, CCopasiMessage::EXCEPTION, findDirectlyUsedFunctions(), CModelEntity::FIXED, CMetab::getCompartment(), CCompartment::getDimensionality(), CModelEntity::getExpression(), CModelEntity::getExpressionPtr(), CCopasiRootContainer::getFunctionList(), CCopasiObject::getObjectName(), CCopasiObject::getObjectType(), CEvaluationTree::getRoot(), CModelEntity::getSBMLId(), CModelEntity::getStatus(), CEvaluationNode::getType(), CModelEntity::getValueReference(), CEvaluationNode::INVALID, isExpressionSBMLCompatible(), mCOPASI2SBMLMap, MCSBML, mIncompatibilities, mIncompleteExport, mInitialValueMap, mpSBMLDocument, mSBMLLevel, mSBMLVersion, multiplyByObject(), mUsedFunctions, outputIncompatibilities(), replace_local_parameters(), replaceSpeciesReferences(), CEvaluationTree::setInfix(), and CEvaluationNode::type().
Referenced by createRules().
|
protected |
Creates the rules for the model.
Definition at line 1835 of file CSBMLExporter.cpp.
References createRule(), CModelEntity::getSBMLId(), mODEVector, mpSBMLDocument, and orderRules().
Referenced by createSBMLDocument().
|
protected |
Creates an SBMLDocument from the given CCopasiDataModelObject. It checks if an SBMLDocument already exists from an import and if this is the case, the old document is copied. If none exists a new one is created. Copying the old one makes sure that if something goes wrong during export, the original model is still consistent.
Definition at line 3399 of file CSBMLExporter.cpp.
References addInitialAssignmentsToModel(), assignSBMLIdsToReactions(), checkForInitialAssignments(), SBMLUtils::collectIds(), collectIds(), convertToLevel1(), createCompartments(), createEvents(), createFunctionDefinitions(), createInitialAssignments(), createMetabolites(), createParameters(), createReactions(), createRules(), createUniqueId(), createUnits(), CCopasiMessage::EXCEPTION, fatalError, findAvogadro(), CCopasiDataModel::getCurrentSBMLDocument(), CModelEntity::getKey(), CCopasiDataModel::getModel(), CCopasiObject::getObjectName(), CModelEntity::getSBMLId(), hasVolumeAssignment(), mAvogadroCreated, mCOPASI2SBMLMap, mExportedFunctions, mFunctionIdMap, mFunctionMap, mHaveModelHistoryAuthorWarning, mHaveModelHistoryCreationDateWarning, mHaveModelHistoryModificationDateWarning, mIdMap, mIncompatibilities, mIncompleteExport, mInitialValueMap, mMetaIdMap, mpAvogadro, mpSBMLDocument, mSBMLLevel, mSBMLVersion, mVariableVolumes, outputIncompatibilities(), CModel::removeModelValue(), setSBMLNotes(), updateCOPASI2SBMLMap(), and updateMIRIAMAnnotation().
Referenced by exportModelToString().