COPASI API  4.16.103
CSEDMLExporter.h
Go to the documentation of this file.
1 // Copyright (C) 2013 - 2014 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 /*
7  * CSEDMLExporter.h
8  *
9  * Created on: 24 Jul 2013
10  * Author: dada
11  */
12 
13 #ifndef CSEDMLEXPORTER_H_
14 #define CSEDMLEXPORTER_H_
15 
16 #include <sedml/common/sedmlfwd.h>
17 
18 class CTrajectoryTask;
19 class CCompartment;
20 class CMetab;
21 class CProcessReport;
22 class CPlotSpecification;
23 
24 class CModelValue;
25 class CReaction;
26 class Event;
27 class CModelEntity;
28 class KineticLaw;
29 class Model;
30 class Parameter;
31 class Rule;
32 class SBase;
33 class SBMLDocument;
35 class XMLNode;
36 
38 {
39 
40 protected:
41  SedDocument* mpSEDMLDocument;
42  unsigned int mSEDMLLevel;
43  unsigned int mSEDMLVersion;
44  SedUniformTimeCourse *mpTimecourse;
45  SedTask *mpTimecourseTask;
46 
47 public:
50 
51  SedDocument* getSEDMLDocument() {return this->mpSEDMLDocument;};
52 
53  /**
54  * Export the model and Task to SEDML.
55  * The SEDML document is returned as a string and SBML model is copied to sbmldocument parameter. In case of an error, an
56  * empty string is returned.
57  */
58  const std::string exportModelAndTasksToString(CCopasiDataModel& dataModel, std::string &sbmldocument, unsigned int sedmlLevel, unsigned int sedmlVersion);
59 
60  /**
61  * Export the model and Task to SEDML.
62  * The SEDML document is written to the file given by SEDMLFilename and reference SBML model is written to SBMLFilename .
63  * If the export fails, false is returned.
64  */
65  bool exportModelAndTasks(CCopasiDataModel& dataModel, const std::string& SEDMLFilename, const std::string& SBMLFilename, unsigned int sedmlLevel = 1, unsigned int sedmlVersion = 1, bool overwrite = false);
66 
67  /**
68  * Creates an SEDMLDocument and SBMLDocument from the given CCopasiDataModelObject.
69  * It checks if an SEDMLDocument and SBMLDocument already exists from an import and if
70  * this is the case, the old document is copied.
71  * If none exists a new one is created.
72  * Copying the old one makes sure that if something goes wrong during
73  * export, the original model is still consistent.
74  */
75  void createSEDMLDocument(CCopasiDataModel& dataModel, std::string modelRef);
76 
77  /**
78  * Creates the timecourse task for the given model id and returns its id.
79  */
80  std::string createTimeCourseTask(CCopasiDataModel& dataModel, const std::string & modelId);
81 
82  /**
83  * Creates the steady state task for the given model id and returns its id.
84  */
85  std::string createSteadyStateTask(CCopasiDataModel& dataModel, const std::string & modelId);
86 
87  /**
88  * Creates a scan task for the given model id if the dataModel contains a number of scan items
89  * and returns its id.
90  *
91  * @return the id of the task, if craeted, otherwise an empty string.
92  */
93  std::string createScanTask(CCopasiDataModel& dataModel, const std::string & modelId);
94 
95  /**
96  * Creates the models for SEDML.
97  */
98  void createModels(CCopasiDataModel& dataModel, std::string &modelRef);
99 
100  /**
101  * Creates the Tasks for SEDML.
102  */
103  void createTasks(CCopasiDataModel& dataModel, std::string & modelRef);
104 
105  /**
106  * Creates the data generators for SEDML.
107  */
108  void createDataGenerators(CCopasiDataModel & dataModel,
109  std::string & taskId,
110  CCopasiTask* task = NULL);
111 
112  /**
113  * Creates the Tasks for SEDML.
114  */
115  //void createReports(CCopasiDataModel &dataModel);
116 };
117 
118 #endif /* CSEDMLEXPORTER_H_ */
unsigned int mSEDMLVersion
std::string createScanTask(CCopasiDataModel &dataModel, const std::string &modelId)
SedDocument * mpSEDMLDocument
const std::string exportModelAndTasksToString(CCopasiDataModel &dataModel, std::string &sbmldocument, unsigned int sedmlLevel, unsigned int sedmlVersion)
Definition: CMetab.h:178
unsigned int mSEDMLLevel
void createTasks(CCopasiDataModel &dataModel, std::string &modelRef)
void createDataGenerators(CCopasiDataModel &dataModel, std::string &taskId, CCopasiTask *task=NULL)
SedTask * mpTimecourseTask
std::string createTimeCourseTask(CCopasiDataModel &dataModel, const std::string &modelId)
void createModels(CCopasiDataModel &dataModel, std::string &modelRef)
void createSEDMLDocument(CCopasiDataModel &dataModel, std::string modelRef)
SedDocument * getSEDMLDocument()
SedUniformTimeCourse * mpTimecourse
std::string createSteadyStateTask(CCopasiDataModel &dataModel, const std::string &modelId)
bool exportModelAndTasks(CCopasiDataModel &dataModel, const std::string &SEDMLFilename, const std::string &SBMLFilename, unsigned int sedmlLevel=1, unsigned int sedmlVersion=1, bool overwrite=false)