COPASI API
4.40.278
|
#include <CSBMLExporter.h>
Public Member Functions | |
virtual void | clearCallBack () |
bool | createProgressStepOrStop (unsigned C_INT32 globalStep, unsigned C_INT32 currentTotal, const std::string &title) |
CSBMLExporter () | |
void | disownSBMLDocument () |
bool | exportLayout (unsigned int sbmlLevel, CDataModel &dataModel) |
bool | exportModel (CDataModel &dataModel, const std::string &filename, unsigned int sbmlLevel=2, unsigned int sbmlVersion=1, bool overwrite=false) |
const std::string | exportModelToString (CDataModel &dataModel, unsigned int sbmlLevel, unsigned int sbmlVersion) |
void | finishCurrentStep () |
void | finishExport () |
const CProcessReport * | getCallBack () const |
const std::map< const CDataObject *, SBase * > & | getCOPASI2SBMLMap () const |
SBMLDocument * | getSBMLDocument () |
bool | isSetExportCOPASIMIRIAM () const |
bool | reportCurrentProgressOrStop () |
void | setExportCOPASIMIRIAM (bool exportMIRIAM) |
void | setHandler (CProcessReport *pProcessReport) |
~CSBMLExporter () | |
Static Public Member Functions | |
static XMLNode * | createSBMLNotes (const std::string ¬es_string) |
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 CDataModel &pDataModel, int sbmlLevel, int sbmlVersion, std::map< std::string, const SBase * > &idMap) |
Protected Member Functions | |
void | addInitialAssignmentsToModel (const CDataModel &dataModel) |
void | assignSBMLIdsToReactions (CModel *pModel) |
void | checkForUnsupportedFunctionCalls (const CDataModel &dataModel, unsigned int sbmlLEvel, unsigned int sbmlVersion, std::vector< SBMLIncompatibility > &result) |
void | checkForUnsupportedObjectReferences (const CDataModel &dataModel, unsigned int sbmlLevel, unsigned int sbmlVersion, std::vector< SBMLIncompatibility > &result) |
void | collectIds (const CDataModel &dataModel, std::map< std::string, const SBase * > &idMap) |
ASTNode * | convertToASTNode (const CEvaluationNode *pOrig, CDataModel &dataModel) |
void | convertToLevel1 () |
void | createAreaUnit (const CDataModel &dataModel) |
void | createAvogadroIfNeeded (const CDataModel &dataModel) |
void | createCompartment (const CCompartment &compartment) |
bool | createCompartments (CDataModel &dataModel) |
void | createEvent (const CEvent &event, Event *pSBMLEvent, CDataModel &dataModel) |
bool | createEvents (CDataModel &dataModel) |
void | createFunctionDefinition (CFunction &function, CDataModel &dataModel) |
bool | createFunctionDefinitions (CDataModel &dataModel) |
const std::map< std::string, const SBase * > | createIdMap (const Model &sbmlModel) |
void | createInitialAssignment (const CModelEntity &modelEntity, CDataModel &dataModel) |
bool | createInitialAssignments (CDataModel &dataModel) |
CEvaluationNode * | createKineticExpression (CFunction *pFun, const std::vector< std::vector< const CDataObject * > > &arguments) |
KineticLaw * | createKineticLaw (const CReaction &reaction, CDataModel &dataModel, unsigned int level, unsigned int version) |
void | createLengthUnit (const CDataModel &dataModel) |
void | createMetabolite (const CMetab &metab) |
bool | createMetabolites (CDataModel &dataModel) |
void | createParameter (const CModelValue ¶meter) |
bool | createParameters (CDataModel &dataModel) |
void | createReaction (const CReaction &reaction, CDataModel &dataModel) |
bool | createReactions (CDataModel &dataModel) |
void | createRule (const CModelEntity &modelEntity, CDataModel &dataModel, Rule *pOldRule) |
bool | createRules (CDataModel &dataModel) |
bool | createSBMLDocument (CDataModel &dataModel) |
void | createSubstanceUnit (const CDataModel &dataModel) |
void | createTimeUnit (const CDataModel &dataModel) |
UnitDefinition * | createUnitDefinitionFor (const CUnit &unit) |
creates and SBML UnitDefinition for the given unit More... | |
void | createUnits (const CDataModel &dataModel) |
void | createVolumeUnit (const CDataModel &dataModel) |
void | exportAndAssignUnit (const CUnit &unit, SBase *sbmlElement) |
exports the given unit to the sbmlElement More... | |
void | exportEventAssignments (const CEvent &event, Event *pSBMLEvent, CDataModel &dataModel) |
void | findAvogadro (const CDataModel &dataModel) |
bool | hasVolumeAssignment (const CDataModel &dataModel) |
std::vector< const CModelEntity * > | orderRules (const CDataModel &dataModel) |
void | outputIncompatibilities () const |
void | removeInitialAssignment (const std::string &sbmlId) |
void | removeRule (const std::string &sbmlId) |
void | removeUnusedObjects () |
void | replace_local_parameters (ASTNode *pOrigNode, const CDataModel &dataModel) |
XMLNode * | replaceChild (const XMLNode *pParent, const XMLNode *pNewChild, unsigned int index) |
CEvaluationNode * | replaceSpeciesReferences (const CEvaluationNode *pOrigNode, const CDataModel &dataModel) |
void | restore_local_parameters (ASTNode *pOrigNode, const CDataModel &dataModel) |
void | setFunctionSBMLIds (const CEvaluationNode *pNode, CDataModel &dataModel) |
void | updateCOPASI2SBMLMap (const CDataModel &dataModel) |
bool | updateMIRIAMAnnotation (const CDataObject *pCOPASIObject, SBase *pSBMLObject, std::map< std::string, const SBase * > &metaIds) |
Static Protected Member Functions | |
static bool | checkForEvents (const CDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | checkForInitialAssignments (const CDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | checkForODESpeciesInNonfixedCompartment (const CDataModel &dataModel, std::vector< SBMLIncompatibility > result) |
static void | checkForPiecewiseFunctions (const CDataModel &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< CEvaluationNode::SubType > &unsupportedFunctions, std::vector< SBMLIncompatibility > &result, const std::string &objectDescription) |
static void | checkForUnsupportedObjectReferences (const CEvaluationTree &expression, const CDataModel &dataModel, unsigned int sbmlLevel, unsigned int sbmlVersion, std::vector< SBMLIncompatibility > &result, std::map< std::string, const SBase * > &idMap, 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< const CDataObject * > > &arguments, bool isReversible) |
static ASTNode * | createTimesTree (const CDataVector< CChemEqElement > &vect, unsigned int pos=0) |
static const std::set< CEvaluationNode::SubType > | createUnsupportedFunctionTypeSet (unsigned int sbmlLevel) |
static void | findDirectlyUsedFunctions (const CEvaluationNode *pRootNode, std::set< std::string > &result) |
static void | findModelEntityDependencies (const CEvaluationNode *pNode, const CDataModel &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 (const CDataObject *pTarget, const CExpression *pExpression, const CDataModel &dataModel, unsigned int sbmlLevel, unsigned int sbmlVersion, const std::string &eventName, std::vector< SBMLIncompatibility > &result, std::map< std::string, const SBase * > &idMap) |
static void | isEventSBMLCompatible (const CEvent *pEvent, const CDataModel &dataModel, unsigned int sbmlLevel, unsigned int sbmlVersion, std::vector< SBMLIncompatibility > &result, std::map< std::string, const SBase * > &idMap) |
static void | isExpressionSBMLCompatible (const CEvaluationTree &expr, const CDataModel &dataModel, int sbmlLevel, int sbmlVersion, std::vector< SBMLIncompatibility > &result, std::map< std::string, const SBase * > &idMap, const std::string &objectDescription, bool initialExression=false, std::map< const std::string, Parameter * > *initialMap=NULL) |
static void | isExpressionSBMLL1Compatible (const CEvaluationTree &expr, const CDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | isExpressionSBMLL2V1Compatible (const CEvaluationTree &expr, const CDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | isExpressionSBMLL2V3Compatible (const CEvaluationTree &expression, const CDataModel &pDataModel, std::vector< SBMLIncompatibility > &result) |
static void | isModelSBMLL1Compatible (const CDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | isModelSBMLL2V1Compatible (const CDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static void | isModelSBMLL2V3Compatible (const CDataModel &dataModel, std::vector< SBMLIncompatibility > &result) |
static bool | isValidSId (const std::string &id) |
static CEvaluationNode * | multiplyByObject (const CEvaluationNode *pOrigNode, const CDataObject *pObject) |
static ASTNode * | replaceL1IncompatibleNodes (const ASTNode *pNode) |
static bool | setSBMLNotes (SBase *pSBase, const CAnnotation *pAnno) |
CSBMLExporter::CSBMLExporter | ( | ) |
Default constructor
CSBMLExporter::~CSBMLExporter | ( | ) |
Destructor
References mDocumentDisowned, mpSBMLDocument, and pdelete.
|
protected |
References createAvogadroIfNeeded(), CMetab::getCompartment(), CDataContainer::getObject(), CDataObject::getObjectParent(), mAvogadroId, mInitialValueMap, and mpSBMLDocument.
Referenced by createSBMLDocument().
|
protected |
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.
References CDataVector< CType >::begin(), createUniqueId(), CDataVector< CType >::empty(), CDataVector< CType >::end(), CDataObject::getObjectName(), CModel::getReactions(), and mIdMap.
Referenced by createSBMLDocument().
|
staticprotected |
Checks if the given datamodel contains events. This is called if SBML Level 1 is to be exported.
References CDataVector< CType >::empty(), CModel::getEvents(), and CDataModel::getModel().
Referenced by createEvents(), and isModelSBMLL1Compatible().
|
staticprotected |
This method checks whether the given model contains any initial assignments.
References CDataVector< CType >::begin(), CDataVector< CType >::empty(), CDataVector< CType >::end(), CModel::getCompartments(), CModel::getMetabolites(), CDataModel::getModel(), CModel::getModelValues(), and CDataObject::getObjectName().
Referenced by createSBMLDocument(), isModelSBMLL1Compatible(), and isModelSBMLL2V1Compatible().
|
staticprotected |
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.
References CDataVector< CType >::begin(), CDataVector< CType >::end(), CModelEntity::FIXED, CModel::getMetabolites(), CDataModel::getModel(), CDataObject::getObjectName(), CModelEntity::getStatus(), and CModelEntity::ODE.
Referenced by isModelSBMLCompatible().
|
staticprotected |
Checks all expressions in the given datamodel for piecewise defined functions.
References CModelEntity::ASSIGNMENT, createFunctionSetFromFunctionNames(), findDirectlyUsedFunctions(), findUsedFunctions(), CModel::getCompartments(), CModelEntity::getExpressionPtr(), CReaction::getFunction(), CRootContainer::getFunctionList(), CModel::getMetabolites(), CDataModel::getModel(), CModel::getModelValues(), CDataObject::getObjectName(), CModel::getReactions(), CEvaluationTree::getRoot(), CModelEntity::getStatus(), CModelEntity::ODE, and CDataVector< CType >::size().
Referenced by checkForPiecewiseFunctions(), and isModelSBMLL1Compatible().
|
staticprotected |
Checks the given node and all it's children for the occurrence of piecewise functions.
References checkForPiecewiseFunctions(), CEvaluationNode::CHOICE, CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getSibling(), and CEvaluationNode::mainType().
|
protected |
This methods checks, whether 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.
References createUnsupportedFunctionTypeSet(), CModelEntity::getExpressionPtr(), CModelEntity::getInitialExpressionPtr(), CDataObject::getObjectName(), CDataObject::getObjectType(), CEvaluationTree::getRoot(), mAssignmentVector, mInitialAssignmentVector, mODEVector, and mUsedFunctions.
Referenced by checkForUnsupportedFunctionCalls(), and isExpressionSBMLCompatible().
|
staticprotected |
This static methods checks recursively, whether the given CEvaluationNode contains any function calls that can not be expressed in SBML like the random distribution functions.
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.
References checkForUnsupportedFunctionCalls(), CEvaluationNode::FUNCTION, CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getData(), CCopasiNode< _Data >::getSibling(), CEvaluationNode::mainType(), and CEvaluationNode::subType().
|
protected |
Checks all assignments (initial and transient) for references to objects that can not be exported to SBML.
References CModelEntity::getExpressionPtr(), CModelEntity::getInitialExpressionPtr(), CDataModel::getModel(), mAssignmentVector, mIdMap, mInitialAssignmentVector, mInitialValueMap, and mODEVector.
Referenced by isExpressionSBMLCompatible().
|
staticprotected |
Checks the given expression for references to objects that can not be exported to SBML.
References addParticleNumberToInitialValueMap(), addToInitialValueMap(), createUniqueId(), CObjectInterface::DataObject(), CDataObject::getCN(), CDataModel::getModel(), CEvaluationTree::getNodeList(), CDataContainer::getObject(), CEvaluationNodeObject::getObjectCN(), CDataObject::getObjectFromCN(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CDataObject::getObjectType(), CDataObject::getValuePointer(), CDataObject::hasFlag(), CEvaluationNode::mainType(), CEvaluationNode::OBJECT, CDataObject::Reference, and CCopasiMessage::WARNING.
|
virtual |
resets the currently set callback by calling setHandler(NULL)
References setHandler().
|
protected |
This method goes through the given datamodel and collects all SBML ids.
References CModel::getCompartments(), CModel::getEvents(), CRootContainer::getFunctionList(), CModel::getMetabolites(), CDataModel::getModel(), CModel::getModelValues(), CModel::getReactions(), CFunction::getSBMLId(), CEvent::getSBMLId(), CModelEntity::getSBMLId(), CReaction::getSBMLId(), CFunctionDB::loadedFunctions(), and CDataVector< CType >::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.
References CCopasiMessage::EXCEPTION.
|
staticprotected |
Creates an ASTNode based tree where all occurrences 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.
References 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.
References adjustNames(), mIdMap, mpSBMLDocument, 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
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.
References createUnitDefinitionFor(), CModel::getAreaUnit(), CDataModel::getModel(), CModelEntity::getModel(), mpSBMLDocument, and pdelete.
Referenced by createUnits().
|
protected |
References createUniqueId(), CDataModel::getModel(), CDataObject::getObjectName(), CModel::getQuantity2NumberFactor(), mAvogadroCreated, mAvogadroId, mCOPASI2SBMLMap, mHandledSBMLObjects, mIdMap, mpAvogadro, and mpSBMLDocument.
Referenced by addInitialAssignmentsToModel(), and replaceSpeciesReferences().
|
protected |
Creates the compartment for the given COPASI compartment.
References CModelEntity::ASSIGNMENT, createUniqueId(), CCompartment::getDimensionality(), CModelEntity::getInitialExpression(), CModelEntity::getInitialValue(), CDataObject::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.
References CDataVector< CType >::begin(), createCompartment(), CDataVector< CType >::end(), CModel::getCompartments(), CDataModel::getModel(), CModelEntity::getModel(), mCurrentStepCounter, and reportCurrentProgressOrStop().
Referenced by createSBMLDocument().
|
protected |
Creates an SBML Event for the given COPASI event.
References convertExpression(), convertToASTNode(), createFunctionSetFromFunctionNames(), createUniqueId(), CCopasiMessage::ERROR, CCopasiMessage::EXCEPTION, exportEventAssignments(), findDirectlyUsedFunctions(), CEvent::getDelayAssignment(), CEvent::getFireAtInitialTime(), CRootContainer::getFunctionList(), CEvaluationTree::getInfix(), CDataObject::getObjectName(), CEvent::getPersistentTrigger(), CEvaluationTree::getRoot(), CEvent::getSBMLId(), CEvaluationNode::INVALID, isExpressionSBMLCompatible(), CEvaluationNode::mainType(), mCOPASI2SBMLMap, MCSBML, mIdMap, mIncompatibilities, mIncompleteExport, mInitialValueMap, mMetaIdMap, mpSBMLDocument, mSBMLLevel, mSBMLVersion, mUsedFunctions, outputIncompatibilities(), replace_local_parameters(), replaceSpeciesReferences(), CEvaluationTree::setInfix(), setSBMLNotes(), updateMIRIAMAnnotation(), and CCopasiMessage::WARNING.
Referenced by createEvents().
|
protected |
Creates the events for the given data model.
References CDataVector< CType >::begin(), checkForEvents(), createEvent(), CDataVector< CType >::end(), CCopasiMessage::ERROR, CModel::getEvents(), CDataModel::getModel(), mCOPASI2SBMLMap, mCurrentStepCounter, mIncompatibilities, mpSBMLDocument, mSBMLLevel, and reportCurrentProgressOrStop().
Referenced by createSBMLDocument().
|
protected |
Create the SBML function definition from the given COPASI function.
References convertToASTNode(), createUniqueId(), CCopasiMessage::EXCEPTION, CDataObject::getObjectName(), isExpressionSBMLCompatible(), isValidSId(), mCOPASI2SBMLMap, MCSBML, mExportedFunctions, mFunctionMap, mIdMap, mIncompatibilities, mMetaIdMap, mpSBMLDocument, mSBMLLevel, mSBMLVersion, nameToSbmlId(), renameAstNodes(), setSBMLNotes(), CFunctionParameters::size(), updateMIRIAMAnnotation(), and CCopasiMessage::WARNING.
Referenced by createFunctionDefinitions().
|
protected |
Create all function definitions.
References createFunctionDefinition(), fatalError, findUsedFunctions(), CRootContainer::getFunctionList(), CDataObject::getObjectName(), CUndoObjectInterface::insert(), CDataContainer::insert(), mCOPASI2SBMLMap, mExportedFunctions, mFunctionMap, mpSBMLDocument, mUsedFunctions, and reportCurrentProgressOrStop().
Referenced by createSBMLDocument().
|
staticprotected |
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.
|
protected |
Creates the initial assignment for the given COPASI model entity.
References convertToASTNode(), createFunctionSetFromFunctionNames(), CCopasiMessage::EXCEPTION, findDirectlyUsedFunctions(), CMetab::getCompartment(), CRootContainer::getFunctionList(), CModelEntity::getInitialExpressionPtr(), CModelEntity::getInitialValueReference(), CDataObject::getObjectName(), CDataObject::getObjectType(), CEvaluationTree::getRoot(), CModelEntity::getSBMLId(), CEvaluationNode::INVALID, isExpressionSBMLCompatible(), CEvaluationNode::mainType(), mCOPASI2SBMLMap, MCSBML, mHandledSBMLObjects, mIdMap, mIncompatibilities, mIncompleteExport, mInitialValueMap, mpSBMLDocument, multiplyByObject(), mUsedFunctions, outputIncompatibilities(), replace_local_parameters(), and replaceSpeciesReferences().
Referenced by createInitialAssignments().
|
protected |
Creates the initial assignments for the model.
References createInitialAssignment(), mInitialAssignmentVector, and reportCurrentProgressOrStop().
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 CDataModel& 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 CDataModel& 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.
References CEvaluationNodeCall::addChild(), CEvaluationNode::CN, createMassActionExpression(), fatalError, CEvaluationNode::FUNCTION, CDataObject::getCN(), CDataObject::getObjectName(), CEvaluationTree::getType(), CFunction::getVariables(), CFunction::isReversible(), CEvaluationTree::MassAction, mUsedFunctions, CFunctionParameters::size(), and TriTrue.
Referenced by createKineticLaw().
|
protected |
Create the kinetic law for the given reaction. On failure NULL is returned.
References CReaction::ConcentrationPerTime, convertToASTNode(), createKineticExpression(), CDataVector< CType >::empty(), fatalError, CReaction::getChemEq(), CCopasiParameter::getCN(), CReaction::getEffectiveKineticLawUnitType(), CReaction::getFunction(), CReaction::getFunctionParameters(), CDataObject::getObjectName(), CReaction::getParameterObjects(), CReaction::getParameterValue(), CChemEq::getProducts(), CModelEntity::getSBMLId(), CReaction::getScalingCompartment(), CChemEq::getSubstrates(), CFunctionParameter::getUsage(), isDividedByVolume(), CReaction::isLocalParameter(), CFunction::isReversible(), mParameterReplacementMap, mpSBMLDocument, mSBMLLevel, CFunctionParameter::PARAMETER, replaceSpeciesReferences(), restore_local_parameters(), CFunctionParameters::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.
References createUnitDefinitionFor(), CModel::getLengthUnit(), CDataModel::getModel(), CModelEntity::getModel(), mpSBMLDocument, and pdelete.
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.
References CCopasiNode< _Data >::addChild(), CEvaluationNode::CN, CEvaluationNode::DOUBLE, CDataObject::getCN(), CEvaluationNode::MINUS, CEvaluationNode::MULTIPLY, and CEvaluationNode::POWER.
Referenced by createKineticExpression().
|
protected |
Creates the species for the given COPASI metabolite.
References CModelEntity::ASSIGNMENT, createUniqueId(), CModelEntity::FIXED, CMetab::getCompartment(), CMetab::getInitialConcentration(), CModelEntity::getInitialExpression(), CModelEntity::getInitialValue(), CMetab::getObjectDisplayName(), CDataObject::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.
References CDataVector< CType >::begin(), SBMLUnitSupport::checkForSpatialSizeUnits(), createMetabolite(), CDataVector< CType >::end(), CModel::getMetabolites(), CDataModel::getModel(), CModelEntity::getModel(), MCSBML, mCurrentStepCounter, mIncompatibilities, mSBMLLevel, mSBMLVersion, mSpatialSizeUnitsSpecies, reportCurrentProgressOrStop(), and CCopasiMessage::WARNING.
Referenced by createSBMLDocument().
|
protected |
Creates the parameter for the given COPASI parameter.
References CModelEntity::ASSIGNMENT, createUniqueId(), exportAndAssignUnit(), CModelEntity::getInitialExpression(), CModelEntity::getInitialValue(), CDataObject::getObjectName(), CModelEntity::getSBMLId(), CModelEntity::getStatus(), CModelEntity::getUnitExpression(), 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.
References CDataVector< CType >::begin(), createParameter(), CDataVector< CType >::end(), CDataModel::getModel(), CModelEntity::getModel(), CModel::getModelValues(), mCurrentStepCounter, and reportCurrentProgressOrStop().
Referenced by createSBMLDocument().
bool CSBMLExporter::createProgressStepOrStop | ( | unsigned C_INT32 | globalStep, |
unsigned C_INT32 | currentTotal, | ||
const std::string & | title | ||
) |
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 createSBMLDocument(), exportLayout(), and exportModelToString().
|
protected |
Creates the reaction for the given COPASI reaction.
References createKineticLaw(), createUniqueId(), CDataVector< CType >::empty(), CCopasiMessage::EXCEPTION, CReaction::getChemEq(), CReaction::getFunction(), CChemEqElement::getMetabolite(), CChemEq::getModifiers(), CChemEqElement::getMultiplicity(), CDataObject::getObjectName(), CChemEq::getProducts(), CModelEntity::getSBMLId(), CReaction::getSBMLId(), CChemEq::getSubstrates(), CRootContainer::getUndefinedFunction(), INIT_DEFAULTS, CReaction::isReversible(), mCOPASI2SBMLMap, MCSBML, mHandledSBMLObjects, mIdMap, mIncompleteExport, mMetaIdMap, mpSBMLDocument, mSBMLLevel, CReaction::setSBMLId(), setSBMLNotes(), and updateMIRIAMAnnotation().
Referenced by createReactions().
|
protected |
Creates the reactions for the model.
References CDataVector< CType >::begin(), createReaction(), CDataVector< CType >::end(), CDataModel::getModel(), CModelEntity::getModel(), CModel::getReactions(), mCurrentStepCounter, and reportCurrentProgressOrStop().
Referenced by createSBMLDocument().
|
protected |
Creates the rule for the given COPASI model entity.
References CModelEntity::ASSIGNMENT, convertExpression(), convertToASTNode(), createFunctionSetFromFunctionNames(), CCopasiMessage::ERROR, findDirectlyUsedFunctions(), CModelEntity::FIXED, CMetab::getCompartment(), CModelEntity::getExpression(), CModelEntity::getExpressionPtr(), CRootContainer::getFunctionList(), CDataObject::getObjectName(), CDataObject::getObjectType(), CEvaluationTree::getRoot(), CModelEntity::getSBMLId(), CModelEntity::getStatus(), CModelEntity::getValueReference(), CEvaluationNode::INVALID, isExpressionSBMLCompatible(), CEvaluationNode::mainType(), mCOPASI2SBMLMap, MCSBML, mIdMap, mIncompatibilities, mIncompleteExport, mInitialValueMap, mpSBMLDocument, multiplyByObject(), mUsedFunctions, outputIncompatibilities(), replace_local_parameters(), replaceSpeciesReferences(), and CEvaluationTree::setInfix().
Referenced by createRules().
|
protected |
Creates the rules for the model.
References createRule(), CModelEntity::getSBMLId(), mODEVector, mpSBMLDocument, orderRules(), and reportCurrentProgressOrStop().
Referenced by createSBMLDocument().
|
protected |
Creates an SBMLDocument from the given CDataModelObject. 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.
References addInitialAssignmentsToModel(), assignSBMLIdsToReactions(), checkForInitialAssignments(), collectIds(), SBMLUtils::collectIds(), convertToLevel1(), createCompartments(), createEvents(), createFunctionDefinitions(), createInitialAssignments(), createMetabolites(), createParameters(), createProgressStepOrStop(), createReactions(), createRules(), createUniqueId(), createUnits(), CCopasiMessage::ERROR, CCopasiMessage::EXCEPTION, fatalError, findAvogadro(), finishExport(), CModel::getCompartments(), CDataModel::getCurrentSBMLDocument(), CModel::getEvents(), CModelEntity::getKey(), CModel::getMetabolites(), CDataModel::getModel(), CModel::getModelValues(), CDataObject::getObjectName(), CModel::getReactions(), CModelEntity::getSBMLId(), hasVolumeAssignment(), mAvogadroCreated, mCOPASI2SBMLMap, mExportedFunctions, mFunctionIdMap, mFunctionMap, mIdMap, mIncompatibilities, mInitialValueMap, mpAvogadro, mpSBMLDocument, mSBMLLevel, mSBMLVersion, mVariableVolumes, outputIncompatibilities(), CModel::removeModelValue(), setSBMLNotes(), CDataVector< CType >::size(), updateCOPASI2SBMLMap(), and updateMIRIAMAnnotation().
Referenced by exportModelToString().
|
static |
Method to create a valid XHTML node from a CModels comments string. This method is declared public so that I can call it from the unit tests.
Method to create a valid XHTML node from a CModels comments string.
Referenced by setSBMLNotes().
|
protected |
Creates the substance unit for the SBML model.
References createUnitDefinitionFor(), CDataModel::getModel(), CModelEntity::getModel(), CModel::getQuantityUnit(), mpSBMLDocument, mSBMLLevel, and pdelete.
Referenced by createUnits().
|
staticprotected |
This method creates an ASTNode tree where all the species specified in the given vector are multiplied. This is used to create the mass action kinetic law.
References CModelEntity::getSBMLId(), and CDataVector< CType >::size().
|
protected |
Creates the time unit for the SBML model.
References createUnitDefinitionFor(), CDataModel::getModel(), CModelEntity::getModel(), CModel::getTimeUnit(), mpSBMLDocument, and pdelete.
Referenced by createUnits().
|
static |
Create a unique id for an SBML object. I can't just take the Copasi key of the object since this might conflict with an already existing sbml id which came from the sbmlid attribute in a copasi file or directly by importing an SBML file.
Create a unique id for an SBML object. I can't just take the COPASI key of the object since this might conflict with an already existing SBML id which came from the sbmlid attribute in a COPASI file or directly by importing an SBML file.
References nameToSbmlId().
Referenced by addParticleNumberToInitialValueMap(), addToInitialValueMap(), assignSBMLIdsToReactions(), checkForUnsupportedObjectReferences(), createAvogadroIfNeeded(), createCompartment(), createEvent(), createFunctionDefinition(), createFunctionDefinitonForURI(), createMetabolite(), createParameter(), createReaction(), createSBMLDocument(), CLGraphicalObject::exportToSBML(), CLayout::exportToSBML(), replace_local_parameters(), setFunctionSBMLIds(), and updateMIRIAMAnnotation().
|
protected |
creates and SBML UnitDefinition for the given unit
unit | the COPASI unit element |
References addCUnitComponentToUnitDefinition(), addSymbolComponentToUnitDefinition(), CUnit::getComponents(), CUnit::getExpression(), CUnit::getSymbolComponents(), CUnit::isUndefined(), mIdMap, and mpSBMLDocument.
Referenced by createAreaUnit(), createLengthUnit(), createSubstanceUnit(), createTimeUnit(), createVolumeUnit(), and exportAndAssignUnit().
|
protected |
Creates the units for the SBML model.
References createAreaUnit(), createLengthUnit(), createSubstanceUnit(), createTimeUnit(), and createVolumeUnit().
Referenced by createSBMLDocument().
|
staticprotected |
Creates a set of all function subtypes that can not be exported for a certain SBML level.
References CEvaluationNode::ARCCOTH, CEvaluationNode::MAX, and CEvaluationNode::MIN.
Referenced by checkForUnsupportedFunctionCalls(), and isExpressionSBMLCompatible().
|
protected |
Creates the volume unit for the SBML model.
References createUnitDefinitionFor(), CDataModel::getModel(), CModelEntity::getModel(), CModel::getVolumeUnit(), mpSBMLDocument, and pdelete.
Referenced by createUnits().
void CSBMLExporter::disownSBMLDocument | ( | ) |
This method assures that the SBMLDocument is not deleted by the destructor of the exporter. This allows us to get the SBMLDocument from the exporter and store it in the data model without having to copy it.
References mDocumentDisowned.
Referenced by CDataModel::exportSBML(), and CDataModel::exportSBMLToString().
|
protected |
exports the given unit to the sbmlElement
unit | the unit to export |
sbmlElement | the sbml element that the unit should be assigned to |
References createUnitDefinitionFor(), CUnit::isUndefined(), and mpSBMLDocument.
Referenced by createParameter().
|
protected |
This method creates the individual event assignments for the given event.
References CDataVector< CType >::begin(), convertExpression(), convertToASTNode(), createFunctionSetFromFunctionNames(), CObjectInterface::DataObject(), CDataVector< CType >::end(), CCopasiMessage::EXCEPTION, fatalError, findDirectlyUsedFunctions(), CMetab::getCompartment(), CRootContainer::getFunctionList(), CEvaluationTree::getInfix(), CDataModel::getModel(), CDataContainer::getObject(), CDataObject::getObjectDataModel(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CDataObject::getObjectType(), CModel::getQuantity2NumberFactor(), CEvaluationTree::getRoot(), CEvent::getSBMLId(), CModelEntity::getSBMLId(), CModelEntity::getValueReference(), CEvaluationNode::INVALID, isExpressionSBMLCompatible(), CEvaluationNode::mainType(), mCOPASI2SBMLMap, MCSBML, mHandledSBMLObjects, mIdMap, mIncompatibilities, mIncompleteExport, mInitialValueMap, mSBMLLevel, mSBMLVersion, multiplyByObject(), mUsedFunctions, outputIncompatibilities(), replace_local_parameters(), replaceSpeciesReferences(), CEvaluationTree::setInfix(), and CCopasiMessage::WARNING.
Referenced by createEvent().
bool CSBMLExporter::exportLayout | ( | unsigned int | sbmlLevel, |
CDataModel & | dataModel | ||
) |
Export the model to SBML. The SBML model is returned as a string. In case of an error, an empty string is returned.
References createProgressStepOrStop(), CListOfLayouts::exportToSBML(), finishExport(), getDefaultStyle(), CDataModel::getListOfLayouts(), getNumDefaultStyles(), mCOPASI2SBMLMap, mIdMap, mpSBMLDocument, and CLGlobalRenderInformation::toSBML().
Referenced by exportModelToString().
bool CSBMLExporter::exportModel | ( | CDataModel & | dataModel, |
const std::string & | filename, | ||
unsigned int | sbmlLevel = 2 , |
||
unsigned int | sbmlVersion = 1 , |
||
bool | overwrite = false |
||
) |
Export the model to SBML. The model is written to the file given by filename. If the export fails, false is returned.
References CCopasiMessage::ERROR, exportModelToString(), CLocaleString::fromUtf8(), and MCDirEntry.
Referenced by CDataModel::exportSBML().
const std::string CSBMLExporter::exportModelToString | ( | CDataModel & | dataModel, |
unsigned int | sbmlLevel, | ||
unsigned int | sbmlVersion | ||
) |
Export the model to SBML. The SBML model is returned as a string. In case of an error, an empty string is returned.
References CProcessReport::addItem(), createProgressStepOrStop(), createSBMLDocument(), exportLayout(), finishExport(), mGlobalStepCounter, mGlobalStepHandle, mGlobalStepTotal, mHandledSBMLObjects, mpProcessReport, mpSBMLDocument, mSBMLLevel, mSBMLVersion, pdelete, removeStickyTagFromElements(), removeUnusedObjects(), CProcessReport::setName(), and CVersion::VERSION.
Referenced by exportModel(), and CDataModel::exportSBMLToString().
|
protected |
Try to find a global parameter that represents avogadros number.
References CDataVector< CType >::begin(), CDataVector< CType >::end(), CModelEntity::FIXED, CDataModel::getModel(), CModel::getModelValues(), CModel::getQuantity2NumberFactor(), and mpAvogadro.
Referenced by createSBMLDocument().
|
staticprotected |
Go through a CEvaluationNode base tree and add the names of all functions directly called in this tree to the set.
References CEvaluationNode::CALL, CCopasiNode< _Data >::getChild(), CCopasiNode< _Data >::getData(), CCopasiNode< _Data >::getSibling(), and CEvaluationNode::mainType().
Referenced by checkForPiecewiseFunctions(), createEvent(), createInitialAssignment(), createRule(), exportEventAssignments(), findUsedFunctions(), isEventAssignmentSBMLCompatible(), isEventSBMLCompatible(), and isModelSBMLCompatible().
|
staticprotected |
Find all ModelEntities for which the given node and its children contains references.
References CObjectInterface::DataObject(), fatalError, CCopasiNode< _Data >::getChild(), CEvaluationNodeObject::getObjectCN(), CDataObject::getObjectFromCN(), CDataObject::getObjectParent(), CCopasiNode< _Data >::getSibling(), CDataObject::hasFlag(), CDataContainer::insert(), CEvaluationNode::mainType(), CEvaluationNode::OBJECT, and CDataObject::Reference.
Referenced by orderRules().
|
staticprotected |
Takes a set of functions and recursively finds functions used by those functions
References createFunctionSetFromFunctionNames(), CCopasiMessage::EXCEPTION, findDirectlyUsedFunctions(), and CEvaluationTree::getRoot().
Referenced by checkForPiecewiseFunctions(), and createFunctionDefinitions().
void CSBMLExporter::finishCurrentStep | ( | ) |
Notifies the progress dialog that a step finished
References C_INVALID_INDEX, CProcessReport::finishItem(), mCurrentStepHandle, and mpProcessReport.
Referenced by finishExport().
void CSBMLExporter::finishExport | ( | ) |
Notifies the progress dialog that the overall exporting is complete
References finishCurrentStep(), CProcessReport::finishItem(), mGlobalStepHandle, and mpProcessReport.
Referenced by createSBMLDocument(), exportLayout(), and exportModelToString().
const CProcessReport * CSBMLExporter::getCallBack | ( | ) | const |
References mpProcessReport.
const std::map< const CDataObject *, SBase * > & CSBMLExporter::getCOPASI2SBMLMap | ( | ) | const |
Returns a const pointer to the COPASI2SBMLMap.
References mCOPASI2SBMLMap.
Referenced by CDataModel::exportSBML(), and CDataModel::exportSBMLToString().
SBMLDocument * CSBMLExporter::getSBMLDocument | ( | ) |
References mpSBMLDocument.
Referenced by CDataModel::exportSBML(), and CDataModel::exportSBMLToString().
|
protected |
This method goes through all compartments and events and checks if there is an assignment to a volume.
References CModelEntity::ASSIGNMENT, CDataVector< CType >::begin(), CObjectInterface::DataObject(), CDataVector< CType >::empty(), CDataVector< CType >::end(), CModel::getCompartments(), CModel::getEvents(), CDataModel::getModel(), CModelEntity::getModel(), CDataContainer::getObject(), CDataObject::getObjectParent(), CDataObject::getObjectType(), mSBMLLevel, mSBMLVersion, and CModelEntity::ODE.
Referenced by createSBMLDocument().
|
staticprotected |
checks if the given ASTNode based tree is divided by the volume of the compartment identified by the given id string.
Referenced by createKineticLaw().
|
staticprotected |
This method checks if the given event assignment object is SBML compatible.
References CModelEntity::ASSIGNMENT, findDirectlyUsedFunctions(), CModelEntity::FIXED, CDataObject::getObjectName(), CDataObject::getObjectType(), CEvaluationTree::getRoot(), CModelEntity::getStatus(), CEvaluationNode::INVALID, isExpressionSBMLCompatible(), CEvaluationNode::mainType(), and CCopasiMessage::RAW.
Referenced by isEventSBMLCompatible().
|
staticprotected |
This method checks if the given event object is SBML compatible.
References CDataVector< CType >::begin(), CObjectInterface::DataObject(), CDataVector< CType >::end(), findDirectlyUsedFunctions(), CEvent::getAssignments(), CEvent::getDelayExpressionPtr(), CDataContainer::getObject(), CDataObject::getObjectName(), CEvaluationTree::getRoot(), CEvent::getTriggerExpressionPtr(), isEventAssignmentSBMLCompatible(), isExpressionSBMLCompatible(), and CCopasiMessage::RAW.
Referenced by isModelSBMLCompatible().
|
staticprotected |
Checks whether the rule in the given model entity can be exported to the specified version of SBML. If it can be exported, the result vector will be empty, otherwise it will contain a number of messages that specify why it can't be exported.
References checkForUnsupportedFunctionCalls(), checkForUnsupportedObjectReferences(), createUnsupportedFunctionTypeSet(), and CEvaluationTree::getRoot().
Referenced by createEvent(), createFunctionDefinition(), createInitialAssignment(), createRule(), exportEventAssignments(), isEventAssignmentSBMLCompatible(), isEventSBMLCompatible(), and isModelSBMLCompatible().
|
staticprotected |
Checks whether the rule in the given model entity can be exported to SBML Level2 Version1. If it can be exported, the result vector will be empty, otherwise it will contain a number of messages that specify why it can't be exported.
|
staticprotected |
Checks whether the rule in the given model entity can be exported to SBML Level2 Version1. If it can be exported, the result vector will be empty, otherwise it will contain a number of messages that specify why it can't be exported.
|
staticprotected |
Checks whether the rule in the given model entity can be exported to SBML Level2 Version3. If it can be exported, the result vector will be empty, otherwise it will contain a number of messages that specify why it can't be exported.
|
static |
Checks wether the given data model can be exported to a certain version of SBML. If it can be exported, the result vector will be empty, otherwise it will contain a number of messages that specify why it can't be exported.
Checks whether the given data model can be exported to a certain version of SBML. If it can be exported, the result vector will be empty, otherwise it will contain a number of messages that specify why it can't be exported.
References CModelEntity::ASSIGNMENT, CDataVector< CType >::begin(), checkForODESpeciesInNonfixedCompartment(), CDataVector< CType >::end(), findDirectlyUsedFunctions(), CModel::getCompartments(), CModel::getEvents(), CModel::getMetabolites(), CDataModel::getModel(), CModel::getModelValues(), CDataObject::getObjectName(), CEvaluationTree::getRoot(), isEventSBMLCompatible(), isExpressionSBMLCompatible(), isModelSBMLL1Compatible(), isModelSBMLL2V1Compatible(), isModelSBMLL2V3Compatible(), and CModelEntity::ODE.
|
staticprotected |
Checks whether the given data model can be exported to SBML Level1 If it can be exported, the result vector will be empty, otherwise it will contain a number of messages that specify why it can't be exported.
References checkForEvents(), checkForInitialAssignments(), and checkForPiecewiseFunctions().
Referenced by isModelSBMLCompatible().
|
staticprotected |
Checks whether the given data model can be exported to SBML Level2 Version1. If it can be exported, the result vector will be empty, otherwise it will contain a number of messages that specify why it can't be exported.
References checkForInitialAssignments().
Referenced by isModelSBMLCompatible().
|
staticprotected |
Checks whether the given data model can be exported to SBML Level2 Version3. If it can be exported, the result vector will be empty, otherwise it will contain a number of messages that specify why it can't be exported.
References SBMLUnitSupport::checkForSpatialSizeUnits().
Referenced by isModelSBMLCompatible().
bool CSBMLExporter::isSetExportCOPASIMIRIAM | ( | ) | const |
Returns whether the exporter is supposed to export COPASIs MIRIAM annotation in addition to SBML MIRIAM.
References mExportCOPASIMIRIAM.
|
staticprotected |
Checks if the given string is a valid SId
Referenced by createFunctionDefinition(), and setFunctionSBMLIds().
|
staticprotected |
This method multiplies a given expression by the given object. 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(), CEvaluationNode::mainType(), CEvaluationNode::MULTIPLY, CEvaluationNode::OBJECT, CEvaluationNode::OPERATOR, and CEvaluationNode::subType().
Referenced by createInitialAssignment(), createRule(), and exportEventAssignments().
|
protected |
Sorts the rules.
References CCopasiMessage::EXCEPTION, findModelEntityDependencies(), CEvaluationTree::getRoot(), and mAssignmentVector.
Referenced by createRules().
|
protected |
Creates error messages from the list of incompatibilities and thows an exception.
References SBMLIncompatibility::getDetails(), SBMLIncompatibility::getMessage(), mIncompatibilities, SBMLIncompatibility::minSBMLLevel(), SBMLIncompatibility::minSBMLVersion(), and CCopasiMessage::RAW.
Referenced by createEvent(), createInitialAssignment(), createRule(), createSBMLDocument(), and exportEventAssignments().
|
protected |
Remove the initial assignment for the entity with the given id if there is any.
References mpSBMLDocument.
Referenced by createCompartment(), createMetabolite(), and createParameter().
|
protected |
Remove the rule for the entity with the given id if there is any.
References mpSBMLDocument.
Referenced by createCompartment(), createMetabolite(), and createParameter().
|
protected |
Remove all compartments, species, parameters and reactions that did not end up in mHandledSBMLObjects during an export.
Remove all compartments, species, parameters and reactions and initial assignments that did not end up in mHandledSBMLObjects during an export.
References mCOPASI2SBMLMap, mHandledSBMLObjects, and mpSBMLDocument.
Referenced by exportModelToString().
|
protected |
Goes through the expression tree and tries to find occurences of local parameters. If one is found, a global parameter is created and all references to the local parameters are substituted.
References C_FLOAT64, createUniqueId(), CObjectInterface::DataObject(), CCopasiParameter::getCN(), CDataObject::getObjectFromCN(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CCopasiParameter::getValue(), mHandledSBMLObjects, mIdMap, mParameterReplacementMap, and mpSBMLDocument.
Referenced by createEvent(), createInitialAssignment(), createRule(), and exportEventAssignments().
|
protected |
This method creates a copy of parent where the child with the given index is replaced by the new child given as the second argument. If index is greater than the number of children - 1, NULL is returned.
This method creates a copy of parent where the child with the given index is replaced by the new child given as the second argument. If index is greater than the number of children - 1, NULL is returned. If the new child is a null pointer, this method deleted the old node at the given index.
Referenced by updateMIRIAMAnnotation().
|
staticprotected |
This method goes through the ASTNode based tree rooted at pNode and replaces all unsupported nodes with constructs supported by SBML Level 1 The caller is responsible for freeing the memory of the returned object.
References fatalError, max, and ConverterASTNode::shallowCopy().
Referenced by convertASTTreeToLevel1().
|
protected |
Replaces references to species with reference to species divided by volume if it is a reference to a concentration or by a reference to the species times avogadros number if it is a reference to the amount. The method also takes into consideration the substance units of the model.
References CCopasiNode< _Data >::addChild(), addRateOfIfItDoesNotExist(), CEvaluationNode::CN, CEvaluationNode::copyBranch(), CEvaluationNode::copyNode(), createAvogadroIfNeeded(), CObjectInterface::DataObject(), CEvaluationNode::DIVIDE, CEvaluationNode::DOUBLE, CEvaluationNode::ENOTATION, fatalError, CModelEntity::FIXED, CCopasiNode< _Data >::getChild(), CDataObject::getCN(), CMetab::getCompartment(), CMetab::getConcentrationReference(), CCopasiNode< _Data >::getData(), CDataModel::getModel(), CDataContainer::getObject(), CEvaluationNodeObject::getObjectCN(), CDataObject::getObjectFromCN(), CDataObject::getObjectName(), CDataObject::getObjectParent(), CModel::getQuantity2NumberFactor(), CModel::getQuantityUnit(), CCopasiNode< _Data >::getSibling(), CModelEntity::getStatus(), CModelEntity::getValue(), CModelEntity::getValueReference(), CDataObject::hasFlag(), CEvaluationNode::INVALID, CEvaluationNode::mainType(), mIdMap, mpAvogadro, mpSBMLDocument, CEvaluationNode::MULTIPLY, mVariableVolumes, CEvaluationNode::NUMBER, CEvaluationNode::OBJECT, CEvaluationNode::OPERATOR, CDataObject::Reference, and CEvaluationNode::subType().
Referenced by createEvent(), createInitialAssignment(), createKineticLaw(), createRule(), and exportEventAssignments().
bool CSBMLExporter::reportCurrentProgressOrStop | ( | ) |
Notifies the progress dialog of local progress
References mCurrentStepHandle, mpProcessReport, and CProcessReport::progressItem().
Referenced by createCompartments(), createEvents(), createFunctionDefinitions(), createInitialAssignments(), createMetabolites(), createParameters(), createReactions(), and createRules().
|
protected |
This method goes through the expression tree and tries to find node names that correspond to common names of local parameters. If the common name also occurs in the replacement map, the node name has to be set to the id of the corresponding global parameter, otherwise the name has to be set to the object name of the parameter.
References CObjectInterface::DataObject(), CDataObject::getObjectFromCN(), CDataObject::getObjectName(), and mParameterReplacementMap.
Referenced by createKineticLaw().
void CSBMLExporter::setExportCOPASIMIRIAM | ( | bool | exportMIRIAM | ) |
Sets whether the exporter is supposed to export COPASIs MIRIAM annotation in addition to SBML MIRIAM.
References mExportCOPASIMIRIAM.
Referenced by CDataModel::exportSBML(), and CDataModel::exportSBMLToString().
|
protected |
This method traverse a CEvaluationTree and set the SBML id on all functions that are used in function calls in the tree.
References CEvaluationNode::CALL, createUniqueId(), fatalError, CFunctionDB::findFunction(), CCopasiNode< _Data >::getChild(), CRootContainer::getFunctionList(), CDataObject::getObjectName(), CFunction::getSBMLId(), CCopasiNode< _Data >::getSibling(), isValidSId(), CEvaluationNode::mainType(), mFunctionIdMap, mIdMap, and CFunction::setSBMLId().
Referenced by convertToASTNode().
void CSBMLExporter::setHandler | ( | CProcessReport * | pProcessReport | ) |
Sets the progress handler to be used while exporting set to NULL, to stop reporting
pHandler | the progress handler to be used, or NULL |
References mpProcessReport.
Referenced by clearCallBack(), CDataModel::exportSBML(), and CDataModel::exportSBMLToString().
|
staticprotected |
This is a general method to set the notes of an SBase object based on a COPASI Annotation. This will allow us to export notes on objects other than just the model.
References createSBMLNotes(), CAnnotation::getNotes(), CAnnotation::getUnsupportedAnnotations(), and CCopasiMessage::WARNING.
Referenced by createCompartment(), createEvent(), createFunctionDefinition(), createMetabolite(), createParameter(), createReaction(), and createSBMLDocument().
|
protected |
Creates a new COPASI2SBMLMap based on the old map and the copied SBMLDocument.
References mCOPASI2SBMLMap, and mIdMap.
Referenced by createSBMLDocument().
|
protected |
This method gets the MIRIAM annotation from the given COPASI object and sets it on the given SBML object.
This method updates the MIRIAM annotation on different model entities like the model itself, compartments, species, reactions, functions and global parameters
References CRDFPredicate::bqbiol_encodes, CRDFPredicate::bqbiol_hasPart, CRDFPredicate::bqbiol_hasProperty, CRDFPredicate::bqbiol_hasTaxon, CRDFPredicate::bqbiol_hasVersion, CRDFPredicate::bqbiol_is, CRDFPredicate::bqbiol_isDescribedBy, CRDFPredicate::bqbiol_isEncodedBy, CRDFPredicate::bqbiol_isHomologTo, CRDFPredicate::bqbiol_isPartOf, CRDFPredicate::bqbiol_isPropertyOf, CRDFPredicate::bqbiol_isVersionOf, CRDFPredicate::bqbiol_occursIn, CRDFPredicate::bqmodel_hasInstance, CRDFPredicate::bqmodel_is, CRDFPredicate::bqmodel_isDerivedFrom, CRDFPredicate::bqmodel_isDescribedBy, CRDFPredicate::bqmodel_isInstanceOf, CAnnotation::castObject(), CRDFPredicate::copasi_encodes, CRDFPredicate::copasi_hasPart, CRDFPredicate::copasi_hasVersion, CRDFPredicate::copasi_is, CRDFPredicate::copasi_isDescribedBy, CRDFPredicate::copasi_isEncodedBy, CRDFPredicate::copasi_isHomologTo, CRDFPredicate::copasi_isPartOf, CRDFPredicate::copasi_isVersionOf, CRDFPredicate::copasi_occursIn, createUniqueId(), CMIRIAMInfo::empty(), CRDFPredicate::end, CRDFUtilities::fixLocalFileAboutReference(), CMIRIAMInfo::getBiologicalDescriptions(), CMIRIAMInfo::getCreatedDT(), CMIRIAMInfo::getCreators(), CModification::getDate(), CRDFNode::getDescendantsWithPredicate(), CCreator::getEmail(), CCreator::getFamilyName(), CCreator::getGivenName(), CBiologicalDescription::getId(), CMIRIAMResourceObject::getIdentifiersOrgURL(), CDataObject::getKey(), CAnnotation::getMiriamAnnotation(), CBiologicalDescription::getMIRIAMResourceObject(), CReference::getMIRIAMResourceObject(), CMIRIAMInfo::getModifications(), CCreator::getORG(), CMIRIAMInfo::getReferences(), CBiologicalDescription::getResource(), CBiologicalDescription::getTriplet(), CReference::getTriplet(), CRDFPredicate::getType(), CMIRIAMInfo::load(), mExportCOPASIMIRIAM, mSBMLLevel, CRDFTriplet::pObject, CRDFTriplet::Predicate, replaceChild(), and CDataVector< CType >::size().
Referenced by createCompartment(), createEvent(), createFunctionDefinition(), createMetabolite(), createParameter(), createReaction(), and createSBMLDocument().
|
protected |
|
protected |
Referenced by createAvogadroIfNeeded(), and createSBMLDocument().
|
protected |
Referenced by addInitialAssignmentsToModel(), and createAvogadroIfNeeded().
|
protected |
Referenced by createAvogadroIfNeeded(), createCompartment(), createEvent(), createEvents(), createFunctionDefinition(), createFunctionDefinitions(), createInitialAssignment(), createMetabolite(), createParameter(), createReaction(), createRule(), createSBMLDocument(), exportEventAssignments(), exportLayout(), getCOPASI2SBMLMap(), removeUnusedObjects(), and updateCOPASI2SBMLMap().
|
protected |
current step counter for current import
Referenced by createCompartments(), createEvents(), createMetabolites(), createParameters(), createProgressStepOrStop(), and createReactions().
|
protected |
the current import step handle
Referenced by createProgressStepOrStop(), finishCurrentStep(), and reportCurrentProgressOrStop().
|
protected |
total steps of current import task
Referenced by createProgressStepOrStop().
|
protected |
Referenced by disownSBMLDocument(), and ~CSBMLExporter().
|
protected |
Referenced by isSetExportCOPASIMIRIAM(), setExportCOPASIMIRIAM(), and updateMIRIAMAnnotation().
|
protected |
Referenced by convertToLevel1(), createFunctionDefinition(), createFunctionDefinitions(), and createSBMLDocument().
|
protected |
Referenced by createSBMLDocument(), and setFunctionSBMLIds().
|
protected |
Referenced by createFunctionDefinition(), createFunctionDefinitions(), and createSBMLDocument().
|
protected |
global step counter
Referenced by createProgressStepOrStop(), and exportModelToString().
|
protected |
the global import step handle
Referenced by createProgressStepOrStop(), exportModelToString(), and finishExport().
|
protected |
total step counter for global import
Referenced by exportModelToString().
|
protected |
|
protected |
Referenced by assignSBMLIdsToReactions(), checkForUnsupportedObjectReferences(), convertToASTNode(), createAvogadroIfNeeded(), createCompartment(), createEvent(), createFunctionDefinition(), createInitialAssignment(), createMetabolite(), createParameter(), createReaction(), createRule(), createSBMLDocument(), createUnitDefinitionFor(), exportEventAssignments(), exportLayout(), replace_local_parameters(), replaceSpeciesReferences(), setFunctionSBMLIds(), and updateCOPASI2SBMLMap().
|
protected |
|
protected |
Referenced by createEvent(), createInitialAssignment(), createReaction(), createRule(), and exportEventAssignments().
|
protected |
|
protected |
|
protected |
Referenced by createCompartment(), createEvent(), createFunctionDefinition(), createMetabolite(), createParameter(), and createReaction().
|
protected |
|
protected |
|
protected |
Referenced by createKineticLaw(), replace_local_parameters(), and restore_local_parameters().
|
protected |
Referenced by createAvogadroIfNeeded(), createSBMLDocument(), findAvogadro(), and replaceSpeciesReferences().
|
protected |
the progress handler for the export
Referenced by createProgressStepOrStop(), exportModelToString(), finishCurrentStep(), finishExport(), getCallBack(), reportCurrentProgressOrStop(), and setHandler().
|
protected |
Referenced by addInitialAssignmentsToModel(), convertToASTNode(), convertToLevel1(), createAreaUnit(), createAvogadroIfNeeded(), createCompartment(), createEvent(), createEvents(), createFunctionDefinition(), createFunctionDefinitions(), createInitialAssignment(), createKineticLaw(), createLengthUnit(), createMetabolite(), createParameter(), createReaction(), createRule(), createRules(), createSBMLDocument(), createSubstanceUnit(), createTimeUnit(), createUnitDefinitionFor(), createVolumeUnit(), exportAndAssignUnit(), exportLayout(), exportModelToString(), getSBMLDocument(), removeInitialAssignment(), removeRule(), removeUnusedObjects(), replace_local_parameters(), replaceSpeciesReferences(), and ~CSBMLExporter().
|
protected |
Referenced by createCompartment(), createEvent(), createEvents(), createFunctionDefinition(), createKineticLaw(), createMetabolite(), createMetabolites(), createParameter(), createReaction(), createSBMLDocument(), createSubstanceUnit(), exportEventAssignments(), exportModelToString(), hasVolumeAssignment(), and updateMIRIAMAnnotation().
|
protected |
|
protected |
Referenced by createMetabolite(), and createMetabolites().
|
protected |
|
protected |
Referenced by createMetabolite(), createSBMLDocument(), and replaceSpeciesReferences().