How to save model with added reaction in jupyter

55 views
Skip to first unread message

Karen Chung

unread,
May 4, 2021, 3:46:55 AM5/4/21
to cobra pie
Hi there,

I notice that, after I add reactions to the model in the Jupyter notebook. The next time, when I open the same .ipynb file, I'll need to re-import model then the reactions that added previously all gone? Like it did not saved the changes I made to the model. 

Kindly advise. 

Regards,
Karen

Moritz Beber

unread,
May 4, 2021, 9:07:23 AM5/4/21
to cobr...@googlegroups.com
Dear Karen,

You need to save your changes to SBML again (I assume) by calling the write_sbml_model function (https://cobrapy.readthedocs.io/en/latest/autoapi/cobra/io/index.html#cobra.io.write_sbml_model).

Best,
Moritz
--
You received this message because you are subscribed to the Google Groups "cobra pie" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cobra-pie+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cobra-pie/a1cca06a-81bd-42de-9c4f-ea7adbc39c64n%40googlegroups.com.

Karen Chung

unread,
May 6, 2021, 1:25:31 AM5/6/21
to cobra pie
Hi Moritz,

May I ask how to do I write for the filename?

cobra.io.write_sbml_model(cobra_modelfilenamef_replace=F_REPLACE**kwargs)[source]

Screenshot 2021-05-06 at 1.24.12 PM.png

Piyush Nanda

unread,
May 6, 2021, 4:38:42 AM5/6/21
to cobra pie
  Hi,

You need to use:

cobra.io.write_sbml_model(model,'ATCC700603model.xml')

Regards,
Piyush

Karen Chung

unread,
May 6, 2021, 5:43:31 AM5/6/21
to cobra pie
Hi Piyush, yes it works. Thanks for your reply!

Thank you both for your help!

Regards,
Karen

Reply all
Reply to author
Forward
Message has been deleted
0 new messages