Putting the circuit parts described above together, we can now
give a procedure for converting a Markov model into a description
of a biochemical circuit that performs inference in this model. We have implemented a computer
program (in Python) that, taking advantage of the symmetries in the
circuit's design, generates a description of the circuit in the Kappa
language [1]}, [2]}. Kappa is a rule-based
language describing the direct molecular interactions among proteins
and simulating these interactions stochastically
(Fig. REF ). A rule-based representation is particularly convenient for capturing our circuit,
partly because the circuit consists of proteins that play
distinct roles depending on the configuration of their binding
sites (as in Fig. REF D). While we will focus mainly on
stochastic simulation below, Kappa programs can be automatically converted into a set of
ODEs that can be used for deterministic simulation and approximation of
steady-states (Fig. REF ).In general, a Kappa
program may correspond to an intractably large number of ODEs (due
to combinatorial explosion of species [3]}), but this is not an issue for
our circuit which has a relatively small number of components and
binding sites. The high-level procedure for generating a circuit that
performs inference in a Markov model parameterized by a \(2 \times 2\)  transition matrix \(T\)  is as follows (rate constants omitted for clarity):
