sbmlteam / libsbml

LibSBML is a native library for reading, writing and manipulating files and data streams containing the Systems Biology Markup Language (SBML). It offers language bindings for C, C++, C#, Java, JavaScript, MATLAB, Perl, PHP, Python, R and Ruby.
https://sbml.org/software/libsbml
Other
41 stars 28 forks source link

Implementation of SBO term trees #164

Open famosab opened 3 years ago

famosab commented 3 years ago

In JSBML there are the possibilities to check for children and parents of a given SBOTerm [1]. So far, according to the documentation, this doesn't seem to be possible with the python version of libSBML. Can this be implemented?

It also seems to me that the JSBML SBO class seems to be very different from the python libSBML class.

[1] https://model.caltech.edu/software/jsbml/difference-reports/JSBML_API_changes_0.8_to_1.0/jsbml-1.0/?org/sbml/jsbml/SBO.Term.html

fbergmann commented 3 years ago

Indeed the JSBML implementation is completely different, also in what is stored there (and in that they use biojava for that).

The functionality is there in the form of a method:

SBO::isChildOf(unsigned int term, unsigned int parent)

but it is currently not exposed to the language bindings. We could do that in a future version. Though LibSBML internally stores only a flat map of the terms itself. Not their definition strings or names. We can discuss how this should change in the future though.

in the mean time it might be easier for your application to parse the SBO xml / rdf/ owl document once to extract the information you would like to have in your application. If you need help with that we can help.