How to extend a SBML model

Skip to first unread message

Jalil Nourisa

Mar 25, 2021, 5:51:13 PM3/25/21
In my simulation, I have a SBML file of a previous model that I need to extend in certain ways. I wonder, is such a thing possible in Tellurium, and if yes, can you pls give me a hint how to do it?
Jalil Nourisa

Herbert M Sauro

Mar 25, 2021, 6:04:52 PM3/25/21
to Jalil Nourisa, tellurium-discuss
If you have an existing model I would convert the SBML into Antimony format and then edit that. Antimony will give you a list of reactions, species,rate laws etc, Any changes you make can be converted back to SBML, or loaded straight into the tellurium simulator. 

For example, if you have an SBML file or a string containing some SBML you can do:

import tellurium as te

r = te.loadSBMLModel (string or file name of SBML model)

To get the Antimony you can use

antStr = r.getAntimony ()

You can print out the antStr and copy the string to a new editor window.

What I generally do is if you're using the Windows spyder distribution of tellurium, there is an import sbml option in the file menu and that will convert the SBML to antimony and drop it in the editor windows.


You received this message because you are subscribed to the Google Groups "tellurium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Herbert Sauro, Professor
University of Washington, Bioengineering

Lucian Smith

Mar 25, 2021, 6:09:16 PM3/25/21
to Herbert M Sauro, Jalil Nourisa, tellurium-discuss
It's also possible to use the functions like 'addReaction' or 'addSpecies' in roadrunner, i.e.:

r = tellurium.loada(antimonyStr)
r.addSpecies("S1", "c", 3.0)

would add species S1 in compartment c.

There are similar functions for deleting elements, too.


Jalil Nourisa

Mar 25, 2021, 7:06:53 PM3/25/21
to Herbert M Sauro,
Thank you very much, Herbert,
I was more looking for a clean way of doing that without opening the SBML model. But, this would do the job.

On 25. Mar 2021, at 22:04, Herbert M Sauro <> wrote:

antStr = r.getAntimony ()

Herbert M Sauro

Mar 25, 2021, 10:18:05 PM3/25/21
to Jalil Nourisa,
See Lucian reply, I’d forgotten we have a new api to manipulate a model directly.

Reply all
Reply to author
0 new messages