Reads an SBML core document into an sbml_model: Level 3 Versions 1 and
2, and Level 2 Versions 4 and 5, which are mapped to their Level 3
meaning. Every element carries the attributes Level 3 defines; optional
values without a default read as NA.
notes and annotation on the listOf* containers are dropped, so
sbml_write() cannot write them back.
Arguments
- x
A file path, a
file://,http://orhttps://URL, a string holding the XML itself, or a raw vector.- ignore_packages
A document that uses SBML Level 3 packages (
comp,fbc, ...) is refused with azusbml_unsupportederror naming them. WithTRUE, the core model is read, the package content is dropped, and the dropped package names are kept in the model'signored_packages.
Errors
zusbml_parse_errorfor a malformed document: an unknown element or attribute in the SBML namespace, a missing required attribute, or a value of the wrong type. Itspathfield names the element, for examplemodel/listOfSpecies/species[3], andattributethe attribute.zusbml_unsupportedfor SBML packages, Level 1, and Level 2 before Version 4.zusbml_arg_errorfor an argument of the wrong type, a missing file or a directory.
Examples
path <- system.file("extdata", "decay.xml", package = "zusbml")
m <- sbml_read(path)
m
#> <sbml_model 'decay'> SBML Level 3 Version 2
#> compartments 1
#> species 2
#> parameters 1
#> reactions 1
sbml_species(m)
#> id name compartment initial_amount initial_concentration substance_units
#> 1 S1 <NA> C 1 NA <NA>
#> 2 S2 <NA> C 0 NA <NA>
#> has_only_substance_units boundary_condition constant conversion_factor metaid
#> 1 FALSE FALSE FALSE <NA> <NA>
#> 2 FALSE FALSE FALSE <NA> <NA>
#> sbo_term notes annotation
#> 1 <NA> <NA> <NA>
#> 2 <NA> <NA> <NA>