GINsim / GINsim-python

Python bindings for GINsim and bioLQM
3 stars 2 forks source link

Support reading SBML files with `.xml` extension #13

Open jonrkarr opened 3 years ago

jonrkarr commented 3 years ago

SBML files often use the extension .xml. This extension should be supported in addition to .sbml. This error is currently unclear due to the lack of error messages.

jonrkarr commented 3 years ago

SBML can be detected based on whether the file is XML and whether the root namespaces starts with http://www.sbml.org/sbml/.

pauleve commented 3 years ago

You can specify the format using a second argument (ginsim.load("file.xml", "sbml")) @aurelien-naldi I guess this issue is for https://github.com/colomoto/biolqm to add XML as SBML format.

jonrkarr commented 3 years ago

This addresses this issue. Documentation is needed to communicate that this option exists and what formats are supported.

aurelien-naldi commented 3 years ago

It already appears in the user doc of biolqm, but it seems useful to mention it in the sample notebooks as well!

To streamline a bit this use case, it should be easy to use the SBML format by default for xml files, and use the extra argument to pick another parser.

As you say it would be better to guess the right format based on the XML root namespace, but this would imply a new "virtual" format doing only this and which could only dispatch to SBML in the current state. It may be a better option if we handle other xml formats in the future