diff --git a/assets/Project.toml b/assets/Project.toml index c735f6e7..c5dd6e60 100644 --- a/assets/Project.toml +++ b/assets/Project.toml @@ -1,5 +1,5 @@ [deps] -DiffEqBiological = "eb300fae-53e8-50a0-950c-e21f52c2b7e0" +Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83" LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" ParameterizedFunctions = "65888b18-ceab-5e60-b2b9-181511a3b968" diff --git a/assets/assets.jl b/assets/assets.jl index 6112ea29..25be8b44 100644 --- a/assets/assets.jl +++ b/assets/assets.jl @@ -1,5 +1,5 @@ # Generate the assets (pngs for README) -using Latexify, LaTeXStrings, ParameterizedFunctions, DiffEqBiological +using Latexify, LaTeXStrings, ParameterizedFunctions, Catalyst struct Ket{T} x::T @@ -20,12 +20,12 @@ things = [ (r_bind, r_unbind), A + B ↔ C Hill(C, v, k, n), 0 --> X d_x, X --> 0 - end r_bind r_unbind v k n d_x), + end; form=:ode), "demo_rn_arrow" => latexify(@reaction_network demoNetwork begin (r_bind, r_unbind), A + B ↔ C Hill(C, v, k, n), 0 --> X d_x, X --> 0 - end r_bind r_unbind v k n d_x; env=:arrow), + end), ] cd("$(pkgdir(Latexify))/assets") do diff --git a/docs/make.jl b/docs/make.jl index e5156bd7..abecb388 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -19,7 +19,7 @@ makedocs( "tutorials/recipes.md", "Use with other packages" => [ "tutorials/parameterizedfunctions.md", - "tutorials/DiffEqBiological.md" + "tutorials/Catalyst.md" ], "tutorials/notebooks.md", "arguments.md", diff --git a/docs/src/arguments.md b/docs/src/arguments.md index 9a5440df..6b6214e7 100644 --- a/docs/src/arguments.md +++ b/docs/src/arguments.md @@ -43,7 +43,7 @@ latexify(args, env=:mdtable) ``` ## Chemical arrow notation -Available with `ReactionNetwork`s from `DiffEqBiological`. +Available with `ReactionNetwork`s from `Catalyst`. ```@eval Base.include(@__MODULE__, "src/table_generator.jl") args = [arg for arg in keyword_arguments if :arrow in arg.env] diff --git a/docs/src/table_generator.jl b/docs/src/table_generator.jl index 78c236f3..f4e04bf0 100644 --- a/docs/src/table_generator.jl +++ b/docs/src/table_generator.jl @@ -39,7 +39,7 @@ keyword_arguments = [ KeywordArgument(:convert_unicode, [:mdtable, :tabular, :align, :array, :raw, :inline], "`Bool`", "`true`", "Convert unicode characters to latex commands, for example `α` to `\\alpha`", [:Any]), KeywordArgument(:cdot, [:mdtable, :tabular, :align, :array, :raw, :inline], "`Bool`", "`true`", "Toggle between using `\\cdot` or just a space to represent multiplication.", [:Any]), KeywordArgument(:symbolic, [:align], "`Bool`", "`false`", "Use symbolic calculations to clean up the expression.", [:ReactionNetwork]), - KeywordArgument(:clean, [:align], "`Bool`", "`false`", "Clean out `1*` terms. Only useful for DiffEqBiological versions 3.4 or below.", [:ReactionNetwork]), + KeywordArgument(:clean, [:align], "`Bool`", "`false`", "Clean out `1*` terms. Only useful for Catalyst (then named DiffEqBiological) versions 3.4 or below.", [:ReactionNetwork]), KeywordArgument(:rows, [:align], "Iterable or symol", ":all", "Which rows to include in the output.", [:Any]), KeywordArgument(:booktabs, [:tabular], "`Bool`", "`false`", "Add top, mid and bottom booktabs rule", [:Any]), KeywordArgument(:index, [:mdtable, :tabular, :align, :array, :raw, :inline], "`Symb`", "`:bracket`", "Represent index specification with `:bracket` (`u[1]`) or `:subscript` (`u_1`). ", [:Any]), diff --git a/docs/src/tutorials/DiffEqBiological.md b/docs/src/tutorials/Catalyst.md similarity index 73% rename from docs/src/tutorials/DiffEqBiological.md rename to docs/src/tutorials/Catalyst.md index 1e66f139..dbb0f93b 100644 --- a/docs/src/tutorials/DiffEqBiological.md +++ b/docs/src/tutorials/Catalyst.md @@ -1,22 +1,21 @@ -# Use with @reaction_network from DiffEqBiological.jl. +# Use with @reaction_network from Catalyst.jl. -Latexify.jl has methods for dealing with AbstractReactionNetworks. For more information regarding this DSL, turn to its [docs](http://docs.juliadiffeq.org/latest/models/biological.html). The latexify end of things are pretty simple: feed a reaction network to `latexify()` and let it do its magic. +Latexify.jl has methods for dealing with the `ReactionNetwork` models generated by Catalyst.jl. More information regarding these can be found [here](https://github.com/SciML/Catalyst.jl). The latexify end of things are pretty simple: feed a reaction network to `latexify()` and let it do its magic. ```julia -using DiffEqBiological +using Catalyst using Latexify copy_to_clipboard(true) -@reaction_func hill2(x, v, k) = v*x^2/(k^2 + x^2) - -rn = @reaction_network MyRnType begin +hill2(x, v, k) = v*x^2/(k^2 + x^2) +rn = @reaction_network begin hill2(y, v_x, k_x), 0 --> x p_y, 0 --> y (d_x, d_y), (x, y) --> 0 (r_b, r_u), x ↔ y -end v_x k_x p_y d_x d_y r_b r_u +end -latexify(rn) +latexify(rn; form=:ode) ``` ```math \begin{align} @@ -25,12 +24,10 @@ latexify(rn) \end{align} ``` -The method has a keyword for choosing between outputting the ODE or the noise term. While it is not obvious from the latexify output, the noise in the reaction network is correlated. - +Alternatively, the SDEs generated through the chemical Langevin equations can be displayed by setting the `form` argument to `:sde`. Here, the noise in the reaction network is correlated/ ```julia -latexify(rn; noise=true) +latexify(rn; form=:sde) ``` - ```math \begin{align} \frac{dx}{dt} =& \sqrt{\frac{v_{x} \cdot y^{2}}{k_{x}^{2} + y^{2}}} - \sqrt{d_{x} \cdot x} - \sqrt{r_{b} \cdot x} + \sqrt{r_{u} \cdot y} \\ @@ -38,12 +35,14 @@ latexify(rn; noise=true) \end{align} ``` +Note: On the current version of Latexify, generation of SDEs from reaction networks is broken. + ## Chemical arrow notation -DiffEqBiologicals reaction network is all about chemical arrow notation, so why should we not be able to render arrows? +Catalyst reaction network is all about chemical arrow notation, so why should we not be able to render arrows? -Use `latexify`'s `env` keyword argument to specify that you want `:chemical` (or the equivalent `:arrow`, `:arrows` or `:chem`). +This is the default output (when no value to `form` is given). ```julia latexify(rn; env=:chemical) diff --git a/paper/paper.md b/paper/paper.md index 1e60fe53..0c187b9c 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -41,7 +41,7 @@ Latexify.jl itself. This becomes especially powerful in combination with Julia's metaprogramming facilities and easily generated domain-specific languages (DSLs). Latexify.jl can, for example, output the system of differential equations (and much more) that is automatically generated by a -chemical reaction arrow DSL provided by DiffEqBiological.jl [@diffeq]. +chemical reaction arrow DSL provided by Catalyst.jl [@diffeq]. The package aims to support the scientific work-flow through facilitating inspection, automation and representation. Simple inspection of the equations