Synthesizing Stochasticity in Synthesizing Stochasticity in Biochemical SystemsBiochemical Systems
In partial fulfillment of the requirements for a master of electrical engineering degree
Brian FettMarc Riedel
Computation and BiologyComputation and Biology
• Cell Chemistry modeled with reaction sets• Cell assumed to have a starting set of concentrations
– Given the size of a cell, this implies quantities• Modeling can be done in two ways
– ODEs – quick, deterministic, approximate– Gillespie – Monte Carlo, Markov chain, exact
Design ScenarioDesign Scenario
• Anderson/Arkin• Engineering Bacteria that will seek/destroy cancer• Multi-stage system
– Inactive, detect cancer, protection from host– Active, attack cancer, vulnerable
• The inactive form will be carried by blood stream– What if there is a cancer downstream?
Two Cancers DeterministicTwo Cancers Deterministic
Blood flow
Two Cancers StochasticTwo Cancers Stochastic
Blood flow
Discrete KineticsDiscrete Kinetics
“States”
A B C
4 7 5
2 6 8
22 0 997
S1
S2
S3
A reaction transforms one state into another:
21 1SS
Re.g.,
BCA
ACB
CBA
2
3
2 3
2
k1
k2
k3
R1
R2
R3
Track discrete (i.e., integer) quantities of molecular types.
S1 = [5, 5, 5]
S2 = [4, 7, 4]R1 R2 R3
S3 = [2, 6, 7]
S4 = [1, 8, 6]
Discrete KineticsDiscrete Kinetics
State [A, B, C]
Stochastic KineticsStochastic Kinetics
The probability that a given reaction is the next to fire is proportional to:
• Its rate constant (i.e., its ki).
• The quantities of its reactants.BCA
ACB
CBA
2
3
2 3
2
k1
k2
k3
R1
R2
R3
See D. Gillespie, “Stochastic Chemical Kinetics”, 2006.
Stochastic KineticsStochastic Kinetics
Choose the next reaction according to:
jj
iiR
)Pr(
Ri kXnXn 2211
let
2
2
1
1
n
X
n
Xki
For each reaction
Stochastic KineticsStochastic Kinetics
[1, 1, 9] [1, 5, 4] [4, 4, 0] [4, 0, 5]
[2, 2, 6] [2, 6, 1] [5, 1, 2]
p1p2
p3
p4p5
p6p7 p8 p9
[3, 3, 3]start
[1, 1, 9] [1, 5, 4] [4, 4, 0] [4, 0, 5]
[2, 2, 6] [2, 6, 1] [5, 1, 2]
p1p2
p3
p4p5
p6p7 p8 p9
[3, 3, 3]start
[4, 0, 5]
Probabilistic Lattice
Designing SystemsDesigning Systems
Stochastic and Deterministic
Modular SchemeModular Scheme
Module
inputs outputs
QuantitiesQuantities/
Probabilities
Modular SchemeModular Scheme
Module Module
Module
Module
DeterministicDeterministic
Module
inputs outputs
Quantities Quantities
Functional ModulesFunctional Modules
• Subtraction
Subtraction
y
xy
Functional ModulesFunctional Modules
• Subtraction• Fan-out
Fan-outx
y2
y1
yn
Functional ModulesFunctional Modules
• Subtraction• Fan-out• Linear Scaling
Linearx y
Functional ModulesFunctional Modules
• Subtraction• Fan-out• Linear Scaling• Multiplication Multiply
z
xy
Functional ModulesFunctional Modules
• Subtraction• Fan-out• Linear Scaling• Multiplication• Exponentiation
Expx y
Functional ModulesFunctional Modules
• Subtraction• Fan-out• Linear Scaling• Multiplication• Exponentiation• Logarithmic
Logx y
Functional ModulesFunctional Modules
• Subtraction• Fan-out• Linear Scaling• Multiplication• Exponentiation• Logarithmic• Power
Power
p
xy
Functional ModulesFunctional Modules
• Subtraction• Fan-out• Linear Scaling• Multiplication• Exponentiation• Logarithmic• Power• Isolation
Isolationy
Composing ModulesComposing Modules
• Leading module must complete– Modules starting prematurely yield poor results– Rate separation between modules– Rate separation multiplies as modules are chained
• Module Locking– All modules can operate at similar pace– Subsequent modules locked– Key is generated when a module finishes– Key is required by ‘leading’ reaction of module
Module LockingModule Locking
Mult
Mult
Linear
Locking within a ModuleLocking within a Module
• Multi-reaction modules often loop• Most loops have 4 stages
– Initiate– Calculate– Terminate– Reset
• Keys must be destroyed at end of stage• Initiate creates Loop type
– very much like a key– Terminate destroys
Locking within a ModuleLocking within a Module
Log
Initiate Calculate
Reset Terminate
Locking within a ModuleLocking within a Module
Log
Initiate Calculate
Reset Terminate
Locking within a ModuleLocking within a Module
Log
Initiate Calculate
Reset Terminate
Locking within a ModuleLocking within a Module
Log
Initially 4 2 = Log2(4)
Stochastic ModuleStochastic Module
StochasticModule
Prob. 0.2 Prob. 0.8 Choose between multiple outcomes
Functions:• Choice is made in one reaction• Choice is quickly reinforced• Outputs are produced
Features:• PDF set by quantities of types• Any number of outcomes• Arbitrarily low error
Basic DesignBasic Design
• Initialize – Make the choice• Reinforce – Push forward with choice• Stabilize – Remove possibility of ‘contamination’
– Prevent subsequent ‘choices’• Purify – Remove contamination• Work – Do what was ‘chosen’
Initializing Reactions
Reinforcing Reactions
Stabilizing
Purifying
Working Reactions
where
Inside the Stochastic ModuleInside the Stochastic Module
ik
i dei i :
ik
ii dedi i 2:'
ik
ji dedij i''
:
iik
ii odfdi i ''''
:
''''''''''ijijiii kkkkk
'''
: ikji ddij
Initializing Reactions
Inside the Stochastic ModuleInside the Stochastic Module
For all i, to obtain di with probability pi, select E1, E2,…, En
according to:
j jj
iii kE
kEp
Use as appropriate in working reactions:
(where Ei is quantity of ei)
iik
ii odfdi i ''''
:
ik
i dei i :
Error AnalysisError Analysis
Let
for three outcomes (i.e., i, j = 1,2,3).
Require
Performed 100,000 trials of Monte Carlo.
2'''''''''' ,,1 ijijiii kkkkk
''''''''''ijijiii kkkkk
Locked Stochastic ModuleLocked Stochastic Module
• Lock Initializing reactions– All require the same key– Key generated by keysmith– Keysmith generated slowly
• Replace Purifying reactions– Destroy keysmith in presence of d– Preventative reactions instead– Linear growth rather than quadratic
Locked Stochastic ModuleLocked Stochastic Module
An ounce of prevention…
…worth a pound of cure.
Functional ProbabilitiesFunctional Probabilities
Make choices based on inputs
StochasticModule
Prob. 0.2 Prob. 0.8
DeterministicModule
Using IP/LPUsing IP/LP
• IP and LP solvers require– Set of constraints (inequalities)– An expression
• Solve for set of inputs– Meets constraints– Minimizes or maximizes expression
• Rewrite our problems in the form required
LP/IP TricksLP/IP Tricks
• Replace equality statements– Rounding errors break equality– Add error term– Minimize the error term
• Require a at least one molecule– Prevents solutions from devolving to zero
Sample the Input SpaceSample the Input Space
• Number/location arbitrary• More points
– More accurate fit– More time calculating
• User defines desired IO– Table of points– Set of inputs– Desired output PDF at
inputs
X1
X2
Solve each pointSolve each point
• Space is quantities of e• Solution is a ray• Solve minimal magnitude• Outside unit hyper-sphere
e2
e3
e1
Bringing Points TogetherBringing Points Together
• Pick a function– Solve for coefficients
• Scale point solutions• Minimize difference• Minimize coefficients
x
e
IP/LP ComputationIP/LP Computation
• Value space is whole number sets, requires IP• IP is NP-hard, LP is in P• Scales solutions are also solutions• Tricks
– Solve points with LP, bring together with IP– Solve coefficients with LP, scale solution
• Use IP to scale optimally (weigh scaling, error)• Scale by hand
Past Future workPast Future work
• 2 year Hiatus• Jiang / Riedel DSP• Builds on this work
– Fan-out– Addition– Linear Scaling
• Adds Clock and Delay Module
Asynchronous ClockAsynchronous Clock
• Clock– 3 phase– Asynchronous– Uses a locking mechanism
• Delay– Each delay locks clock– Keeps clock in a phase– Allows clock to proceed when phase completes
Clock Delay MechanismClock Delay Mechanism
Delay ElementDelay Element
• Extension of system– Shows strength of modular design
• Elegant asynchronous clock design• Possible improvement for intra-module locking
– Previous design – modified inter-module lock– Likely need more than 3 phases
• 4 phases – two calculating, two resetting• 6 phases – three of each
– Local/global clock
Questions?Questions?