Outputting an SBMLDocument

2 views
Skip to first unread message

Alex Enersen

unread,
Apr 9, 2019, 4:47:20 PM4/9/19
to libsbml-development
Hello! I'm trying to convert an SBML file's units into SI units, but I'm running into a problem. I've written a function to produce an SBMLDocument element called 'document' from a filename, and 'document' should contain the converted units. However, I'm not sure how to create an SBML file out of 'document'. Any help would be appreciated. Thanks!

My function is as follows. It may contain some bugs, but I need to know how to output an SBMLDocument before trying to debug.

public SBMLDocument convertToSI(String filename) {
  ConversionProperties config = new ConversionProperties();
  SBMLReader reader = new SBMLReader();
  SBMLDocument document = reader.readSBML(filename);

  int status;
  if (config != null) {
    status = document.convert(config);
  }

  return document
}

Lucian Smith

unread,
Apr 9, 2019, 5:19:15 PM4/9/19
to libsbml-d...@googlegroups.com
The functions 'writeSBMLToString' and 'writeSBMLToFile' are what you want.  You can also use the SBMLWriter class for more control over exactly how writing happens.  Hope that helps!

-Lucian

--
You received this message because you are subscribed to the Google Groups "libsbml-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libsbml-develop...@googlegroups.com.
To post to this group, send email to libsbml-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libsbml-development/63ef1e31-1bd8-4ce7-84b2-04b36641d200%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages