Macroscopic Analysis
From QuB
| Prev: Single Channel Visualizations | Outline | Next: Staircase Analysis |
MAC – Analyzing multichannel data
Data containing the activity of many channels cannot be handled by the single channel routines of QuB. How many is many? About 3-5 depending on the complexity of the model. MIL will efficiently handle multiple identical channels with a two state model and you could probably go up to about 10-15. If you have a three state model you probably don’t won’t to go more than 3- 4 channels. With multiple channels there are many transitions per unit time and the noise increases due to summing open channel noise and the error rate increases. When you have many channels as in whole cell recording or great patches, you need MAC.
MAC was written by Lorin Milescu (Milescu et al., 2005) with modification by Chris Nicolai and John Bannen. The basic idea is to calculate the probability that the current has given amplitude at each time point and optimize the parameters of the model to match the data. In the simplest case, MAC minimizes the sum of squares SSQ. In a more sophisticated version, MAC uses a likelihood LL calculation that uses not only the mean current as SSQ, but the variance about the mean to estimate the single channel current and the number of channels.
A MAC tutorial
MAC is only useful when a stimulus modifies the channel kinetics – otherwise you are looking at a flat line. We will first go through an example using mechanosensitive channels since the unitary current does not change with the magnitude of the stimulus unlike voltage dependent channels. The data file is called Pressure.qdf (postfix means QuB data file). The analysis begins as follows where BLACK commands are taken from the main window including the three resident toolbars at the top left and right, the model window, etc. RED commands are from submenus. A Right click will open command menus.
Left click Mac on the left vertical toolbar to load the screen layout for using MAC.
Download Pressure.zip and extract it, then
File/open data/Pressure.qdf from the directory where you have downloaded it.
Right click IdlStim at the right under Preprocessing. IdlStim serves to remove noise from the stimulus to speed execution. Stimulus idealization is required before using MAC. If you don’t see that command, left click on the Preprocessing bar and left click on IdlStim to include it in the displayed options.
With the IdlStim menu displayed, you will now select the data channel containing the stimulus of interest (it is possible to have multiple stimuli like pressure and voltage and different drugs). In this case select data channel 1; (in QuB the data channels are numbered 0,1,2,… and typically the data to be analyzed is on channel 0) .
In the IdlStim menu under Data source, click Whole file to process the whole file at once. (The meaning of the other entries in the menu are discussed here.)
Click Run. You will see the stimulus, a series of increasing ramps of suction that is blue in the data window, now overlaid with a red trace. The red trace is the idealized stimulus and should look just like the stimulus. You can plot the idealized stimulus above the raw data by clicking on Idl show and Idl above on the top toolbar.
Update: If you have version 1.4.0.132 or newer, use the new Stimulus processor with interactive preview, instead of IdlStim.
Make the model in the Model window. The default model is two states with the black state closed and the red state open carrying a current of 1pA. In this case we need to make at least one rate respond to the stimulus. In the model window Double Left Click on the upper rate to open the rate property menu. k0 is the rate when the stimulus is zero. In this case we guess it might be in the range of 100. k1 is the sensitivity to the stimulus and is described in the QuB rate notation kij=kij0e-kij1Q. What to choose for k1 ? The stimulus Q is in the range of 0 to -40 mmHg. You want to choose a starting value for k1 such that the maximum value of Q times K1 is on the order of 1 so the exponential won’t blow up. Since the channel opens with negative pressure, enter k1 = -0.025, (that is -1/40).
To let QuB know that the stimulus is driving k1 check the box for Q . It may be labeled Voltage as that is the default name, but the function is the same for any other stimulus. You can give the data channels proper names and units in the Data Properties window.
Close the properties window.
Enter the starting probabilities. In this example file we will assume the all the channels start in state 1. Right click on state 1 and left click on Make start state.
Enter the number of channels in Channel count. You generally don’t know the answer, but assuming 1pA/channel you might start with N=5X the peak current in pA. Its best to have enough channels to overshoot the peak current. Click OK. QuB can then solve for the proper number of channels. Since QuB is calculating the rate constants/channel, so to calculate the currents properly you need the number of channels and the unitary current. If either one changes you will still get a solution that satisfies the assumptions. For example, doubling the single channel current will decrease the optimal number of channels by a factor of two. To measure peak current, highlight it and read from the tool-tip.
Right click on Mac Rates on the right under the Modeling commands. The menu has many options but we only need to use a few.
First we have to tell which channel has the stimulus data. In the table at the top of the MAC menu enter 1 under in the row marked Voltage.
In the Estimate submenu clear all checkmarks. This provides a least squares fit to the data using the number of channels and unitary current that you have provided.
In the subpanel Initial Probabilities check the Fixed option. That option lets you set the state at the beginning of the data. In this case we will assume the channels start in state 1 and later set that value in the model window.
In the Optimization submenu there are only two parameters that you will want to play with. Max iter sets the number of times the optimizer will be called when you run MAC. You want to keep this typically in the range of 10-30 with smaller numbers when you are starting so you can see how its going. Enter 10. The Max step sets the largest step that the optimizer can take in a single iteration. Small numbers make the program run slower but bigger numbers can make the solution unstable by overshooting the optimum, especially when changing the stimulus sensitivity that appears in the exponential. The largest useful value is 0.01 and the smallest is 0.0001. In this case enter 0.001 .
The Run mode default of optimize should be checked. The check option evaluates the model without changing the parameters, but in general there is a better tool to compare the model with the data in Mac LiveFit discussed below.
In the Fit data menu just check Show fitting curve and Avg. This shows the fit in the data window.
Check Skip slow changes and set Max std to 0.5. This a data compression feature that greatly speeds fitting and that is important when you begin to fit new data where you don’t know the model. Once the model is roughly working you can uncheck Skip slow changes and allow the program to pay more attention to the slow processes in the data. A larger Max std ignores more of the slowly changing data.
In the Conductance menu you can leave it I= f(Voltage) unchecked for the data in this example file is fixed so the channel current is fixed. To analyze data at different voltages as voltage clamped data you will have to check this box. In that case you will have to specify the reversal potential. Placing the cursor over the entry boxes will bring up a Tip marker with reminders.
Scripts. Leave blank.
Batch submenu. Check Together, the default. This allows you to fig a group of segments as a single file if you want to.
Close
In the Data window we are going to select some data to start with. It speeds up the fit if you can quickly get approximate solutions. Left click on the data trace near the beginning of the stimuli and drag it to the right to select a region containing some of the stimuli.
In the right toolbar under Data source check Sel to indicate that the program will be analyzing the selected data.
To enable the display of the model prediction check at the top toolbar Idl show. If you want to place the model prediction above the data instead of superimposing them check above.
Show the model prediction. At the right toolbar under Modeling check Mac LiveFit.
Click in the blue bar above the Model window to make the model window active.
You can now change the rates interactively and watch the red trace of the model prediction change. You use this to try and get the staring values to look something the data, effectively a simulation. Place the cursor over a rate move the mouse wheel and the numbers will change and so will the simulation. If you want to change the stimulus sensitivity hold down Shift+Ctrl on the keyboard, place the cursor over k1 and move the mouse wheel. If you try this with a big data file the program may not totally interactive. You can check if LiveMac is done with the latest change by looking at the top of the right tool bar at Stop tasks. If it is red the program is busy. If you want to stop the program click a few times on Stop tasks until it becomes black.
In this example make k12=50 and k21=5000 And k112=-0.05. That will make the simulation look something like the data. Now let MAC optimize the model by left clicking on Mac Rates in the right Modeling toolbar. The simulation trace should begin to converge to match the data.
When MAC stops you can click it again to see if the fit improves. You can check the results of the optimization in the Report window and replicated in Results window in a table that can be selected and pasted into text or another spread sheet. The first line MAC final results: shows the LL=log(likelihood) which is the same as the sum of Squares, SS, when using the SSQ optimizer option in MAC. This is followed by two measures of fit that take into account the number of free parameters; AIC is Akaike information Criterion, BIC is the Bayes Information Criteria. When comparing models you want all these measures to minimal. The values themselves have no real value, but changes in these measures for different models can be treated as significant. As with all statistics there are no absolute measures of fit quality, but we typically assume that if one model has a parameter that is 10 counts lower (usually more positive) that the other, that is a significant difference. Below that are the optimized rates with standard deviations std. Below that group global measures of fit are details of the parameter gradients. A good fit has small gradients. Below that is the matrix of means and covariances of the parameters. We rarely examine these details.
Now remove the data compression by right clicking on MAC Rates to open the submenu and then uncheck Skip slow changes and refit by left clicking Mac Rates.
You can get a Printed summary of the data, the model and the results if you have Microsoft Word and Excel installed. In the Results window left click on Report and it will generate a Word document you can see and print.
Milescu, L.S., Akk, G., and Sachs, F. (2005). Maximum likelihood estimation of ion channel kinetics from macroscopic currents. Biophysical Journal 88, 2494-2515.
Other topics
- simulation
- curve fitting
- I-V and Dose-Response
| Prev: Single Channel Visualizations | Outline | Next: Staircase Analysis |


