to simulate ionic currents obtained from whole - cell voltage - clamp recordings , a mex file was written to implement a computational model of voltage - gated currents .
this file contains c++ code to simulate a non - inactivating and an inactivating voltage - gated ionic current based on the hodgkin - huxley model of ionic currents from the squid giant axon ( hodgkin and huxley , 1952 ) .
the equations for non - inactivating and inactivating currents are of the form : 
 inoninact = gmax  nn(vmerev)iinact = gmax  mmh(vmerev)the activation gates n and m and inactivation gate h vary with time and voltage ; these variables represent the probability that an ion channel would be permissive to ion flow at any given instant of time .
the values of these activation gates as functions of time are calculated by the following differential equations : 
 dndt = n(vm)nn(vm)dmdt = m(vm)mm(vm)dhdt = h(vm)hh(vm)dependence upon the membrane potential vm is imparted by the steady - state parameters n(vm ) , m(vm ) and h(vm ) and the time constants n(vm ) , m(vm ) and h(vm ) .
the equations for these parameters are easily accessed in the code and can be modified by the instructor .
constants for the maximal conductance gmax , the reversal potential erev and the number of activation gates n and m are also accessible and can be easily changed .
the instructor can also specify the amount of gaussian noise that is added to the simulated currents .
once the model was implemented and compiled as a mex file , a gui was constructed using the matlab programming environment to provide a straightforward interface for students to simulate voltage - gated currents ( figure 1 ) .
the main graph window displays simulated current traces ( black lines ) and corresponding curve fits ( red lines ) with voltage traces below ; a bounded marquardt - levenberg minimization routine ( press et al . , 1992 )
smaller graph windows along the bottom display peak current amplitudes , steady - state current amplitudes , activation time constants ( 
 ) and inactivation time constants ( 
 ) from curve fits of the simulated current traces as a function of the magnitude or duration of command voltage steps . to introduce concepts required for the design of voltage - clamp experiments
, students are required to select various parameters for the acquisition of whole - cell currents ( figure 1 ) . as with real experiments ,
the duration ( tstep ) and magnitude ( vstep ) of voltage steps in the command voltage waveform can adversely affect the results from the fit algorithm .
voltage steps with durations that are much shorter or much longer than the activation time constants may produce erroneous results : extremely short voltage steps may not elicit enough activating current to obtain an activation time constant ; and extremely long voltage steps may not provide enough data points sampled during the activation time course before the steady - state current is reached .
a control button is provided for users to simulate a single current trace ( simulate one ) with or without a curve fit ( curve fit = yes or no ) during experiment setup ; students can also design voltage - clamp protocols to obtain a sequence of simulated currents for simultaneous analysis ( simulate seq ) .
parameters for these protocols include whether to vary the duration or magnitude of a step during a sequence ( vary type ) ; which voltage step to vary during a sequence ( vary step ) ; and the values of the magnitude or duration during the sequence in the form min : step : max ( sequence ) .
these parameters can be modified to design a tail current protocol to obtain the reversal potential and deactivation time constants of a non - inactivating current ( figure 2 ) , or a two - pulse protocol to examine the recovery of an inactivating current ( figure 3 ) .
initial simulations are performed to determine the minimal number of activation gates ( act gate ) needed to obtain an accurate fit of simulated currents .
in addition , the user must specify which voltage step to obtain curve fits of simulated currents ( measure step ) .
for example , obtaining the inactivation recovery time course ( figure 4 ) requires varying the duration ( vary type = duration ) of the repolarizing step ( vary step = 3 ) while measuring the peak current evoked by the second command step ( measure step = 4 ) .
obtaining the steady - state inactivation ( figure 4 ) requires varying the magnitude ( vary type = level ) of the holding potential ( vary step = 1 ) while measuring the peak current evoked by the command step ( measure step = 2 ) . using this interface ,
students are assigned the task of finding all parameters required to completely model the voltage - dependence and kinetic properties of the simulated currents .
table 1 shows the parameters used to characterize the voltage - dependence and kinetic properties of the hodgkin - huxley squid giant axon k and na currents ; a control button is provided to display curve fit results in the matlab command window ( save data ) that can be exported to a spreadsheet program for further analysis and display . to increase the level of difficulty , an option is provided to simulate non - inactivating currents ( inactivate = no ) or inactivating currents ( inactivate = yes ) .
these options simulate experiments in which one type of current has been pharmacologically isolated ; a third option can be specified in which both current types are evoked simultaneously ( inactivate = both ) .
when both types of current are simulated simultaneously , the user is required to subtract currents evoked from a depolarizing holding potential from currents evoked from a hyperpolarizing holding potential to isolate the inactivating current .
buttons are provided to allow the user to simulate currents evoked from a depolarizing holding potential ( subtract one or subtract seq ) ; these traces will be subtracted from the next set of currents evoked from a hyperpolarizing holding potential ( simulate one or simulate seq ) .
to simulate ionic currents obtained from single - channel recordings , a mex file was written to implement a computational model of stochastic currents .
this file contains c++ code to simulate the random openings and closings of an individual ion channel .
the model consists of various channel states ( c for closed , o for open ) with transition rates between states : 
 c1k21k12c2k32k23kn , n1kn1,nonwhere the transition rates kij provide a stochastic rate constant for a channel in state i at time t to make a transition to state j before time t + t .
