The libSBML distribution comes with the following selection of complete example programs in the top-level file directory named examples/c
.
Simple programs
- echoSBML.c: Echos (and in the process, pretty prints) an SBML model.
- readSBML.c: A simple command-line program that reads an SBML file and prints some statistics about it.
- printSBML.c: Prints information about the top-level model in the given SBML file.
- printSupported.c: Prints the supported SBML Levels and Versions for this copy of libSBML.
More advanced programs
- addCVTerms.c: Adds controlled vocabulary terms to a species in a model.
- convertSBML.c: Example demonstrating how to convert SBML documents between SBML Levels.
- createExampleSBML.c: Lengthy example of creating SBML models presented in the SBML specification.
- printMath.c: Prints the rule, reaction, and event formulas in a given SBML document.
- printNotes.c: Prints the notes strings for each element in a given model.
- printRegisteredPackages.c: A command-line program that prints the package plug-ins that are registered with this copy of libSBML.
- printUnits.c: A command-line program that prints information about the units of measurement used in a given SBML file.
- stripPackage.c: Strips the given SBML Level 3 package from the given SBML file.
- translateL3Math.c: Translates infix formulas into MathML and vice-versa, using the SBML Level 3 parser instead of the old Level 1 parser.
- unsetNotes.c: Unsets the notes for each element in the given SBML file.
Programs using SBML Level 3 packages
The following examples use specific libSBML plug-ins to support SBML Level 3 packages. The use of these packages requires your copy of libSBML to have been configured to enable the appropriate plug-in. The default installation of libSBML comes with the packages below already enabled, but beware that if you built libSBML from source code and disabled one or more of these packages, then their features will not be available.
Package: Hierarchical Model_t Composition
The Hierarchical Model_t Composition package has the nickname “comp”. The libSBML classes that implement this package are marked with the symbol comp
in the libSBML documentation.
- spec_example1.c: Example #1 from the SBML Level 3 Hierarchical Model Composition specification.