CME models
NumCME.CmeModel
โ TypeStochastic 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
.
NumCME.CmeModelWithSensitivity
โ TypeCmeModelWithSensitivity
Stochastic reaction network model with information about gradient of the propensity functions with respect to parameters.
See also
NumCME.CmeModelWithSensitivity
โ MethodCmeModelWithSensitivity(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.
NumCME.CmeModelWithSensitivity
โ MethodCmeModelWithSensitivity(model::CmeModel)
Construct a CME model with sensitivity from a CME model (without sensitivity information) using ForwardDiff.jl
automatic differentiation.
NumCME.get_gradient_sparsity_patterns
โ Methodget_gradient_sparsity_patterns(
model::CmeModelWithSensitivity
) -> SparseArrays.SparseMatrixCSC
Get the sparse matrix representing dependency pattern of propensity functions of model parameters.
NumCME.get_parameter_count
โ Methodget_parameter_count(model::CmeModelWithSensitivity) -> Any
Get number of parrameters.
NumCME.get_parameter_count
โ Methodget_parameter_count(model::CmeModel) -> Any
Get number of parameters.
NumCME.get_parameters
โ Methodget_parameters(
model::CmeModelWithSensitivity
) -> AbstractVector{T} where T
Get parameter vectors of a Chemical Master Equation model instance.
NumCME.get_parameters
โ Methodget_parameters(model::CmeModel) -> AbstractVector{T} where T
Get the vector of model parameters.
NumCME.get_propensities
โ Methodget_propensities(
model::CmeModelWithSensitivity
) -> Vector{var"#s17"} where var"#s17"<:Propensity
Get the vector of propensities.
NumCME.get_propensities
โ Methodget_propensities(
model::CmeModel
) -> Vector{var"#s17"} where var"#s17"<:Propensity
Get vector of propensities.
NumCME.get_propensity_gradients
โ Methodget_propensity_gradients(
model::CmeModelWithSensitivity
) -> Vector{var"#s17"} where var"#s17"<:PropensityGradient
Get the propensity gradients.
NumCME.get_reaction_count
โ Methodget_reaction_count(model::CmeModelWithSensitivity) -> Int64
Get number of reactions in the model.
NumCME.get_reaction_count
โ Methodget_reaction_count(model::CmeModel) -> Int64
Get number of reactions.
NumCME.get_species_count
โ Methodget_species_count(model::CmeModelWithSensitivity) -> Int64
Get the number of species (i.e., the length of the CME state vector).
NumCME.get_species_count
โ Methodget_species_count(model::CmeModel) -> Int64
Get number of species.
NumCME.get_stoich_matrix
โ Methodget_stoich_matrix(
model::CmeModelWithSensitivity
) -> Matrix{IntT} where IntT<:Integer
Get the net stoichiometry matrix.
NumCME.get_stoich_matrix
โ Methodget_stoich_matrix(
model::CmeModel
) -> Matrix{IntT} where IntT<:Integer
Get net stoichiometry matrix.