it can be shown that the dwell time , or the time spent continuously in state i , is a random variable with an exponential distribution that has a rate constant equal to the sum of all transition rates exiting state i ( colquhoun and hawkes , 1981 ) . in addition , the probability that the next transition will be from state i to state j is equal to the transition rate from state i to state j divided by the sum of all transition rates exiting state i ( colquhoun and hawkes , 1982 ) .
thus , simulated single - channel currents can be obtained by repetitive drawing of random number pairs , one to determine to which state the next transition will be , and the second to determine the dwell time in this state before another transition occurs . as with the whole - cell current model , parameters for the simulated single - channel currents
constants that define the single - channel conductance gsc , the reversal potential erev , the number of states n and the transition rates kij are also accessible and can be easily changed . to increase the level of difficulty
the instructor can also specify the amount of gaussian noise that is added to the simulated currents .
once the model was implemented and compiled as a mex file , a gui was constructed using the matlab programming environment to provide a straightforward interface for students to simulate single - channel currents ( figure 5 ) .
the main graph window displays simulated current traces from all trials from the most recent simulation .
currents from up to ten trials can be displayed simultaneously ; a scroll bar is provided for viewing traces from remaining trials . to detect channel openings , an amplitude histogram of the current traces is constructed and gaussian curve fits are obtained to determine the mean current amplitude for closed and open channels ( solid green lines , lower left graph ) . the threshold for channel openings
is initially calculated to be halfway between the mean closed and open channel current amplitude ( dashed green line , lower left graph ) and can be changed by the user .
regions of the current traces that were detected as channel openings are highlighted in red , and the number of openings and closings is displayed above the main graph window . to prevent erroneously long openings and closings from appearing in the open and closed channel histograms
( lower middle and lower right graphs ) , users can visually inspect the traces to find short openings and closings that were not detected as threshold crossings .
figure 6 shows an example of a brief closing ( middle trace , right ) that was missed by the threshold detection algorithm . because this event was not detected , a dwell time of 15 ms was added to the open time histogram .
however , the user can click on this missed event ( marked by 
 ) , and the 15 ms dwell time is removed from the open time histogram and replaced by two events of 7 ms and 8 ms in duration . as with simulations of whole - cell currents
