Reactions
This module is for defining, investigating and modifying biochemical reactions.
Index
BioChemicalTreatment.Reactions.BioChemicalReactionSystem
BioChemicalTreatment.Reactions.assemble_equations
BioChemicalTreatment.Reactions.check_composition
Documentation
BioChemicalTreatment.Reactions.BioChemicalReactionSystem
— TypeBioChemicalReactionSystem
A type for a biochemical reaction. Currently only preliminary until a final structure has been found.
Fields:
states
: The states of the systemstate_properties
: Properties associated with the statesparameters
: The parameters of the systemparameter_properties
: Properties associated with the parametersprocessrates
: Symbols for the processrates of the systemprocessrate_eqns
: Dict to get the equations for the processratesprocessrate_properties
: Properties associated with the processratesstoichmat
: The stoichiometric matrixcompositionmat
: The composition matrixcomposition_names
: The names of the composition
Constructors
BioChemicalReactionSystem(modelname::AbstractString; name=Symbol(modelname))
Get the model called modelname
from the library.
BioChemicalReactionSystem(
dir::AbstractString, modelname::AbstractString;
states_path = joinpath(dir, modelname *"_states.csv"),
parameters_path = joinpath(dir, modelname *"_parameters.csv"),
processrates_path = joinpath(dir, modelname *"_processrates.csv"),
matrix_path = joinpath(dir, modelname *"_matrix.csv"),
compositionmat_path = joinpath(dir, modelname *"_compositionmatrix.csv");
delimiter=';',
name=:MatrixDefinedReaction
)
Get the model named modelname
found in the folder dir
. Overwrite single files to be from a different location by providing the path in the corresponding keyword argument. The files should be equivalent to csv
, but delimited by the given delimiter (default ';'
)
BioChemicalReactionSystem(states_path, parameters_path, processrates_path, matrix_path, compositionmatrix_path; delimiter=';', name=:MatrixDefinedReaction)
Get the model specified by the files under the given paths. Files should be csv
-files which are delimited by the given delimiter (default ';'
).
BioChemicalReactionSystem(file_path::AbstractString;
states_sheet="states", parameters_sheet="parameters",
processrates_sheet="processrates", matrix_sheet="matrix",
compositionmatrix_sheet="compositionmatrix",
name::Symbol=:MatrixDefinedReaction)
Get the model specified in the xlsx-file under file_path
. The file needs to have sheets for the different matrices with the given names.
To load models defined in XLSX-files, the [XLSX.jl](@extref XLSX :doc:`index`) package needs to be loaded as it enables reading the files.
BioChemicalTreatment.Reactions.assemble_equations
— Functionequations(stoichmat, rates, states)
Assemble and return the rate equations specified by the stoichiometric matrix stoichmat
with rows associated to rates
and columns to states
. Order is assumed to be matching between stoichiometric matrix and rates/states.
equations(sys::BioChemicalReactionSystem)
Assemble and return the rate equations specified of sys
.
BioChemicalTreatment.Reactions.check_composition
— Functioncheck_composition(stoichmat, compositionmat; atol = sqrt(eps()))
Check if the stoichiometric matrix stoichmat
fulfills mass conservation specified by the composition matrix compositionmat
. Assumes that the column orderings (corresponding to states) are matching.
Keyword arguments
atol
: Absolute tolerance for numeric comparison. If symbolic inputs are provided (even if they represent numbers), the values have to be exactly zero.
check_composition(sys::BioChemicalReactionSystem; params_substitution = :expressions, kwargs...)
Check if sys
fulfills the mass conservation requirement.
Optional keyword argument params_substitution
specifies how the parameters are treated:
:expressions
: All parameters specified as expressions are replaced. Otherwise left symbolic. If true it is fulfilled for every parameter values of non-expression parameters.:values
: All parameters are replaced with their default values. If true, it is fulfilled with the default parameters.nothing
(of typeNothing
, not a symbol): The parameters are left symbolic as they are. If true, it is fulfilled with all possible values for parameters.
Using additional kwargs
, individual parameters can be replaced. Replacing by values has only an effect when params_substitution == :values
and replacing by expressions when params_substitution == :values
or params_substitution == :expressions
.