MEDYAN.addreaction!

Tuple{MEDYAN.SysDef, MEDYAN.CompartmentReaction}

addreaction!(s::SysDef,reaction::CompartmentReaction)::SysDef

Tuple{MEDYAN.SysDef, AbstractString, Float64, Int64}

addreaction!(s::SysDef,reactionexpr::AbstractString,rate::Float64,invvolumepower::Int)::SysDef

Add a reaction to the system. Return s

reactionexpr is a string describing the reaction stoichiometry

reactionexpr is comprised of reactant and product parts seperated by a "-->"

All whitespace characters are ignored.

Each side is then split by "+" to get the species names.

Repeated or extra "+" are ignored.

A species name can be prepended by a positive integer to represent multiple copies.

  1. rate::Float64: Base rate for the reaction. ((nm³)^(invvolumepower)/s) rate constants correspond to stochastic rate constants in the sense used by Gillespie (J. Comp. Phys., 1976, 22 (4)).
  2. invvolumepower::Int: volumefactor= (1/volume)^invvolumepower where volume is the volume of the compartment in nm³. Generally this is 0 for reactions without another diffusing reactant, and 1 if there is another diffusing reactant.

Example good reactionexpr

"diffusing.a + diffusing.b --> diffusing.c"
"diffusing.c --> diffusing.a + diffusing.b"
"+ + diffusing.c + --> + diffusing.a + + diffusing.b + +"
" --> diffusing.a + diffusing.b"
"diffusing.a + diffusing.b --> "
"diffusing.a + diffusing.a --> "
"2diffusing.a --> "
"2diffusing.a --> 20diffusing.a"
"diffusing.c + diffusing.b --> diffusing.c + diffusing.b"
"fixedspecies.rate1b --> fixedspecies.g"
"fixedspecies.rate1b + fixedspecies.g --> fixedspecies.g"
"fixedspecies.rate1b + 23fixedspecies.g --> fixedspecies.g"
"fixedspecies.g --> fixedspecies.rate1b + 23fixedspecies.g"
"fixedspecies.g + fixedspecies.rate1b--> 2fixedspecies.rate1b + 23fixedspecies.g"
"filamentsite.MT.d --> filamentsite.MT.d"
"filamentsite.MT.d + diffusing.a --> filamentsite.MT.d"
"fixedspecies.g --> diffusing.a"
"diffusing.a --> fixedspecies.g"
"filamentsite.actin.pm + diffusing.a --> filamentsite.actin.pm"