, students are required to select various parameters for the acquisition and analysis of single - channel currents . for simulating single - channel currents
, the user must provide the duration ( duration ) and number ( trial count ) of trials , in addition to the ligand concentration ( ligand ) , membrane potential ( voltage ) , and whether the rate constants have ligand and/or voltage dependence ( dependence ) .
for analysis of the results , the user must specify the number of exponentials for curve fits of dwell time histograms ( open exp , closed exp ) .
the user can also specify whether to display dwell time histograms on linear axes or on square - root vs. logarithmic axes that produce histogram peaks at the mean dwell times ( colquhoun and sigworth , 1995 ) .
users can also select the cutoff frequency of a low - pass filter for the current traces using a slider control .
as with real experiments , low cutoff frequencies will attenuate fast openings and closings to prevent threshold detection , and high cutoff frequencies will obscure small amplitude openings with unfiltered noise . a control button is provided to simulate the specified number of trials ( simulate ) .
openings and closings for subsequent simulations will be added to the previous results unless model parameters are changed or the reset button is pressed . using this interface , students are assigned the task of finding the rate constants required to completely model the simulated currents , which can be obtained from the amplitudes and time constants of the dwell time histogram curve fits . in addition
, students must plot the magnitude of single - channel currents as a function of membrane potential to obtain the single - channel conductance gsc and the reversal potential erev . to increase the level of difficulty , an option is provided to simulate fixed rate constants ( dependence = none ) , or rate constants that depend on ligand concentration ( dependence = ligand ) , membrane potential ( dependence = voltage ) or both ( dependence = both ) . in the case of rate constants that vary with ligand or membrane potentials
, students must try to identify which rate constants are changing and which remain constant .
students then try to reconstruct the state transition model of the simulated channel using the rate constants obtained from the analysis of the channel openings and closings .
the software described in this paper provides a useful tool to introduce students to experimental techniques used for obtaining biophysical measurements from excitable cells . over the past three years
, we have used this software for a cellular electrophysiology course developed for upper - level undergraduates in bioengineering .
in addition , this software has also been used by a number of non - engineering students from a neurobiology program also enrolled in this course .
the primary role of this software is for the completion of two class projects . in the first project
, students must obtain parameters to completely describe a hodgkin - huxley style model of whole - cell currents ; in the second project , students must obtain parameters to completely describe a stochastic model of single - channel behavior .
these projects could be adapted to various levels of difficulty and effort , such as running a few simulations to obtain the single - channel conductance or the steady - state inactivation , or a complete characterization of non - inactivating and inactivating currents obtained during the same recordings .
although there is no control group for comparison because this software has been used every year the electrophysiology course has been offered , we have found that the students have performed very well in homework and exam questions related to the mechanisms and characterization of electrophysiological phenomena .
such questions include an explanation of why k channel activation time constants must be slower than na channel time constants for a cell to produce an action potential , or an estimation of the minimal number of states needed to explain data from representative single - channel traces without the use of dwell time histograms .
in addition , we have found this software provides a powerful tool for in - class lectures . instead of relying on textbooks and lecture notes ,
we have started using the whole - cell current simulation software to teach students about the hodgkin - huxley model of squid giant axon currents . following these lectures ,
model parameters are changed from the hodgkin - huxley non - inactivating k current and inactivating na current to a non - inactivating ca current ( molitor and manis , 1999 ) and an inactivating k current ( kanold and manis , 1999 ) for class projects .
therefore , students learn the entire process of kinetic characterization for a standard dataset , and then apply this knowledge to a new dataset that had not been encountered previously .
this approach has facilitated student understanding of the modeling process : whereas undergraduates were only able to analyze data from non - inactivating current in previous years , these students are now able to comprehend the kinetic processes and analyze data from inactivating currents as well .
this approach has also improved the ability of students to understand the role of different classes of ion channels , and how these channels contribute to the electrophysiological responses of excitable cells .
similarly , this software has been used for lectures on the analysis and modeling of single - channel currents .
initially , the software is used to present the appearance and characteristics of single - channel currents . after defining transition rates and deriving exponential dwell times using probability theory ,
once the dwell times are obtained from the exponential fits , a kinetic model is constructed to explain the results . following these lectures
, students are assigned a class project in which they obtain transition rates that are either ligand dependent and/or voltage - dependent . as with the analysis and modeling of whole - cell currents ,
the use of this software for a sequence of lectures followed by a class project has facilitated student understanding of theoretical principles and data analysis techniques utilized for the modeling single - channel currents .
 mathematical models of electrophysiological data are used to investigate biophysical mechanisms that underlie electrical excitability . 
 although the resources and time required for obtaining experimental data to create these models may not be available to undergraduates enrolled in a biophysics course , computational tools that simulate cellular or single - channel responses to electrophysiological stimuli can be utilized to provide these data . 
 we have developed two matlab - based simulation packages that are being used in a cellular electrophysiology course for upper - level undergraduate engineering students to demonstrate the design of electrophysiological stimuli , and the analysis and modeling of ionic currents in excitable tissues . 
 the first package simulates a hodgkin - huxley style voltage - gated current elicited during voltage - clamp experiments . 
 users specify the duration and magnitude of a voltage waveform ; the model returns a simulated whole - cell current traces with superimposed noise , and various measurements including peak current , steady state current , and time constants from exponential fits of the current time course . 
 the second package simulates a voltage- or ligand - gated single - channel current as a stochastic process using a state transition matrix . 
 users specify the membrane voltage , ligand concentration , and number of trials ; the model returns simulated single - channel current traces with superimposed noise , and various measurements including amplitude and dwell time histograms . 
 this software has been used during lectures to demonstrate various principles in class , and for class projects in which students derive kinetic models that underlie currents obtained during whole - cell and single - channel recordings . 
 these software packages are freely available and can be downloaded at www.eng.utoledo.edu/smolitor/download.htm . 
WHOLE-CELL CURRENTS
SINGLE-CHANNEL CURRENTS
DISCUSSION