Groups in libSBML

39 views
Skip to first unread message

s.mo...@campus.unimib.it

unread,
Jul 10, 2018, 6:57:20 AM7/10/18
to sbml-interoperability
Hi,
I hope this is the right place to ask: I'm struggling trying to add the reaction groups to the SBML model I built with COBRApy, working with python 3 in Jupyter notebook. I looked up for an example on the website and I found it under: http://sbml.org/Software/libSBML/5.13.0/docs//python-api/libsbml-python-example-files.html#package-groups-examples.
However, in this page the file "groups_example1.py" is not linked to anything. Is there a way to have it back? This file, or actually any other: I'm looking of what I think should be a really simple function, but unfortunately I'm not able to figure it out.

Brett Olivier

unread,
Jul 10, 2018, 10:10:56 AM7/10/18
to sbml-interoperability
Hi


If you need any more help please let us know.
Brett

Michael Hucka

unread,
Jul 10, 2018, 11:48:03 PM7/10/18
to sbml-interoperability
Darn it, that's a documentation bug. I filed a bug report to remind us:

https://sourceforge.net/p/sbml/libsbml/464/

Thanks for bringing it up!

MH
> --
> You received this message because you are subscribed to the Google
> Groups "sbml-interoperability" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sbml-interoperab...@googlegroups.com.
> To post to this group, send email to
> sbml-inter...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sbml-interoperability/b93120e2-e5a6-44d7-9a91-ff8ddf98997b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Isabella Casini

unread,
Jul 12, 2018, 6:13:06 AM7/12/18
to sbml-interoperability
Hello,

Thank you for the link to the example. I've been working on adding groups to a preexisting model and am having a little trouble. I am running Python 3 through Jupyter Notebook (as well as PyCharm) on a Windows 10 machine. 

I am having difficulty with adding in the expression that specifies whether or not the groups are required (groups:required="false"). The main point being that after I first add the groups' NameSpace (this works), I attempt to add in the package requirement ('document.setPkgRequired('groups', False)') but I get an error (the output of -22)**. However, if I write out the document (with the namespace added), then read it back in and use the same command again ('document.setPkgRequired('groups', False)') then it works. 

** If I validate that model in the SBML validator it gives me the error, "(SBML Validation Rule #groups-20101) In all SBML documents using the Groups Package, the <sbml> object must have the 'groups:required' attribute. Reference: L3V1 Core Section 4.1.2" verifying that indeed that expression was not added.

I've attached a simplified version of my code (since my model is confidential). 

In the end I am able to get a model that is able to support the groups, but I have to write out and read in the model file one time more than I would expect. I am not able to figure out what is going wrong. Any help would be most appreciated. 

Thanks in advance,
Isabella


On Wednesday, 11 July 2018 05:48:03 UTC+2, mhucka wrote:
Darn it, that's a documentation bug.  I filed a bug report to remind us:

https://sourceforge.net/p/sbml/libsbml/464/

Thanks for bringing it up!

MH

On 10 Jul 2018, at 1:31, s.mo...@campus.unimib.it wrote:

> Hi,
> I hope this is the right place to ask: I'm struggling trying to add
> the reaction groups to the SBML model I built with COBRApy, working
> with python 3 in Jupyter notebook. I looked up for an example on the
> website and I found it under:
> http://sbml.org/Software/libSBML/5.13.0/docs//python-api/libsbml-python-example-files.html#package-groups-examples.
> However, in this page the file "groups_example1.py" is not linked to
> anything. Is there a way to have it back? This file, or actually any
> other: I'm looking of what I think should be a really simple function,
> but unfortunately I'm not able to figure it out.
>
> --
> You received this message because you are subscribed to the Google
> Groups "sbml-interoperability" group.
> To unsubscribe from this group and stop receiving emails from it, send
procedure_groups.txt

Frank T. Bergmann

unread,
Jul 12, 2018, 6:40:44 AM7/12/18
to sbml-inter...@googlegroups.com

Hello Isabella,

 

To enable a package for a document, we have a separate function. You would enable it with a call to the documents:

 

enablePackage(string pkgURI, string pkgPrefix)

 

method [1]. The return value would have told you that the package that was not enabled yet. Additionally you could use the function OperationReturnValue_toString to get a more readable result of the error code.

 

Finally, I would recommend that you use the GroupsExtension functions to return the correct uri for your level / version [2]

 

Cheers

Frank

 

[1]: http://sbml.org/Software/libSBML/5.17.0/docs//python-api/classlibsbml_1_1_s_base.html#ade4ca2896ec77ec3b664ddba927c7494

[2]: http://sbml.org/Software/libSBML/5.17.0/docs//python-api/classlibsbml_1_1_groups_extension.html#a4329b4cd00a64df7b695a6d170d0a802

 

 

 

> To post to this group, send email to
> sbml-inter...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sbml-interoperability/b93120e2-e5a6-44d7-9a91-ff8ddf98997b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--

You received this message because you are subscribed to the Google Groups "sbml-interoperability" group.

To unsubscribe from this group and stop receiving emails from it, send an email to sbml-interoperab...@googlegroups.com.


To post to this group, send email to sbml-inter...@googlegroups.com.

Isabella Casini

unread,
Jul 12, 2018, 8:45:08 AM7/12/18
to sbml-interoperability
Hi Frank,

All of your suggestions worked! 

Thank you so much!

Best,
Isabella

> To post to this group, send email to
> sbml-inter...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sbml-interoperability/b93120e2-e5a6-44d7-9a91-ff8ddf98997b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "sbml-interoperability" group.

To unsubscribe from this group and stop receiving emails from it, send an email to sbml-interoperability+unsub...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages