Skip to content

Commit dd12686

Browse files
committed
update file import/export cross references
1 parent 520647e commit dd12686

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ etc).
8080
- [SciMLSensitivity.jl](https://github.com/SciML/SciMLSensitivity.jl) can be used to compute local sensitivities of functions containing forward model simulations.
8181

8282
#### [Features of packages built upon Catalyst](@id doc_home_features_other_packages)
83-
- Catalyst [`ReactionSystem`](@ref)s can be [imported from SBML files](https://docs.sciml.ai/Catalyst/stable/model_creation/model_file_loading_and_export/#Loading-SBML-files-using-SBMLImporter.jl-and-SBMLToolkit.jl) via
83+
- Catalyst [`ReactionSystem`](@ref)s can be [imported from SBML files](@id model_file_import_export_sbml) via
8484
[SBMLImporter.jl](https://github.com/SciML/SBMLImporter.jl) and [SBMLToolkit.jl](https://github.com/SciML/SBMLToolkit.jl),
85-
and [from BioNetGen .net files](https://docs.sciml.ai/Catalyst/stable/model_creation/model_file_loading_and_export/#file_loading_rni_net) and various stoichiometric matrix network representations
85+
and [from BioNetGen .net files](@ref model_file_import_export_sbml_rni_net) and various stoichiometric matrix network representations
8686
using [ReactionNetworkImporters.jl](https://github.com/SciML/ReactionNetworkImporters.jl).
8787
- [MomentClosure.jl](https://github.com/augustinas1/MomentClosure.jl) allows generation of symbolic
8888
ModelingToolkit `ODESystem`s that represent moment closure approximations to moments of the

docs/src/model_creation/model_file_loading_and_export.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Loading Chemical Reaction Network Models from Files
1+
# [Loading Chemical Reaction Network Models from Files](@id model_file_import_export)
22
Catalyst stores chemical reaction network (CRN) models in `ReactionSystem` structures. This tutorial describes how to load such `ReactionSystem`s from, and save them to, files. This can be used to save models between Julia sessions, or transfer them from one session to another. Furthermore, to facilitate the computation modelling of CRNs, several standardised file formats have been created to represent CRN models (e.g. [SBML](https://sbml.org/)). This enables CRN models to be shared between different softwares and programming languages. While Catalyst itself does not have the functionality for loading such files, we will here (briefly) introduce a few packages that can load different file types to Catalyst `ReactionSystem`s.
33

4-
## Saving Catalyst models to, and loading them from, Julia files
4+
## [Saving Catalyst models to, and loading them from, Julia files](@id model_file_import_export_crn_serialization)
55
Catalyst provides a `save_reactionsystem` function, enabling the user to save a `ReactionSystem` to a file. Here we demonstrate this by first creating a [simple cross-coupling model](@ref basic_CRN_library_cc):
66
```@example file_handling_1
77
using Catalyst
@@ -56,7 +56,7 @@ end
5656

5757
In addition to transferring models between Julia sessions, the `save_reactionsystem` function can also be used or print a model to a text file where you can easily inspect its components.
5858

59-
## Loading and Saving arbitrary Julia variables using Serialization.jl
59+
## [Loading and Saving arbitrary Julia variables using Serialization.jl](@id model_file_import_export_julia_serialisation)
6060
Julia provides a general and lightweight interface for loading and saving Julia structures to and from files that it can be good to be aware of. It is called [Serialization.jl](https://docs.julialang.org/en/v1/stdlib/Serialization/) and provides two functions, `serialize` and `deserialize`. The first allows us to write a Julia structure to a file. E.g. if we wish to save a parameter set associated with our model, we can use
6161
```@example file_handling_2
6262
using Serialization
@@ -70,7 +70,7 @@ rm("saved_parameters.jls") # hide
7070
loaded_sol # hide
7171
```
7272

73-
## [Loading .net files using ReactionNetworkImporters.jl](@id file_loading_rni_net)
73+
## [Loading .net files using ReactionNetworkImporters.jl](@id model_file_import_export_sbml_rni_net)
7474
A general-purpose format for storing CRN models is so-called .net files. These can be generated by e.g. [BioNetGen](https://bionetgen.org/). The [ReactionNetworkImporters.jl](https://github.com/SciML/ReactionNetworkImporters.jl) package enables the loading of such files to Catalyst `ReactionSystem`. Here we load a [Repressilator](@ref basic_CRN_library_repressilator) model stored in the "repressilator.net" file:
7575
```julia
7676
using ReactionNetworkImporters
@@ -96,15 +96,15 @@ Note that, as all initial conditions and parameters have default values, we can
9696

9797
A more detailed description of ReactionNetworkImporter's features can be found in its [documentation](https://docs.sciml.ai/ReactionNetworkImporters/stable/).
9898

99-
## Loading SBML files using SBMLImporter.jl and SBMLToolkit.jl
99+
## [Loading SBML files using SBMLImporter.jl and SBMLToolkit.jl](@id model_file_import_export_sbml)
100100
The Systems Biology Markup Language (SBML) is the most widespread format for representing CRN models. Currently, there exist two different Julia packages, [SBMLImporter.jl](https://github.com/sebapersson/SBMLImporter.jl) and [SBMLToolkit.jl](https://github.com/SciML/SBMLToolkit.jl), that are able to load SBML files to Catalyst `ReactionSystem` structures. SBML is able to represent a *very* wide range of model features, with both packages supporting most features. However, there exist SBML files (typically containing obscure model features such as events with time delays) that currently cannot be loaded into Catalyst models.
101101

102102
SBMLImporter's `load_SBML` function can be used to load SBML files. Here, we load a [Brusselator](@ref basic_CRN_library_brusselator) model stored in the "brusselator.xml" file:
103103
```julia
104104
using SBMLImporter
105105
prn, cbs = load_SBML("brusselator.xml", massaction = true)
106106
```
107-
Here, while [ReactionNetworkImporters generates a `ParsedReactionSystem` only](@ref file_loading_rni_net), SBMLImporter generates a `ParsedReactionSystem` (here stored in `prn`) and a [so-called `CallbackSet`](https://docs.sciml.ai/DiffEqDocs/stable/features/callback_functions/#CallbackSet) (here stored in `cbs`). While `prn` can be used to create various problems, when we simulate them, we must also supply `cbs`. E.g. to simulate our brusselator we use:
107+
Here, while [ReactionNetworkImporters generates a `ParsedReactionSystem` only](@ref model_file_import_export_sbml_rni_net), SBMLImporter generates a `ParsedReactionSystem` (here stored in `prn`) and a [so-called `CallbackSet`](https://docs.sciml.ai/DiffEqDocs/stable/features/callback_functions/#CallbackSet) (here stored in `cbs`). While `prn` can be used to create various problems, when we simulate them, we must also supply `cbs`. E.g. to simulate our brusselator we use:
108108
```julia
109109
using Catalyst, OrdinaryDiffEq, Plots
110110
tspan = (0.0, 50.0)
@@ -121,10 +121,10 @@ A more detailed description of SBMLImporter's features can be found in its [docu
121121
!!! note
122122
The `massaction = true` option informs the importer that the target model follows mass-action principles. When given, this enables SBMLImporter to make appropriate modifications to the model (which are important for e.g. jump simulation performance).
123123

124-
### SBMLImporter and SBMLToolkit
124+
### [SBMLImporter and SBMLToolkit](@id model_file_import_export_package_alts)
125125
Above, we described how to use SBMLImporter to import SBML files. Alternatively, SBMLToolkit can be used instead. It has a slightly different syntax, which is described in its [documentation](https://github.com/SciML/SBMLToolkit.jl), and does not support as wide a range of SBML features as SBMLImporter. A short comparison of the two packages can be found [here](https://github.com/sebapersson/SBMLImporter.jl?tab=readme-ov-file#differences-compared-to-sbmltoolkit). Generally, while they both perform well, we note that for *jump simulations* SBMLImporter is preferable (its way for internally representing reaction event enables more performant jump simulations).
126126

127-
## Loading models from matrix representation using ReactionNetworkImporters.jl
127+
## [Loading models from matrix representation using ReactionNetworkImporters.jl](@id model_file_import_export_matrix_representations)
128128
While CRN models can be represented through various file formats, they can also be represented in various matrix forms. E.g. a CRN with $m$ species and $n$ reactions (and with constant rates) can be represented with either
129129
- An $mxn$ substrate matrix (with each species's substrate stoichiometry in each reaction) and an $nxm$ product matrix (with each species's product stoichiometry in each reaction).
130130

0 commit comments

Comments
 (0)