Reactions

This module is for defining, investigating and modifying biochemical reactions.

Index

Documentation

BioChemicalTreatment.Reactions.BioChemicalReactionSystemType
BioChemicalReactionSystem

A type for a biochemical reaction. Currently only preliminary until a final structure has been found.

Fields:

  • states: The states of the system
  • state_properties: Properties associated with the states
  • parameters: The parameters of the system
  • parameter_properties: Properties associated with the parameters
  • processrates: Symbols for the processrates of the system
  • processrate_eqns: Dict to get the equations for the processrates
  • processrate_properties: Properties associated with the processrates
  • stoichmat: The stoichiometric matrix
  • compositionmat: The composition matrix
  • composition_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.

Note
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.
source
BioChemicalTreatment.Reactions.assemble_equationsFunction
equations(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.

source
equations(sys::BioChemicalReactionSystem)

Assemble and return the rate equations specified of sys.

source
BioChemicalTreatment.Reactions.check_compositionFunction
check_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.
source
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 type Nothing, 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.

source