MCB111: Mathematics in Biology (Fall 2020)
final:
The leaky gated channel
A way to study how a neuron behaves is by studying the activity of its different channels (transmembrane proteins) transporting ions in and out the cell. Using patch clamp techniques, investigators can target an individual channel, and measure its current, that is, the number of ions that go through it during a small time interval.
We are going to look at particular type of channel which transports sodium ions . Increased inside the cell typically results in an action potential, and lower corresponds to the neuron being in a resting state.
In a gated channel, the channel has two distinct configurations, open (O) and closed (C). ions go through the channel when the channel is open, but they are stopped outside the cell when the channel is closed. The open/close mechanism can be controlled many different ways, for instance by changes in voltage (voltagegated or voltagesensitive channels), or by binding to a small molecule (the ligand). On the other hand, in a leak channel, the channel is always open.
Here we are going to study a leaky gated channel, that is, a gated channel with defined “open” and “closed” configurations, but such that the channel is somewhat leaky, and that ions can cross even when in the closed state. Mutations showing this phenotype have been found, for instance in this work about calcium channels, “Leaky channels make muscles weak”.
Figure 2. Current observed for a "leaky" gated channel.
Figure 1. Current observed for a "clean" gated channel.
Using a patch clamp, you can measure the current associated with an individual channel. If the channel opens and closes “cleanly”, that is, ions cross the membrane when the channel is open, but do not when the channel is in the closed configuration, then you would record something like what you see in Figure 1, where it is straightforward to identify when the channel is open and when it is closed. On the other hand, if the channel is leaky, that is, even when the channel is closed some ions can cross the cell membrane, then the current will look like what you see in Figure 2, where it is much harder to identify by eye when the channel was open or closed.
Our goal for this final is to infer when a leaky channel is open and closed by looking at the currents measured by patch clamp.
Deadline: Thursday, Dec 12 at 24:00.
The stochastic process
We assume two things

In its closed configuration, the channel is leaky, and allows the transport of some ions, hopefully to a lesser extent than the open channel (otherwise the channel would be completely inefficient regulating the amount of inside the cell).

More than one ion at a time can be transported. If is the rate (instantaneous probability) of transporting one ion, then the rate of transporting ions is given by . Although only a few atoms will be transported at a given time, in principle the number of possible ions is .
According to those assumptions, here are the reactions
where , and are constants. And also,

is the number of ions outside the cell, which we assume it is very large and approximately constant

is the number of ions that go through the channel in .
Thus, the probability of a closed channel opening in a small time interval is given by , the probability of an open channel letting ions through is , etc.
Figure 3. Diagrammatic representation of the leaky channel probabilistic reactions occurring in a small time interval.
Figure 3 describes the different events that can happen in a small time . We assume that only one of the possible changes can happen during .
The quantity ( in Figure 3) represents the current number of ions inside the cell that have gone through the ion channel after time . If we use to refer to the number of ions that cross the channel from to , then,

Write the probabilities associated to each of the actions (arrows) in Figure 3.

Write the master equations describing the probabilities of the channel being open () or closed () and having ions inside the cell at time , as a function of the distributions at time .

Often patch recodings measure the total flux in/out the cell through all channel. Assuming all channels are identical, that would give us a recording of the continuous time solution.
Write the continuoustime change of the above distributions
which can be derived directly from the master equations.
Hint: remember that for , then .
Inference of the state of the channel
Another way of representing the system is as given in Figure 4.
Figure 4. Graphical representation of the leakygated channel probabilistic model. At time ti, the channel is at state Si = (O, C), and ni ions come through the channel. Each arrow corresponds to a probability with a unique correspondence to those in Figure 3.
At each time point , there are two random variables: representing whether the channel is open or closed and measuring the number of ions that entered the neuron through that channel.
In the actual experiment, you measure the current, that is, the number of ions that went through in that , but you don’t know if the channel is open or closed (but still leaking ions inside the cell). At each time point, the state of the channel is unknown (a hidden variable).
The results of one experiment are given in file file1. This file includes a list of 400 rows, each with two values: the first column is the time, and the second is the number of ions that entered the cell through the single channel. The time interval is ms.

Write the equations that describe the forward and backward algorithms, that calculate the functions
Hint1: Remember to look back at the diagram in Figure 3, in order to figure out how the forward functions and depend on and , and similarly how the backward functions and depend on and .
Hint2: Notice that in the interval only one of the possible actions takes place. Then, if in one a channel changes configuration, it cannot in the same time interval let any ions through, or if it lets some ions through, it cannot in the same change configurations. That results in that for instance, depends on only if at no ions are transported.

Implement the functions to calculate the forward and backward probabilities for every point. In all implementations assume that ms.

Use the forward and backward functions to calculate the points at which the channel transition from open to closed and viceversa.
For this exercise, you can use the following parameters
Estimation of parameters
You only need to answer one of the two options below for full credit. Extra credit if you answer both.
One obvious weakness of the previous approach is that I had to give you the values of the parameters to use. In real life you do not have that information.
With this question, we explore two ways to getting at what the parameter values may be.
 In the first option, you are not given the values of the parameters, but some extra (and still unrealistic) information about the state of the channel, that is, labeled data.
 In the second option, you are all on your own estimating the parameters from the partial data provided by just knowing the number of ions that go through the channel at each time stamp, but not the state of the channel itself.
Option 1: Using labeled data
In this case, labeled data means that in addition to knowing the number of ions that get into the cell, you also know the state of the cell : Open = 1 and Close = 0. In this file2, you can find such data. For each row, there are 4 columns: first is time, second is state of the channel, third is the number of ions that cross, and fourth is the total number of ions up to that time.

First, estimate the and rates.
Hint: One easy thing you can calculate from labeled data are the dwell times for the channel remaining open and closed. And average dwell times have a simple relationship with the rate constants of closing and opening.

Second, once you have estimated the values of and , you can estimate the and rates, by optimizing the probability of the data . That would require that you write down the probability of the data given some the parameters as
Then, look at the posterior probability distributions for the parameters and .
Option 2: By expectationmaximization on unlabeled data
You are given again one file, file3, with just the times and number of molecules that enter at that small interval. You should implement the ExpectationMaximization (EM) algorithm to infer the values of all 4 rate constants.
file3 is similar to file1, just with many more measurements of ion intake, as robust optimization of parameters improves with the amount of data at hand.
Remember that EM requires that you calculate expected counts using the current parameters, and then use the expected counts to calculate the new values of the parameters. In this case, we have 4 parameters, but many possible states of the system, e.g., assuming that we have a training set with measurements:
 Expected number of times the channel goes from
 Expected number of times that an open channel lets one ion in
 Expected number of times that an open channel lets two ions in
and so on…
What can we do with so many terms all involving the one parameter we want to estimate?
Let’s do some marginalization, and consider only 4 cases
 Expected number of times the channel goes from (same as above)
 Expected number of ions that an open channel lets through
And the other two “expectations” are
 Expected number of times the channel goes from
 Expected number of ions that a closed channel lets through
Then, the maximumlikelihood (the maximization step) part of the algorithm that gives you the new estimates of the parameters , , , , are given by
Hint: When proposing initial parameters, remember that all values in Figure 3 have to be probabilities, that is, they cannot take negative values or be larger than one.