CME models

NumCME.CmeModel โ€” Type

Stochastic reaction network model.

Fields

stoich_matrix::Matrix{IntT}

(Net) stoichiometry matrix. Column i represents the net change to molecular counts due to reaction i.

propensities::Vector{PT}

Propensity functions.

parameters::AbstractVector

Parameters.

Examples

The following code constructs a CmeModel instance for the two-state telegraphic gene expression model.

๐•Š = [[-1, 1, 0] [1, -1, 0] [0, 0, 1] [0, 0, -1]] # Net stoichiometry matrix for 3 species `inactive_gene`, `activated_gene`, `mRNA`
a1 = propensity() do x, p
    p[1] * x[1]
end
a2 = propensity() do x, p
    p[2] * x[2]
end
a3 = propensity() do x, p
    p[3] * x[2]
end
a4 = propensity() do x, p
    p[4] * x[3]
end
kโ‚€โ‚ = 0.05
kโ‚โ‚€ = 0.1
ฮป = 5.0
ฮณ = 0.5
ฮธ = [kโ‚€โ‚, kโ‚โ‚€, ฮป, ฮณ]
model = CmeModel(๐•Š, [a1,a2,a3,a4], ฮธ)

See also

CmeModelWithSensitivity, Propensity, StandardTimeInvariantPropensity, JointTimeVaryingPropensity, SeparableTimeVaryingPropensity.

source
NumCME.CmeModelWithSensitivity โ€” Method
CmeModelWithSensitivity(stoich_matrix, propensities::Vector{PT}, parameters::AbstractVector) where {PT <: Propensity}

Construct a CME model with sensitivity information using a net stoichiometry matrix stoich_matrix and propensity functions propensities and parameters parameters. The partial derivatives of the propensity functions with respect to parameters are automatically derived using automatic differentiation.

source
NumCME.CmeModelWithSensitivity โ€” Method
CmeModelWithSensitivity(model::CmeModel)

Construct a CME model with sensitivity from a CME model (without sensitivity information) using ForwardDiff.jl automatic differentiation.

source
NumCME.get_gradient_sparsity_patterns โ€” Method
get_gradient_sparsity_patterns(
    model::CmeModelWithSensitivity
) -> SparseArrays.SparseMatrixCSC

Get the sparse matrix representing dependency pattern of propensity functions of model parameters.

source
NumCME.get_parameters โ€” Method
get_parameters(
    model::CmeModelWithSensitivity
) -> AbstractVector{T} where T

Get parameter vectors of a Chemical Master Equation model instance.

source
NumCME.get_parameters โ€” Method
get_parameters(model::CmeModel) -> AbstractVector{T} where T

Get the vector of model parameters.

source
NumCME.get_propensities โ€” Method
get_propensities(
    model::CmeModelWithSensitivity
) -> Vector{var"#s17"} where var"#s17"<:Propensity

Get the vector of propensities.

source
NumCME.get_propensities โ€” Method
get_propensities(
    model::CmeModel
) -> Vector{var"#s17"} where var"#s17"<:Propensity

Get vector of propensities.

source
NumCME.get_propensity_gradients โ€” Method
get_propensity_gradients(
    model::CmeModelWithSensitivity
) -> Vector{var"#s17"} where var"#s17"<:PropensityGradient

Get the propensity gradients.

source
NumCME.get_species_count โ€” Method
get_species_count(model::CmeModelWithSensitivity) -> Int64

Get the number of species (i.e., the length of the CME state vector).

source
NumCME.get_stoich_matrix โ€” Method
get_stoich_matrix(
    model::CmeModelWithSensitivity
) -> Matrix{IntT} where IntT<:Integer

Get the net stoichiometry matrix.

source