Latest Versions


Stable:
COPASI 4.6 (Build 32)
Development:
COPASI 4.5.31 (development)

VT Tribute

Chapter 5. Importing and Exporting

COPASI is one modeling and simulation tool among many and often people use more than one tool to create, investigate and simulate their models. In order to make it easier to exchange model files with other programs, COPASI supports reading and writing of several model file formats. Naturally COPASI can read and write it's own file format and it can read Gepasi files just as well although it will not write Gepasi files.

In addition to those two file formats, COPASI can import SBML Level 1 and 2 files and it can export models as SBML Level 2 files as well as C source code, XPPaut, or Berkeley Madonna files.

1. Importing and Exporting SBML files

COPASI is able to import SBML level 1 and level 2 files as well as export SBML level 2 files through the corresponding entries in the File menu. For the import and export the SBML Model is read with libsbml and converted to the COPASI model structure and vice versa.

On exporting, COPASI converts its native model structure to an SBML model that is again written out using libsbml. Since the SBML model structure is converted into the COPASI model structure upon import, some of the information in the SBML file gets lost because COPASI does not support the corresponding model elements. Examples of data that gets lost are certain rules and events.

Notes and Annotations from the original SBML file should be preserved when you import and reexport an SBML file as long as you do not delete the objects that contain the annotation in COPASI. But still if you have important annotations or notes in your SBML file make a backup of the file before you open it in COPASI since we can not guarantee that they will survive an import/export cycle.

Likewise, SBML does not support all of the elements of a COPASI model so some information from the COPASI model also gets lost when exporting an SBML file. For example tasks, reports and plot definitions are not exported to the SBML file.

This is normally not a big problem since the essential parts of a model normally get imported or exported. A consequence however one should keep in mind is that if you import an SBML file into COPASI and later export it again, it might have lost some of the original information. So if your SBML model depends on rules on species and compartments and events, it is not suitable for import into COPASI. This will change in future versions of COPASI.

We hope that we will be able to support even more different file formats in the future.

Current versions of COPASI use libsbml version 3 which supports SBML files up to Level 2 Version 3. Libsbml 3 also has a lot of built-in tests to check the validity of a model. Upon import COPASI will display most of those errors to the user. Libsbml 3 also gives a lot of warnings, especially concerning units in SBML files, which should help the user in generating better, more consistent models. Even so this is a good thing, it can happen that the real errors are hidden by the large amount of warnings. COPASI now uses a new error message dialog that splits the messages in filtered and unfiltered messages. The unfiltered messages are what the user sees when the dialog comes up. In order the see the filtered messages the second tab in the message dialog has to be selected. If there are no filtered messages, this tab is disabled. In the labels of the individual tabs, COPASI also shows you the number of messages that for the corresponding tab.

Error Message Dialog after import of an SBML file

SBML Import Error Messages

In the current version, the errors that are filtered are hard coded and they are all warnings that have to do with unit inconsistencies within the model. In future version of COPASI, we will have a mechanism that will let the user manage which error messages should be filtered.

Although COPASI now uses libsbml 3, not all features found in the different versions of SBML are currently supported. If an unsupported feature is encountered during import, COPASI will usually notify the user. Depending on which parts of the model have been ignored, ignored, the result of time course simulations and other tasks might not be what you expect.

This is still very rudimentary and we hope to improve this function recognition in the future so that also functions exported from other programs can be recognized.