You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,17 @@
5
5
Finite State Projection [[1]](#1) algorithms for chemical reaction networks based on [Catalyst.jl](https://github.com/SciML/Catalyst.jl) and [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl). Converts descriptions of reaction networks into `ODEProblem`s and `SteadyStateProblem`s for use with [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl).
6
6
7
7
## Features:
8
-
- Built on top of [Catalyst.jl](https://github.com/SciML/Catalyst.jl)
9
-
- FSP equations are generated as `ODEFunction`/`ODEProblem`s and can be solved with [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), with on-the-fly generation of targeted functions for improved performance
10
-
- The Chemical Master Equation can be represented as a `SparseMatrixCSC`
8
+
9
+
- Built on top of [Catalyst.jl](https://github.com/SciML/Catalyst.jl)
10
+
- FSP equations are generated as `ODEFunction`/`ODEProblem`s and can be solved with [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), with on-the-fly generation of targeted functions for improved performance
11
+
- The Chemical Master Equation can be represented as a `SparseMatrixCSC`
11
12
12
13
More information is available in the [documentation](https://kaandocal.github.io/FiniteStateProjection.jl/dev/). Please feel free to open issues and submit pull requests!
Copy file name to clipboardExpand all lines: docs/src/examples.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ end
16
16
sys =FSPSystem(rn)
17
17
18
18
# Parameters for our system
19
-
ps = [10.0, 1.0]
19
+
ps = [10.0, 1.0]
20
20
21
21
# Initial distribution (over 1 species)
22
22
# Here we start with 0 copies of A
@@ -26,6 +26,7 @@ u0[1] = 1.0
26
26
prob =ODEProblem(sys, u0, (0, 10.0), ps)
27
27
sol =solve(prob, Vern7())
28
28
```
29
+
29
30

30
31
31
32
## Telegraph Model
@@ -35,7 +36,7 @@ Here we showcase the telegraph model, a simplistic description of mRNA transcrip
35
36
The most straightforward description of this system includes three species: two gene states, `G_on` and `G_off`, and mRNA `M`. The state space for this system is 3-dimensional. We know, however, that `G_on` and `G_off` never occur at the same time, indeed the conservation law `[G_on] + [G_off] = 1` allows us to express the state of the system in terms of `G_on` and `M` only. The state space of this reduced system is 2-dimensional.If we use an mRNA cutoff of 100, the state space for the original model has size ``2 \times 2 \times 100 = 400``, while the reduced state space has size ``2 \times 100 = 200``, a two-fold saving. Since the FSP get computationally more expensive for each species in a system, eliminating redundant species as above is recommended for improved performance.
36
37
37
38
!!! note
38
-
39
+
39
40
The class `ReducingIndexHandler`, which performed such reduction on the fly, has been deprecated and will be moved into [Catalyst.jl](https://github.com/SciML/Catalyst.jl).
FiniteStateProjection.jl is a package that implements Finite State Projection algorithms for chemical reaction networks based on [Catalyst.jl](https://github.com/SciML/Catalyst.jl) and [ModelingToolkit](https://github.com/SciML/ModelingToolkit.jl). FiniteStateProjection.jl converts descriptions of reaction networks into `ODEProblem`s that can be used to compute approximate solutions of the Chemical Master Equation with packages such as [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl).
10
10
11
-
The Chemical Master Equation allows us to compute the probability of a reaction system to be in a given state ``\vec n`` at a time ``t``. The state of a system with ``s`` species is described by a vector ``\vec n = (n_1, n_2, \ldots, n_s)`` of length ``s``, where ``n_1, n_2, \ldots`` are the abundances of the different species. The reaction system itself can be represented by an ``s``-dimensional array ``P[n_1,\ldots,n_s]`` that describes the probability of the system being in state ``(n_1,\ldots,n_s)``. Here ``P`` depends on time as the system evolves. Given initial conditions ``P(0)``, the time evolution of ``P`` is given by the Chemical Master Equation, which is a set of linear ODEs that can be solved numerically to predict the probability distribution of the system in the future.
11
+
The Chemical Master Equation allows us to compute the probability of a reaction system to be in a given state ``\vec n`` at a time ``t``. The state of a system with ``s`` species is described by a vector ``\vec n = (n_1, n_2, \ldots, n_s)`` of length ``s``, where ``n_1, n_2, \ldots`` are the abundances of the different species. The reaction system itself can be represented by an ``s``-dimensional array ``P[n_1,\ldots,n_s]`` that describes the probability of the system being in state ``(n_1,\ldots,n_s)``. Here ``P`` depends on time as the system evolves. Given initial conditions ``P(0)``, the time evolution of ``P`` is given by the Chemical Master Equation, which is a set of linear ODEs that can be solved numerically to predict the probability distribution of the system in the future.
12
12
13
-
Since the number of states for a system can be infinite, the Finite State Projection approximates the Chemical Master Equation by only considering a finite number of states, namely those which are most probable. There are various ways to truncate the state space, but the most common is to provide an upper limit for each species, that is, to require ``n_1 < M_1``, ``n_2 < M_2``, etc. for fixed thresholds ``M_1, M_2, \ldots``. The number of states considered will be ``M_1 \times M_2 \times \ldots \times M_s``, and ``P`` can be represented as an array with those dimensions. While truncating the CME allows us to solve the equations numerically, the amount of space required to store ``P`` increases quickly as more species are added.
13
+
Since the number of states for a system can be infinite, the Finite State Projection approximates the Chemical Master Equation by only considering a finite number of states, namely those which are most probable. There are various ways to truncate the state space, but the most common is to provide an upper limit for each species, that is, to require ``n_1 < M_1``, ``n_2 < M_2``, etc. for fixed thresholds ``M_1, M_2, \ldots``. The number of states considered will be ``M_1 \times M_2 \times \ldots \times M_s``, and ``P`` can be represented as an array with those dimensions. While truncating the CME allows us to solve the equations numerically, the amount of space required to store ``P`` increases quickly as more species are added.
14
14
15
15
FiniteStateProjection.jl works by converting a `ReactionSystem` into a function that computes the right-hand side of the (truncated) Chemical Master Equation:
16
16
@@ -19,11 +19,12 @@ FiniteStateProjection.jl works by converting a `ReactionSystem` into a function
19
19
This function is generated dynamically as an `ODEFunction` for use with DifferentialEquations.jl and specialised for each `ReactionSystem`. Users can use their preferred array types and provide additional features by overloading the functions in this package. Alternatively the matrix `A` can be constructed as a `SparseMatrixCSC`. FiniteStateProjection.jl supports both the time-dependent Chemical Master Equation and its steady-state version.
20
20
21
21
## Features
22
-
- Built on top of [Catalyst.jl](https://github.com/SciML/Catalyst.jl)
23
-
- FSP equations are generated as `ODEFunction`/`ODEProblem`s and can be solved with [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), with on-the-fly generation of targeted functions for improved performance
24
-
- The Chemical Master Equation can be generated as a `SparseMatrixCSC`
25
-
- Flexible API for user-defined array types via `IndexHandler`s
22
+
23
+
- Built on top of [Catalyst.jl](https://github.com/SciML/Catalyst.jl)
24
+
- FSP equations are generated as `ODEFunction`/`ODEProblem`s and can be solved with [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl), with on-the-fly generation of targeted functions for improved performance
25
+
- The Chemical Master Equation can be generated as a `SparseMatrixCSC`
26
+
- Flexible API for user-defined array types via `IndexHandler`s
26
27
27
28
## Acknowledgments
28
29
29
-
Special thanks to [Xiamong Fu](https://github.com/palmtree2013), [Brian Munsky](https://www.engr.colostate.edu/~munsky/) and [Huy Vo](https://github.com/voduchuy) for their examples and suggestions and for contributing most of the content in the [Tips & Tricks](@ref tips) page!
30
+
Special thanks to [Xiamong Fu](https://github.com/palmtree2013), [Brian Munsky](https://www.engr.colostate.edu/%7Emunsky/) and [Huy Vo](https://github.com/voduchuy) for their examples and suggestions and for contributing most of the content in the [Tips & Tricks](@ref tips) page!
Copy file name to clipboardExpand all lines: docs/src/indexhandlers.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Index Handlers
2
2
3
-
The task of an index handler is to provide a mapping between the system state and the way it is stored in memory, usually as a multidimensional array. The standard approach is to represent the states of a system with ``s`` reactions as an ``s``-dimensional array and have the index ``(i_1, \ldots, i_s)`` correspond to the state ``(n_1 = i_1, \ldots, n_s = i_s)``. This is implemented by the class [`DefaultIndexHandler`](@ref), which accepts an offset argument to deal with Julia's 1-based indexing (so the Julia index $(1,\ldots,1)$ corresponds to the state with no molecules).
3
+
The task of an index handler is to provide a mapping between the system state and the way it is stored in memory, usually as a multidimensional array. The standard approach is to represent the states of a system with ``s`` reactions as an ``s``-dimensional array and have the index ``(i_1, \ldots, i_s)`` correspond to the state ``(n_1 = i_1, \ldots, n_s = i_s)``. This is implemented by the class [`DefaultIndexHandler`](@ref), which accepts an offset argument to deal with Julia's 1-based indexing (so the Julia index $(1,\ldots,1)$ corresponds to the state with no molecules).
4
4
5
5
See the [internal API](@ref index_handlers_internal) on how to define your own `IndexHandler` type.
Copy file name to clipboardExpand all lines: docs/src/mainapi.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
# Main API
2
+
2
3
```@meta
3
4
CurrentModule = FiniteStateProjection
4
5
```
@@ -13,8 +14,8 @@ FSPSystem
13
14
14
15
## Creating ODE systems
15
16
16
-
The following methods convert a reaction network into a system of ODEs representing the time-dependent FSP. This package provides a flexible way to represent the FSP in memory via index handlers, see [Index Handlers] for more information.
17
-
17
+
The following methods convert a reaction network into a system of ODEs representing the time-dependent FSP. This package provides a flexible way to represent the FSP in memory via index handlers, see [Index Handlers] for more information.
0 commit comments