How to extend a SBML model

12 views
Skip to first unread message

Jalil Nourisa

unread,
Mar 25, 2021, 5:51:13 PM3/25/21
to telluriu...@googlegroups.com
Hi,
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?
Best
Jalil Nourisa

Herbert M Sauro

unread,
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.

Herbert


--
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 tellurium-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tellurium-discuss/46B3D316-2528-43B9-81D9-1573B5091C98%40gmail.com.


--
Herbert Sauro, Professor
University of Washington, Bioengineering

Lucian Smith

unread,
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.


-Lucian

Jalil Nourisa

unread,
Mar 25, 2021, 7:06:53 PM3/25/21
to Herbert M Sauro, telluriu...@googlegroups.com
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.
Best


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

antStr = r.getAntimony ()

Herbert M Sauro

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

Herbert
Reply all
Reply to author
Forward
0 new messages