biochemical modeling - quickstart tutorial

This page is intended to help you get up and running writing models of biochemical systems in little b. If you want to understand little b's syntax and semantics, or read a more in-depth explanation of the design of the biochemistry module, check out the main tutorial, accessible from the tutorial index.

Each section contains a graphic showing a generic situation (above) and a specific instantiation of that situation (below). The code to the right describes the generic situation, and then partially describes the specific situation. Reactions and species implied by the partial description are computed automatically by inference mechanisms.

binding reaction

Reactions in a simple compartment. Monomer1 and monomer2 bind to form complex. Complex degrades back to the monomers via an unbinding reaction.

; include the base definitions for biochemical modeling
(include b-user/3d-ode-biochemistry :use)

; define species types
(define monomer1 [[species-type] :location-class compartment])
(define monomer2 [[species-type] :location-class compartment])
(define complex [[species-type] :location-class compartment])

; define reactions
(define binding [[reaction-type {monomer1 + monomer2} {complex}]
                 (.set-rate-method 'mass-action {1 / millimolar / seconds})])

(define unbinding [[reaction-type {complex} {monomer1 + monomer2}]
                     (.set-rate-method 'mass-action {1 / seconds})])

; a compartment to put things in
(define c [[compartment] {.size.value := 3 nanoliters}])

; add the substrates (or the products, or both) - inference computes complex.(in c)
c.(contains monomer1)
c.(contains monomer2)

; set initial conditions on species types
{monomer1.t0 := 1 millimolar}
{monomer2.t0 := 2 millimolar}

; write the model
(create-ode-model :name "binding")

membrane transport

An ion is transported back and forth across a membrane, m, via a transporter.

The membrane is related to two compartments via the c1 and c2 fields. Note that the transporter could be inverted in the membrane by writing: m.inverse.(contains transporter). This would generate additional reactions, import.(in m.inverse) and export.(in m.inverse)

; include the base definitions for biochemical modeling
(include b-user/3d-ode-biochemistry :use)

(define ion [[species-type] :location-class compartment])
(define ion-transporter [[species-type] :location-class membrane])

; define reactions:
(define import [reaction-type {ion.(required :c1) + ion-transporter}
                              {ion.(required :c2) + ion-transporter}])

(define export [reaction-type {ion.(required :c2) + ion-transporter}
                              {ion.(required :c1) + ion-transporter}])

; define a spherical membrane-enclosed compartment inside another compartment
(define inner [[compartment] {.size.value := 4/3 pi {10 micrometers} ^ 3}])
(define outer [[compartment] {.size.value := 4/3 pi {10 micrometers} ^ 3}])
(define [[membrane] :c2 outer :c1 inner
          {.size.value := 4 pi {10 micrometers} ^ 2}])

; put the ion in the outer compartment, the transporter in the membrane
outer.(contains ion)
m.(contains ion-transporter) ; a rule infers ion.(in inner) - alternatively, one could write:
                 ; inner.(contains ion) ; this would put ion in inner compartment, b infers ion in dish

; set initial conditions on species
{ion.(in outer).conc.t0 := 1 millimolar}
{ion-transporter.(in me1.membrane).conc.t0 := 2 moles / meters ^ 2}

; ... write the model
(create-ode-model :name "transport")

membrane apposition

Two receptors, r1 and r2, in apposing membranes, mb1 and mb2 bind to each other to form a complex, r1r2, which degrades (unbinding) back to the two receptors.

Note that the complex appears in a new location, a membrane-apposition, named ma. This is location represents the relationship between mb1 and mb2, and is written [membrane-apposition mb1 mb2]. The membrane-apposition is related to the membranes via the m1 and m2 fields. The inverse relationship, [membrane-apposition mb2 mb1] is created automatically. If the locations of r1 and r2 were swapped, r1r2 would be created in this inverse location.

; include the base definitions for biochemical modeling
(include b-user/3d-ode-biochemistry :use)

; define species types
(define r1 [[species-type] :location-class membrane])
(define r2 [[species-type] :location-class membrane])
(define r1r2 [[species-type] :location-class membrane-apposition])

; define reactions
(define binding [[reaction-type {r1.(required :m1) + r1.(required m2)}
                                {r1r2}])
unbinding.(set-rate-method 'mass-action {1 / millimolar / seconds})])

(define unbinding [[reaction-type {r1r2}
                                  {r1.(required :m1) + r1.(required m2)}])
unbinding.(set-rate-method 'mass-action {1 / seconds})])

; a compartment to put things in
(define mb1 [membrane])
(define mb1 [membrane])
(define ma [membrane-apposition mb1 mb2]
            {.size.value := {10 micrometers} ^ 2}])])

; add the product this time - the substrates are generated by inference over the unbinding reaction
ma.(contains r1r2)

; set initial conditions on species
{r1.(in m1).conc.t0 := 1 millimolar}
{r2.(in m2).conc.t0 := 2 millimolar}

; write the model...
(create-ode-model :name "apposition")