[BioC] rsbml: problem writing a model to file

hettling j.hettling at vu.nl
Wed Mar 21 19:11:05 CET 2012

Dear Michael,

Thanks a lot for your help! I got it to work with the development
version of the package and libsbml 5.

The package does not compile anymore with libsbml 4; I guess the package
uses the development version of SOSlib, which says it only works with
libsbml 3.0.2 or the latest devel version, so it might be good to change
the package requirements.
I also had to downgrade sundials from 2.4.0 to 2.3.0 because of SOSlib.

Another thing is that the package gave an error creating an SBML
document because it could not find the function "rsbml_perform_check",
so I changed line 5 in SBML.R and set the variable "valid" to TRUE,
which is a bit of a hack, but it works for now. Is this a check for the
validity of the SBML document and is this check done with SOSlib?

Many thanks,


On Tue, 2012-03-20 at 18:03 -0700, Michael Lawrence wrote:
> Well, it took a bit longer than I expected, but I have things now
> working under libsbml 5.x. Should still work under 4.x (please let me
> know).
> I have also fixed the validity checking that was causing your problem.
> You'll need the devel (2.13.1) or wait for the release next month.
> Thanks,
> Michael
> On Fri, Mar 16, 2012 at 10:27 AM, Michael Lawrence <michafla at gene.com>
> wrote:
>         Thanks for the report, I will look into this. rsbml currently
>         has a number of issues (it doesn't even compile for me right
>         now). I need to look into it this weekend.
>         Michael
>         On Fri, Mar 16, 2012 at 9:16 AM, hettling <j.hettling at vu.nl>
>         wrote:
>                 Dear all,
>                 I have some trouble with SBML export using the package
>                 'rsbml'.
>                 The following example of saving a very simple model to
>                 file gives an
>                 error on my machine:
>                 require('rsbml')
>                 com<-new("Compartment",id="default_compartment",name="default_compartment",size=1)
>                 sp<-new("Species",id="s1",name="s1",compartment=com at id,initialConcentration=10)
>                 re<-new("Reaction",id="r1",name="r1",kineticLaw=new("KineticLaw",math=as.expression(0)),reactants=list(new("SpeciesReference",species="s1",stoichiometry=1)))
>                 sbml_model<-new("Model",id="mymodel",name="mymodel",compartments=list(com),species=list(sp),reactions=list(re))
>                 sbml_doc<-new("SBML",level=as.integer(2),ver=as.integer(2),model=sbml_model)
>                 rsbml_write(sbml_doc, file="myfile.xml")
>                 The error occurs in creating the SBML object, the
>                 message is:
>                 Error in validObject(.Object) : invalid class "SBML"
>                 object: FALSE
>                 If the KineticLaw in the reaction is NULL, e.g.:
>                 re<-new("Reaction",id="r1",name="r1",reactants=list(new("SpeciesReference",species="s1",stoichiometry=1)))
>                 the SBML export works without throwing errors. Also,
>                 if I create a
>                 document with SBML Level 2, version 1 instead of Level
>                 2, version 2 in
>                 the example above, the code runs without errors.
>                 However, then only the
>                 SBML header is written to file and nothing else.
>                 I went through the documentation and tried it with the
>                 example models as
>                 well, but I cannot find a solution. I hope I
>                 understood right how to
>                 create a document object from a model object.
>                 I installed rsbml via the bioconductor and have
>                 libSBML version 4.0.1
>                 (that's whats written in the generated SBML) on Linux
>                 with R 2.13.1.
>                 Does anybody know what could be the problem here?
>                 Many thanks in advance,
>                 Hannes Hettling
>                 _______________________________________________
>                 Bioconductor mailing list
>                 Bioconductor at r-project.org
>                 https://stat.ethz.ch/mailman/listinfo/bioconductor
>                 Search the archives:
>                 http://news.gmane.org/gmane.science.biology.informatics.conductor

More information about the Bioconductor mailing list