I have the difficulty binding Stoichiometry using lisbsbml and java on windows. The object does has the value but the final xml doesn't. Is it a bug or something wrong. I also tested a xml file with some codes below. Theoretically it doesn't change xml structure much but the output doesn't has Stoichiometry attributes either. Any idea?
SBMLReader reader = new SBMLReader();
SBMLDocument document = reader.readSBMLFromString(xmlString);
model = document.getModel();
SBMLDocument document2 = new SBMLDocument(2);
document2.setModel(model);
SBMLWriter sbmlWriter = new SBMLWriter();
xmlString = sbmlWriter.writeToString(document);
Here is partial of original xml before passing the codes above:
The reason the stoichiometry appears to disappear is that since it defaults
to '1' if a speciesrefernce has a stoichiometry of '1' libSBML does not
write it out explicitly.
Its not lost - it just doesnt need to be there :-)
Sarah
----- Original Message -----
From: "lyang" <lyang@ciit.org>
To: <libsbml-discuss@caltech.edu>
Sent: Wednesday, June 28, 2006 9:52 PM
Subject: [libsbml-discuss] ReferenceSpecies
>
> I have the difficulty binding Stoichiometry using lisbsbml and java on
> windows. The object does has the value but the final xml doesn't. Is it a
> bug or something wrong. I also tested a xml file with some codes below.
> Theoretically it doesn't change xml structure much but the output doesn't
> has Stoichiometry attributes either. Any idea?
>
>
> SBMLReader reader = new SBMLReader();
> SBMLDocument document = reader.readSBMLFromString(xmlString);
> model = document.getModel();
> SBMLDocument document2 = new SBMLDocument(2);
> document2.setModel(model);
> SBMLWriter sbmlWriter = new SBMLWriter();
> xmlString = sbmlWriter.writeToString(document);
>
>
> Here is partial of original xml before passing the codes above:
>
> - <listOfReactions>
> - <reaction id="Y_clearance">
> - <listOfReactants>
> <speciesReference species="Y" stoichiometry="1" />
> </listOfReactants>
> ...
>
>
> And here is what passed the code
>
> - <listOfReactions>
> - <reaction id="Y_clearance">
> - <listOfReactants>
> <speciesReference species="Y" />
> </listOfReactants>
> ...
>
>
> Thank you.
>
>
Thank you for the reply. I did see some xml file with stoichiometry to be 1. Is there a way to enforce libsbml writes it out? One situation is that If I create xml file using libSBML and the file is parsed by other softwares without using libSBML, what the default value will be interpreted?
Unfortunately no - libSBML only writes out the stoichiometry if it is not
the default value of '1'. If other software is *correctly* reading SBML,
whether it uses libSBML or not, then this should not be a problem. The
stoichiometry should default to '1' unless told otherwise.
Sarah
----- Original Message -----
From: "lyang" <lyang@ciit.org>
To: <libsbml-discuss@caltech.edu>
Sent: Thursday, June 29, 2006 7:30 PM
Subject: [libsbml-discuss] Re: ReferenceSpecies
>
> Thank you for the reply. I did see some xml file with stoichiometry to be
> 1. Is there a way to enforce libsbml writes it out? One situation is that
> If I create xml file using libSBML and the file is parsed by other
> softwares without using libSBML, what the default value will be
> interpreted?
>
> lyang
>
>
>>>>> On 29 Jun 2006, lyang <lyang@ciit.org> wrote:
lyang> Thank you for the reply. I did see some xml file
lyang> with stoichiometry to be 1. Is there a way to
lyang> enforce libsbml writes it out? One situation is
lyang> that If I create xml file using libSBML and the
lyang> file is parsed by other softwares without using
lyang> libSBML, what the default value will be
lyang> interpreted?
In SBML, the default value of stoichiometry is defined to be
1. A software system must interpret a missing stoichiometry
value as 1; if it doesn't, it's a bug.
MH
--
Mike Hucka, Ph.D. <mhucka@caltech.edu> tel +1.626.395.8128
Senior Research Fellow, Control and Dynamical Systems
Co-director, Biological Network Modeling Center (BNMC)
The Beckman Institute @ The California Institute of Technology