MyersResearchGroup / iBioSim

iBioSim is a computer-aided design (CAD) tool aimed for the modeling, analysis, and design of genetic circuits. It is capable of importing and exporting models specified using the Systems Biology Markup Language (SBML). iBioSim also supports the Synthetic Biology Open Language (SBOL), an emerging standard for information exchange in synthetic biology.
http://www.async.ece.utah.edu/ibiosim
Apache License 2.0
53 stars 20 forks source link

CHANGE: change conversion between libsbml and jsbml #38

Open buggsley opened 7 years ago

buggsley commented 7 years ago

For some operations, we still need libsbml. Should convert them more = seemlessly without go to/from files, if possible.

Begin forwarded message:

From: Andreas Dr=E4ger andreas.draeger@uni-tuebingen.de Subject: Re: [jsbml-team] does JSBML support level/version conversion = ? Date: November 12, 2013 4:33:24 PM MST To: The JSBML development team mailing list jsbml-team@caltech.edu Cc: LEANDRO HIKIJI WATANABE l.watanabe@utah.edu, Goksel Misirli = goksel.misirli@newcastle.ac.uk, Curtis Kendall Madsen = curtis.madsen@utah.edu, Chris Myers myers@ece.utah.edu =20 Hi Chris, =20 Please have a look at these folders: =20

http://sourceforge.net/p/jsbml/code/HEAD/tree/trunk/modules/libSBMLio/test= /org/sbml/jsbml/libsbmlio/ =20 and =20

http://sourceforge.net/p/jsbml/code/HEAD/tree/trunk/modules/libSBMLio/test= /org/sbml/jsbml/libsbmlio/test/ =20 You can find a simple application and also some test cases. Important = is always the TreeNodeChangeListener that updates libSBML's data = structures upon any change in the JSBML structure. There is always a = pointer from each JSBML object to the corresponding libSBML object. =20 However, packages are not implemented (simply because of a lack of = time). =20 Cheers Andreas =20

Cool. Do you have any sample code using this? =20 Chris =20 On Nov 12, 2013, at 2:08 PM, Andreas Dr=E4ger = andreas.draeger@uni-tuebingen.de wrote: =20

Am 11.11.13 06:52, schrieb Chris J. Myers:

Sure. I added code to use libsbml via a write, read into libsbml = object, write, and read into jsbml object. But, it would be nice to = have the web service as well. Hi, =20 There is a module for libSBMLio in JSBML, which uses libSBML for = reading the model converting it into JSBML data structures and to = synchronize any change in the JSBML model at any time to the libSBML = data structure. When writing the model, again the libSBML writer can be = used. In this way, local consistency checks are possible as well as = access to level/version conversion and again reading the model using = libSBML again. You can find it in the modules folder. I have just = updated the entire module and am still working on it. =20 Cheers Andreas =20 --=20 Dr. Andreas Draeger University of California, San Diego, La Jolla, CA 92093-0412, USA Bioengineering Dept., Systems Biology Research Group, Office #2506 Phone: +1-858-534-9717, Fax: +1-858-822-3120, twitter: @dr_drae =20 =20 --=20 Dr. Andreas Draeger University of California, San Diego, La Jolla, CA 92093-0412, USA Bioengineering Dept., Systems Biology Research Group, Office #2506 Phone: +1-858-534-9717, Fax: +1-858-822-3120, twitter: @dr_drae

buggsley commented 7 years ago

Hi Chris,

Yes. There is the method

public static org.sbml.libsbml.SBMLDocument convertSBMLDocument(SBMLDocument doc)

in LibSBMLUtils and also the method

public Model convertModel(org.sbml.libsbml.Model originalModel)

in LibSBMLReader.

Both classes can be found in the libSBMLio module. However, I am unable to complement the functionality with support for packages. If this is needed, I would be more than happy if somebody would contribute it.

The LibSBMLReader stores links from each JSBML object to its corresponding libSBML element. These links can recursively be deleted afterwards if not required. In this case also the LibSBMLChangeListener should be removed in order to avoid null pointer exceptions when the links are removed.

Cheers Andreas