Loading a Model

There are four ways of loading a model:
1. From .cps file
2. From .xml file
3. From sbml text
4. Passing as an argument from another function
 
# From .cps file (taken from COPASI-Python API manual)
 

assert CCopasiRootContainer.getRoot() != None

dataModel = CCopasiRootContainer.addDatamodel()

dataModel.importSBML('filename.xml')

 

# From .xml (SBML) file (taken from COPASI-Python API manual)

assert CCopasiRootContainer.getRoot() != None

dataModel = CCopasiRootContainer.addDatamodel()

dataModel.importSBML('filename.xml')
 
# From .cps (COPASI) file (taken from COPASI-Python API manual

assert CCopasiRootContainer.getRoot() != None

dataModel = CCopasiRootContainer.addDatamodel()

dataModel.loadModel('filename.cps')

 

# From another function

...

myFunction.main(dataModel) # myFunction takes dataModel as an argument

...
 

# myFunction 

def main(args):

      dataModel = args[0]

      model = dataModel.getModel()

      .....