Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » jsbml-development » Bug in SBMLWriter
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
Andreas Dräger


Posts: 273
Registered:
June 2006
Re: Bug in SBMLWriter 10 May '12 05:50 Go to previous messageGo to previous message

Am 5/10/12 2:38 PM, schrieb Nicolas Rodriguez:
>
>>>> Hi all,
>>>>
>>>> here is a minimal example that doesn't work properly with the current
>>>> version of JSBML:
>>>>
>>>> public static void main(String[] args) throws Throwable {
>>>> SBMLDocument doc = new SBMLDocument(3, 1);
>>>> Model m = doc.createModel("m1");
>>>> Compartment c = m.createCompartment("c1");
>>>> Species s1 = m.createSpecies("s1", c);
>>>> Species s2 = m.createSpecies("s2", c);
>>>> Reaction r = m.createReaction("r1");
>>>> r.createReactant(s1).setStoichiometry(1d);
>>>> r.createProduct(s2).setStoichiometry(1d);
>>>> KineticLaw kl = r.createKineticLaw();
>>>> ASTNode one = new ASTNode(1, kl);
>>>> ASTNode two = new ASTNode(2, kl);
>>>> one.setUnits(Unit.Kind.MOLE.toString().toLowerCase());
>>>> two.setUnits(Unit.Kind.SECOND.toString().toLowerCase());
>>>> ASTNode ast = ASTNode.frac(one, two);
>>>> kl.setMath(ast);
>>>> SBMLWriter.write(doc, System.out, ' ', (short) 2);
>>>> }
>>>>
>>>> You'll see that the first unit is not written to SBML at all. The second
>>>> unit is written, but the namespace declaration is missing. I already
>>>> found what is probably the reason, but can't fix it at the moment: The
>>>> recursive check if the ASTNode contains unit declarations doesn't work.
>>> Not sure of what is going on there !!
>>>
>>> The unit of the first astnode is reset somewhere.
>>>
>>> if I print the value of the units in
>>> MathMLXMLStreamCompiler.compileInteger(ASTNode), the first astnode
>>> return 'null'.
>> The unit that get deleted is probably due to the code from
>> org.sbml.jsbml.ASTNode.arithmeticOperation(Type, ASTNode) ??
>>
>> The swap node does not copy the units ?
> ok, both fixes are commited now and it should be working fine.
>
> I suppose this a good case to de-freeze the 0.8 branch.
>
> Should I commit there (in the 0.8 branch) the changes to
> Model.registerIds as well ?
>

Hi Nico,

Thank you a lot for your great job! Yes, I agree, please do a commit
here! This is an absolutely necessary change.

Best
Andreas

--
Dr. Andreas Dräger
University of Tuebingen
Center for Bioinformatics Tuebingen (ZBIT)
Sand 1
72076 Tübingen
Germany

Phone: +49-7071-29-78982
Fax: +49-7071-29-5091

____________________________________________________________
To manage your jsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/jsbml-development

For a web interface to the jsbml-development mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the jsbml-development list,
contact sbml-team@caltech.edu

      

SubjectPosterDate
Read Message   Bug in SBMLWriter Andreas Dräger08 May '12 05:57
Read Message   Re: Bug in SBMLWriter rodrigue08 May '12 06:17
Read Message   Re: Bug in SBMLWriter Andreas Dräger08 May '12 06:20
Read Message   Re: Bug in SBMLWriter rodrigue08 May '12 06:30
Read Message   Re: Bug in SBMLWriter rodrigue08 May '12 06:43
Read Message   Re: Bug in SBMLWriter rodrigue08 May '12 07:10
Read Message   Re: Bug in SBMLWriter Andreas Dräger09 May '12 11:42
Read Message   Re: Bug in SBMLWriter rodrigue10 May '12 04:49
Read Message   Re: Bug in SBMLWriter rodrigue10 May '12 04:57
Read Message   Re: Bug in SBMLWriter rodrigue10 May '12 05:38
Read Message   Re: Bug in SBMLWriter  Andreas Dräger10 May '12 05:50
Read Message   Re: Bug in SBMLWriter Andreas Dräger10 May '12 04:59
Previous Topic:Re: [sbml-render] Ids and names on elements
Next Topic:jsbml-svn commit list added
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.