A novel theoretical framework for simultaneous measurement of excitatory and inhibitory conductances

The firing of neurons throughout the brain is determined by the precise relations between excitatory and inhibitory inputs, and disruption of their balance underlies many psychiatric diseases. Whether or not these inputs covary over time or between repeated stimuli remains unclear due to the lack of experimental methods for measuring both inputs simultaneously. We developed a new analytical framework for instantaneous and simultaneous measurements of both the excitatory and inhibitory neuronal inputs during a single trial under current clamp recording. This can be achieved by injecting a current composed of two high frequency sinusoidal components followed by analytical extraction of the conductances. We demonstrate the ability of this method to measure both inputs in a single trial under realistic recording constraints and from morphologically realistic CA1 pyramidal model cells. Future experimental implementation of our new method will facilitate the understanding of fundamental questions about the health and disease of the nervous system.


Author summary
Most neurons in the brain receive synaptic inputs from both excitatory and inhibitory neurons. Together, these inputs determine neuronal activity: excitatory synapses shift the electrical potential across the membrane towards the threshold for generation of action potentials, whereas inhibitory synapses lower this potential away from the threshold. Action potentials are the rapid electrochemical signals that transmit information to other neurons and they are critical for the information processing abilities of the brain.
Although there are many ways to measure either excitatory or inhibitory inputs, these methods have been unable to measure both at the same time. Measuring both inputs together is essential towards understanding how neurons integrate information. We developed a new analytical method to measure excitatory and inhibitory inputs at the same time from the voltage response to injection of an alternating current into a neuron. We describe the foundation of this new method and find that it works in biologically Introduction Neuronal firing is orchestrated by the interplay of excitatory and inhibitory inputs. Therefore, studying their relationship has been crucial to solving fundamental questions in cellular and system neuroscience. Disrupted relations between these inputs were suggested to accompany many neurological diseases and in particular epileptic seizures. It is commonly believed that such seizures are accompanied and even caused by a disruption of excitation-inhibition ratio and their temporal relationships [1][2][3].
The most widely used method to measure inhibitory and excitatory inputs in isolation is the voltage clamp technique. To reveal excitatory synaptic currents the membrane potential is voltage clamped near the reversal potential of inhibition (near -80 mV) and inhibitory synaptic currents are revealed when the voltage is clamped near the excitatory reversal potential (near 0 mV). Voltage clamp recordings have been used in this manner to study mechanisms of feature selectivity of cortical cells belonging to various modalities [4][5][6][7][8][9][10][11][12][13]. Current clamp recordings also allow for the isolation of excitatory and inhibitory conductances, which is done by injecting constant positive or negative currents which bring the membrane potential near the reversal potential of these two input types [8][9][10][14][15][16][17][18].
Voltage and current clamp approaches share several similarities. In both cases, excitation and inhibition are recorded in different trials and conductances are estimated by fitting the averaged data with the membrane potential equation (Eq 1 below). Hence, these methods provide only an average picture and thus fail to capture the instantaneous and trial-by-trial based insight into the relations between excitation and inhibition.
The instantaneous relation between excitation and inhibition in-vivo was revealed using a different approach, relying on the finding that the membrane potential of nearby cortical cells in anesthetized animals is highly synchronized [19,20]. This approach consists of depolarizing one cell to reveal its inhibitory inputs while simultaneously hyperpolarizing a neighboring cell to reveal its excitatory inputs. Doing this showed that excitatory and inhibitory synaptic inputs are highly correlated in anesthetized and awake rodents [21,22] and was used to study the degree of correlation during oscillatory neuronal activities [23]. However, this approach depends on making the recordings from highly correlated cells, mostly observed in deeply anesthetized animals. Methods for estimation of excitatory and inhibitory inputs of a single cell during single trials were previously developed [24][25][26][27][28]. However, these methods make significant assumptions about the dynamics and statistics of the inputs. Importantly, all these methods rely on the occurrence of membrane potential fluctuations when estimating excitatory and inhibitory conductances. Clearly, changes in conductance sometimes are not accompanied by any change in membrane potential, as expected when a cell receives tonic shunting synaptic input with a reversal potential near the resting potential of the cell.
We describe a new theoretical framework for simultaneously measuring both excitatory and inhibitory conductances under current clamp in a single trial with high temporal resolution, without making statistical assumptions about the inputs. It is based on frequency analysis of the response of neurons when injected with a current composed of two sinusoidal components and allows measuring both the excitatory and inhibitory conductances simultaneously with membrane potential as a function of time. We demonstrate this method in-silico using simulations of a point neuron receiving excitatory and inhibitory synaptic inputs as well as in a realistic pyramidal cell model when synapses are distributed further away from the soma. Finally, we describe the limitations of this approach in whole cell patch clamp recordings obtained using contemporary intracellular amplifiers.

Transformation of membrane potential and total conductance to E and I conductances
We sought to develop a method that provides a way to simultaneously measure the excitatory and inhibitory conductances in a single trial with high temporal resolution during current clamp recording. We begin with the membrane Eq 1 for passive synaptic inputs of a point neuron, which can be rearranged to isolate the excitatory and inhibitory conductances as shown in Eq 2. Replacing , V i (t) respectively and assuming that the total conductance equals the sum of the inhibitory and excitatory conductance g s (t) = g i (t) +g e (t) we get: Eq (2) shows that the two inputs can be isolated if the following parameters are known: V (t), membrane voltage; g l , leak conductance; g s (t), total synaptic conductance; V l , V e , V i , equilibrium potentials of the individual conductances; C, membrane capacitance; I, stimulus current.  Simulation of correlated excitatory (green) and inhibitory (red) synaptic inputs (inhibition delayed by 4 ms after excitation), which depressed according to a mathematical description of short-term synaptic depression (STD, Markram and Tsodyks, 1997). These are the inputs the method aims to reveal. B. Membrane potential simulation of a passive point neuron (R = 300MΩ, C = 0.15nF, Euler method, dt = 0.0005s) receiving the inputs in A, with the total conductance shown below. We assume that these two vectors are measurable. A short test current pulse was injected at the early part of the trace. C The result of transforming V(t), its derivative (not shown) and the total synaptic conductance into g e and g i using Eqs (1 and 2).
https://doi.org/10.1371/journal.pcbi.1009725.g001 are indeed known. We demonstrate this transformation by showing depressing excitatory and inhibitory inputs as well as a step change in conductance. However, it works for any type and dynamic of excitatory and inhibitory inputs.
How do we find these parameters under experimental conditions? The equilibrium potentials are generally assumed to be known and determined from intracellular and extracellular ion concentrations. The leak conductance and membrane capacitance can be measured when injecting hyperpolarizing current steps. The voltage is also easy to resolve during the current clamp. However, developing a method to record the membrane potential and at the same time also measure the conductance at each time point has been challenging. As we describe below, we can theoretically estimate the total conductance of the cell by measuring the voltage response during injection of a current composed of two high-frequency sinusoidal components. We start with impedance analysis of passive circuits representing a simplified point neuron with a patch clamp pipette and describing the relationships between the impedance and cell conductance.

Impedance-conductance relationship in a passive point neuron
To develop a method that can be practically used for whole cell patch recordings, we included the resistance of the patch pipette in our analysis. As shown below, the resistance of the electrode affects the measurement of the cell's impedance and thus cannot be ignored. We analyzed in the frequency domain the impedance of a circuit composed of a recording electrode (R s ) and a simplified point neuron (composed of a conductance, g(t) (equal to g l +g e (t)+g i (t)) and a capacitor, C). The impedance of this circuit is given by Eq 3 (w = 2πf, j is the imaginary unit and f is the frequency in Hertz). The cell conductance (g(t)) and the pipette resistance (R s (t) can vary over time, and so consequently also the impedance of the circuit (Z(t)).
Fig 2 illustrates the relationships between the impedance and g for various frequencies (for constant values). It also shows that in the presence of R s , impedance-frequency curves intersect each other as frequency increases, resulting in a positive relationship between circuit impedance and g for a large range of g (compare Fig 2A and 2C). The presence of R s also keeps the phase almost constant for different frequencies and g values Fig 2D). Thus the electrode resistance has a prominent effect on the total impedance of this circuit and should not be ignored when injecting high frequency sinusoidal current into cells.

The in-silico experiment
In the next sections, we show the response of a point neuron to an injection of a current ( Fig  3D) composed of two sinusoidal components (Eq (4), w 1 = 2πf 1 , w 2 = 2πf 2 ): can be used to measure changes in excitatory and inhibitory conductances imposed on the model ( Fig 2B) in a single trial. Although the voltage response in our simulation fluctuates across a large range of more than 35mV (Fig 3C), most of the drop of voltage occurs on the electrode resistor, as seen when we set R s to zero (Fig 3E). Due to the low-pass filtering of the input by the passive properties of the cell when injecting high frequency sinusoidal current, the fluctuations of the voltage across the membrane itself are extremely attenuated, resulting in less than 6mV peak to peak amplitudes. Such small fluctuations are unlikely to recruit any voltage-gated intrinsic current. Note that the value of the electrode resistance accounts for both the pipette and access resistance. In our our simulation we set the electrode resistance to 30MΩ, which is higher than for the typical access resistance in in-vitro recordings, but well within the range of in-vivo recordings [29]. The current and the voltage are used to calculate all the passive properties of the simulated cell in a single trial (i.e., R s (t), g(t) and C). The computations are all analytical and approximation is done only when estimating the cell's capacitance as shown below. As described above, estimating the cell's conductance allows us to measure the excitatory and inhibitory conductances.

Measurement of the cell's total conductance
The first step towards measuring the cell's excitatory and inhibitory conductances using injection of sinusoidal currents is to measure its total capacitance. The cell's capacitance is usually estimated from the response to a step current. Other methods for such estimation are also available, such as using a short pulse [30,31] and variance analysis of the response to injection of noise [32]. Here we show that a cell"s capacitance can be well estimated from the response to either one of the two frequencies composing the sinusoidal current (Eq (4)). We rely on the assumption that when the frequency of the current is high (w � C >> g(t) 2 ), we can neglect g (t) 2 in the denominators of the second and third terms in Eq 3. Hence, at such frequencies the electrode resistance (R s ) is relatively larger than the second term, and thus the second term can be neglected. In this case, the total impedance of the circuit is mostly determined by the electrode resistance and the capacitance of the cell, as the latter draws most of the sinusoidal current that is injected into the cell. Here we ignore any stray capacitance in the recording system, such as of the recording pipette, but below we show that this capacitance can be partially compensated offline. The capacitance of the cell can be estimated from the voltage amplitude and phase relationship between the voltage and the current. These relationships can be approximated by Eq (5) (see also the phase curves in Fig 2D) obtained from Eq 3 when w � C>>g.
For such an estimation to be valid (i.e., deriving Eq (5) from (3)), the frequency of each one of the two current components has to be sufficiently high. For example, for a cell with a mean conductance of 1/100MΩ and total capacitance of 0.15nF, recorded with 10MΩ electrode (R s ), a ratio of~88 between (w � C) 2 and g 2 will be obtained at 100Hz. Since the impedance of the second term in Eq (3) for this example is~1MΩ, much smaller than R s (10MΩ), we neglect this term. Thus, the capacitance can be obtained from Eq (5), if we can estimate the electrode resistance and the phase relationship between the current and the voltage. We do this in a single trial when sinusoidal current is injected, by first measuring the electrode resistance (R s,est ) from the ratio of the absolute values of the fast Fourier Transform (FFT) of the voltage and the current at the frequency of the injected current, after both traces were bandpass filtered at one of the two frequencies (F1 or F2, using 'bandpass' Matlab function, implementing finite impulse response (FIR) filter). Importantly, this calculation is performed for a time window within which no stimulation is delivered (e.g., 1 second before stimulation). The two vectors (FV, FI bandpass filtered voltage and current) are then used to estimate R s . For the measurement of the capacitance we provide a rough estimation of R s , denoted with an asterisk. A more precise estimation of R s is provided later.
The phase between FV and FI is calculated from the Hilbert transform of FV (H operator, either for the F1 or F2) using the 'hilbert' Matlab function and averaging over time: Averaging is performed for the same time window as above, within which no stimulation is delivered (e.g., 1 second before). The trigonometric relationships between the real and imaginary parts in Eq (5) are described in Eq (8), allowing to estimate the cell's total capacitance given that R s and θ est are measured as described in Eqs (6) and (7): In the example shown in Figs 2 and 3, the real capacitance was set to 0.15nF and was estimated as 0.149nF. Note, that estimation of C can also be obtained when setting R s to zero at a similar accuracy.
We then use the estimated capacitance of the cell to measure the cell's conductance and to obtain a more accurate measurement of the electrode resistance, both over time in a single trial. In this computation these values will be measured based on the analytical solution of Eq 3, this time without making any approximations. Here we use the fact that the current contains two sinusoidal components having two different frequencies (F1 and F2, e.g., 210Hz and 315Hz as used in the example). Since Z(f) decreases with increasing frequency (Fig 2), increasing the frequencies, although it allows higher temporal resolution, will reduce the signal to noise ratio in the presence of noise. The voltage and the current are then bandpass filtered at the two frequencies ( Fig 3F-3I, due to screen resolution are displayed as patches of colors). Note the small modulations in the bandpass filtered voltage signals, which are in the order of about 1mV. These modulations result from changes in the cell's conductance during the simulation of the synaptic inputs following the relationships between them as shown in Fig 2. For each bandpass filtered voltage and current trace: FV 1 (t), FV 2 (t), FI 1 (t), FI 2 (t) we computed thehilbert transforms (HFV 1 (t), HFV 2 (t), HFI 1 (t), HFI 2 (t), using the 'hilbert' Matlab function). These complex vectors are then used to calculate the impedance of the cell at the two frequencies over time: The absolute values of these complex vectors, shown in Fig 3J, demonstrate curves with a shape that is similar to that of the total conductance of the cell (leak plus synaptic conductances). Note that when the conductance of the cell is increased during activation of these inputs, the impedance is also elevated. This only happens in the presence of R s , as shown in Fig 2. These two impedance vectors are then used together to solve Eq 3 and obtaining a solution for R s (t) and g(t) (when z 1 6 ¼z 2 , C is the estimated capacitance). To this end we used Mathematica (Wolfram) to solve the two equations for absolute values of z 1 and z 2 ("Solve[Abs (r + 1/(g + I � w1 � c)) = = Abs (z1) && Abs (r + 1/(g + I � w2 � c)) = = Abs (z2), {r, g}]", I = imaginary unit in Mathematica (Wolfram)) which gives the following solutions for R s and g (here Z 1 and Z 2 are complex time dependent vectors, j is the imaginary unit, and C is the estimated capacitance): In Eqs (11) and (12) z 1 , z 2 as well as R s,est (t) are time dependent variables. Identical estimation will be obtained in Eq 12 after replacing w 1 and z 1 with w 2 and z 2 . In Fig 4A, we again plotted the two impedance curves and also included the electrode resistance (R s,est (t)), which is only slightly larger than its real value used in the simulation. The estimated total conductance is plotted in Fig 4C. Note that the estimated total conductance is almost identical in shape and magnitude to the sum of the leak, excitatory and inhibitory conductances used to simulate the membrane potential in this example.

Estimation of the excitatory and inhibitory conductances from cell's conductance and membrane potential
After estimating the total conductance, Eqs (1) and (2) are used to compute the excitatory and inhibitory conductances as discussed above. Since sinusoidal current is injected into the cell (with two frequency components) we bandstop filter around each frequency (+-5Hz) to  Fig 2). B. The membrane potential after filtering out the components at the injected frequencies. C. Measured conductance and electrode resistance (shown in A) were obtained from the absolute impedance curves (Eqs 11, 12) and the estimated capacitance. D. Excitatory and inhibitory conductances were estimated from the cleaned voltage and measured conductance (Eqs 1, 2 obtain a clean version of the membrane potential. Before we use Eqs (1) and (2), we need to calculate the resting membrane potential and its corresponding leak conductance. We do this by finding the mean voltage in the cleaned membrane potential for the lower 5 th percentile of the total conductance vector, which we assume reflects the resting state at which no synaptic inputs are evoked (i.e, g l,est ). The corresponding membrane potential values for this 5th percentile conductance were used to calculate the mean resting potential (V l ). The synaptic conductance is simply given by: g s,est (t) = g est (t)−g l,est (the difference between total conductance and leak conductance). In the transformation presented in Eqs (1) and (2), we assume that the reversal potentials of excitation and inhibition are available to us (i.e., 0mV and -70mV). The capacitance and total conductance are obtained as described above. The results of these computations are shown in Fig 4D. Our calculations revealed that the estimated conductances are almost identical to the real inputs of the simulated cell (compare Figs 3B to 4D). We note that our method allows estimating the conductances even when tonic input exits, as demonstrated in the step change in excitation and inhibition (shown between 3 to 4 seconds). In fact, the Pearson correlation between the real inputs and the estimated inputs for this simulated example were extremely high: 0.999 for excitation and 0.996 for inhibition ( Fig 3E).

Computing the excitatory and inhibitory conductances of a cell embedded in a balanced network
We asked if our approach can be used to reveal the underlying excitatory and inhibitory conductances of a model cortical neuron embedded in an active network where it receives excitatory and inhibitory inputs. Therefore, we used a simulation of a cortical network at a balanced asynchronous state [33] to obtain the excitatory and inhibitory synaptic inputs of a single cell (kindly provided by Dr. Michael Okun, University of Leicester). We used these conductances in a simulation of a single cell, in which we injected a current with two sinusoidal components (210 Hz and 315Hz) via a 50MΩ electrode and measure the response of the cell, before (Fig 5) and after filtering out the two sinusoidal components from the membrane potential ( Fig 5B, black trace, which is superimposed almost perfectly with the one obtained without current injection, blue trace). We then used our computations to estimate the excitatory and inhibitory conductances (Fig 5C and 5D). Note, however, that for both inputs the estimated conductances are more negative than expected. This is simply because the leak conductance was estimated from the 5 th percentile of the total conductance of the cell, but since synaptic activity persisted throughout the trace, the leak conductance reflects a mixture of the true leak conductance and some baseline synaptic activity. Nevertheless, the estimated excitatory and inhibitory synaptic conductances were very similar to those used as inputs (Fig 5E and 5G), and similarly to the real inputs, estimated E and I conductances were highly correlated (Fig 5F). Our approach was also successful in measuring E and I inputs when they are not correlated (Fig 5H and 5J, by shifting the inhibitory input by 10 seconds relative to excitation). Indeed, as expected for this case, no correlation was measured between the measured inputs ( Fig 5I). In summary, our approach allows accurate estimation of excitatory and inhibitory inputs in various conditions without any need to take into account the dynamic and statistical properties of the excitatory and inhibitory inputs.

Measurement of E and I inputs during large variations in access resistance
Changes in access resistance due to incompletely ruptured membrane or other due to movement of the recorded cell and preparation, pressing the pipette onto the membrane, are wellknown limitations of whole cell patch recordings. However, one of the advantages of the approach is in its ability to track changes in the electrode and access resistance and taking them into account when calculating the total conductance of the cell with a high temporal resolution. We demonstrate it by simulating rapid changes in the electrode resistance during the in-silico recordings (Fig 6, identical synaptic inputs to those used in Fig 3). These variations led to a noisy impedance measurement (Fig 6A). However, since we can measure the access resistance over time (R s (t) est ) and total g(t) at the same time (Eqs (11) and (12)), followed by measurement of excitation and inhibition as described in Eq (2), the changes in the electrode resistance had no apparent effect on the ability to accurately estimate the inhibitory and excitatory conductances (Fig 6D and 6E).

Measurement of E and I inputs in the presence of realistic noise
Next we asked how sensitive our measurements are in the presence of realistic noise. Therefore, we used a typical patch electrode to record a voltage trace in a slice setup when positioning the electrode outside a neuron (kindly provided by Dr. Alexander Binshtok, Hebrew University). We then added this noise to our simulated voltage prior to the measurement of excitation and inhibition (Fig 7). A sample of the voltage in the absence of sinusoidal current injection is shown in the inset of Fig 7A (voltage scale bar is 0.5 mV). Despite the presence of such noise (standard deviation of 0.04mV), and a concomitantly noisier measurement ( Fig  7D) of excitation and inhibition, their values closely matched those we imposed as inputs in the simulation (Fig 7E).

Compensation for electrode capacitance
In the above computations we assumed that the recordings are made with a pipette of zero capacitance. However, electrode capacitance can greatly affect the measurement using our novel algorithm. Most of the stray capacitance of recording pipettes is formed by the separation of the solution inside vs. outside the glass pipettes. Experimentally, it can be reduced but not eliminated by coating the pipette with hydrophobic material [34]. Pipette capacitance (C p , illustrated in Fig 8) can also be neutralized by the electronic circuit of the intracellular amplifier, using a positive feedback circuit. In our in-silico experiment, we show that C p can greatly affect the measurement, as pipette capacitance draws some of the injected sinusoidal current. As a result, the impedance measurements for the two frequencies (z 1 and z 2 ) are smaller than expected from the cell and R s alone (Fig 8B, Rs is 20MΩ and the curves are well below this value). This, in turn, results in a much higher leak conductance and a completely wrong estimation in the synaptic conductances based on Eqs (11) and (12). Altogether, our estimations can be flawed, leading to negative evoked inhibitory conductance (Fig 8D).
To compensate for the impedance reduction due to the pipette capacitance we estimated Cp and then used this value to correct the measured impedances. Here we show the theoretical admittance (Y, Y = 1/Z) at each of the two frequencies for the equivalent circuit of a cell recorded with a pipette that has stray capacitance, as shown in Fig 8. The second terms in the following Equations depict the admittance of the stray capacitance (Eqs (13)-(15) were derived from the circuit that is presented in Fig 8, G is the cell's total conductance). From these two equations and replacing 1=ðR s þ 1 Gþj�w1�C Þ with Y 1 (and Y 2 ), C p is given by: However, the value of Y and Y 2 are unknown and are those we seek. We found, however, that the second term (Y 1 -Y 2 ) can be neglected as it is much smaller when compared to the value of 1/Z 1 −1/Z 2 . For example, for the parameters used in this simulation, the ratio between the latter and first terms is~200, clearly justifying our next approximation in which we use in the measured impedance curves, as made using Eqs (9) and (10) (shown as measured Z 1 and Z 2 below, both are time dependent).
We then use this estimated value of C p (averaged for a selected time window (e.g., 1S) before the stimulation under the assumption that synaptic inputs are silent during this time) to calculate the estimated impedance of the cell and the electrode alone, as theoretically expected ) which is done by subtracting from the two measured Z curves the C p,est component following rearranging Eqs 13 and 14: The new Z 0 vectors are then used as the inputs as described above in Eqs (11) and (12) and the subsequent process as described above. This approach greatly improved the measurement of  The 'real' inputs in the in-silico experiment and the circuit representing the recording configuration. Note for C p , the parasitic capacitance of the electrode (R s ). B-D. Measurement of the impedance, followed by calculation of the conductance and E and I inputs using the approach described in Figs  3 and 4. E-G. Similar measurements when recalculating the impedance at each frequency using Eqs (13) to (18) to subtract the effect of pipette capacitance.
https://doi.org/10.1371/journal.pcbi.1009725.g008 excitation and inhibition (Fig 8E-8G). Hence, this component in the analysis, which can be switched on and off, can help resolve the analysis of real recordings, where stray capacitance always exists.

Measuring synaptic conductances in morphologically realistic neurons
To assess how our method resolves dendritic conductances, we simulated a morphologically realistic CA1 pyramidal cell [35]. We uniformly distribute 50 inhibitory and 50 excitatory synapses proximal to the soma. We realized that due to current escape of the injected sinusoidal current to the dendrites, the estimated leak conductance is much larger than its actual value. In the case of proximal synaptic inputs, less current is escaping towards the dendrites during activation of these inputs when compared to pre-stimulation conditions. We compensated for this change by dynamically altering the strength of the leak conductance at each time point based on the estimated total synaptic conductance before calculating the excitatory and inhibitory conductances (Eqs (1) and (2)) by using this empirical equation: Such change is equivalent to a dynamic change in the electrotonic length of cells, known to cause space clamp errors [36][37][38]. It shows that for weak proximal synaptic input this function strongly reduces the newly calculated leak conductance (g 0 l (t)) as expected, and that this allows to compensate for the current escape. However, when the synaptic inputs get stronger the function increases the leak, as less current is expected to escape to the dendrites due to the shunting effect of the input.
Although those synapses are on average 129.92μm (±47.83μm SD) away from the soma, our method resolves the excitatory and inhibitory conductances in a single trial at least as well as the voltage clamp measurements do during two separate trials. When the synapses are moved further away, to an intermediate distance of 238.69μm (±39.71μm SD), our method underestimates the conductance to the same extent as voltage clamp (Fig 9B). Under most biological conditions synapses are not constrained to a narrow part of the dendrite. Therefore, we uniformly distributed synapses anywhere on the apical dendritic tree (Fig 9C). This resulted in synapses with an average distance to the soma of 309.92μm (±164.46μm SD). In this case, our method still follows the conductances but underperforms compared to voltage clamp. Because the measurement quality seemed to decrease with distance, we did more simulations to quantify the relationship between somatic distance and recording quality.

Conductance measurements of proximal inputs are stable and reliable
To investigate the relationship between measurement quality and synaptic distance to soma, we simulated a single excitatory and a single inhibitory synapse at the same dendritic segment. As above, we found that we can reliably isolate the conductances when the synapse pair is close to the soma (Fig 10A). At an extremely distal synapse localization, the measurement becomes unreliable. Even the voltage clamp ceases to follow the temporal dynamics. To quantify the extent to which our measurement follows the temporal dynamics of the current we calculated the correlation coefficient between measurement and true conductance. We found that the measurements are very reliable for synapses below 400μm somatic distance (Fig 10C). Above that distance, the measurement quality breaks down abruptly for the excitatory conductance (Fig 10B and 10C).

Discussion
We describe a novel framework to estimate the excitatory and inhibitory synaptic conductances of a neuron under current clamp in a single trial with high temporal resolution while    tracking the trajectory of the membrane potential. We show that the method allows estimating these inputs also in a morphologically realistic model of a neuron. The work described above here is theoretical and lays the foundations for future experimental work. The method is based on the theory of electrical circuit analysis over time when a cell is injected with the sum of two sinusoidal currents. This allows us to measure excitatory and inhibitory conductances and at the same time track the membrane potential.
We demonstrated the method in simulations of a point neuron and in realistic simulations of a pyramidal cell, receiving proximal and uniformly distributed synaptic inputs. For the point neuron, we showed that we could reveal the timing and magnitude of depressing excitatory and inhibitory synaptic inputs with high temporal resolution and accuracy of above 99% (Figs 3 and  4). In another example, we used our method to reveal these inputs during an asynchronous balanced cortical state and showed that excitation and inhibition dynamics can be measured with high accuracy. Importantly, these estimations were obtained from single trials and allowed obtaining the natural dynamics of the membrane potential by filtering out the sinusoidal components of the response to the injected current. Therefore, our method is especially suitable for estimation of excitation and inhibition when these inputs are not locked to stereotypical external or internal events, such as during ongoing activity. We note that when injecting high frequency current (of a couple of hundred Hertz and above), the voltage drops mostly across the recording electrode. Here we tuned the current amplitude to produce a few millivolts sinusoidal fluctuation across the cell membrane, which should have minimal effect on voltage-dependent intrinsic and synaptic conductances when performing recordings in real neurons.

Measurement of average excitatory and inhibitory conductances of single cells:
Excitatory and inhibitory synaptic conductances of a single cell were measured both under voltage clamp or current clamp recordings, focusing in-vivo on the underlying mechanisms of feature selectivity in sensory response of cortical cells and on the role of inhibition in shaping the tuned sensory response of mammalian cortical neurons [6,8,39]. Conductance measurement methods were also used to reveal the underlying excitatory and inhibitory conductances during ongoing Up and Down membrane potential fluctuations, which characterize slow-wave sleep activity [40,41]. The advantages and caveats of these methods were reviewed in [29]. Common to these conductance measurement methods is the requirement to average the data over multiple repeats, triggered on a stereotypical event (such as the time of sensory stimulation or the rising phase of an Up state) and then average trials at different holding potentials. The averaged data is then fitted with the membrane potential equation (assuming that the reversal potentials are known) to reveal the conductance of excitation and inhibition at each time point. However, these methods cannot reveal inhibition and excitation simultaneously in a single trial, and only estimate averaged relationships. Our proposed method, on the other hand, allows for simultaneous measurements during a single trial. Importantly, since there is no need to depolarize or hyperpolarize the cell, our method allows measurement of synaptic conductances at the resting potential of the cell, potentially obtaining measurements of voltage dependent conductances as they progress during the voltage response to the synaptic inputs. We note that our method shares the basic approach for the analysis of point-neurons using the theory of frequency analysis of electrical circuits with capacitance measurements methods [42,43].
An alternative approach for estimating the excitatory and inhibitory conductances of a single cell was demonstrated for retinal ganglion cells [44]. In this study the clamped voltage was alternated between the reversal potential of excitation and inhibition at a rate of 50 Hz and the current was measured at the end of each step. This study revealed strong correlated noise in the strength of both types of synaptic inputs. However, unlike the method proposed here, the underlying conductances are not revealed simultaneously and-due to the clamping-the natural dynamics of the membrane potential is entirely unavailable, preventing examining the role of intrinsic voltage dependent dynamics in the generation of neuronal subthreshold activity.
Single trial measurements of g e (t) and g i (t) under various assumptions on synaptic dynamics. Theoretical and experimental approaches based on the dynamics of excitatory and inhibitory conductances in a single trial were previously proposed. Accordingly, excitation and inhibition are revealed from current clamp recordings in which no current is injected. Approaches based on Bayesian methods which exploit multiple recorded trials were proposed [25] and estimation of these inputs in a single trial were also proposed but lack the ability to track fast changes in these conductances [24]. A group of other computational methods [26][27][28] showed that excitatory and inhibitory conductances could be revealed in a single trial when analysing the membrane potential and its distribution. Common to all these methods is the requirement to observe clear fluctuations in the membrane potential. Our method, however, allows revealing these inputs even if no change in membrane potential due to synaptic input is observed (except for the response to the injected sinusoidal current). Changes in conductance are often expected even when the membrane potential is stable, for example when a cell is receiving tonic input (see the step change in excitation and inhibition in Figs 3 and 4, between 3 to 4 seconds, resulting in a constant membrane potential value) and when a constant balance in excitatory and inhibitory currents exists.
Paired intracellular recordings. The substantial synchrony of the synaptic inputs among nearby cortical cells [19,21,45,46] allows continuous monitoring of both the excitatory and inhibitory activities in the local network during ongoing and evoked activities. A similar approach was also used to study the relationships between these inputs in the visual cortex of awake mice [22] as well as gamma activity in slices [4]. While paired recordings are powerful when examining the relationships between these inputs in the local network, such recordings do not provide definitive information about the inputs of a single cell. Moreover, although the instantaneous relationship between excitatory and inhibitory inputs can be revealed by this paired recording approach, the maximum inferred degree of estimated correlation between excitation and inhibition is bounded by the amount of correlation between the cells for each input, which may change across stimulation conditions or brain-state [47][48][49]. For example, a reduction in the correlation between excitation, as measured in one cell, and inhibition measured in the other cell can truly suggest smaller correlation between these inputs for each cell, but it can also result from a reduction of synchrony between cells, without any change in the degree of correlation between excitation and inhibition of each cell. This caveat of paired recordings prevents us from finding, for example, if cortical activity shifts between balanced and unbalanced states [50,51]. Simultaneous measurement of excitatory and inhibitory conductances of a single cell across states will allow these and other questions to be addressed.

Limitations
Theoretically, increasing the frequency of the sinusoidal waveforms of the injected current in our method improves the temporal precision when measuring synaptic conductances. However, this comes at the expense of sensitivity, which reduces as frequency increases (Eq 3 and Fig 2). In our simulations we limited the frequency of the injected current up to about 350Hz. At this range, our simulations, depicting realistic passive cellular properties and typical sensory evoked conductance will result in a clear modulation in voltage when injecting~1nA sinusoidal current. When bandpass filtering the voltage, the modulation is in the order of only a mV, but is still above the equipment noise.
We show that changes in access resistance due to incompletely ruptured membrane or other factors, such as mechanical vibration causing the membrane to move with respect to the pipette, can be well measured and compensated (Fig 6). Hence our approach can be implemented to estimate excitatory and inhibitory inputs of a cell in these realistic conditions.
Another aspect that might reduce the sensitivity of our method is the presence of pipette stray capacitance. We developed a modular component in the analysis that can be used to correct some of this stray capacitance (Fig 8). Importantly, no additional measurement is needed beyond the injected sine waves, done in a single trial, to measure this stray capacitance and compensate for its effect. Yet, when stray capacitance is much higher than was demonstrated here, this approach fails to provide a good estimation of the synaptic conductance. Hence, special care will still be needed to minimize any stray capacitance as much as possible.
We demonstrate in simulations of morphologically realistic neurons that we can estimate proximal synaptic inputs in a single trial using our approach. Although we underestimated these inputs when compared to simulated voltage-clamp experiments, their shape and relationships were preserved in our measurements if the inputs impinged on dendrites not more distant than 400 μm from the soma of our implementation of a pyramidal cell. Even though this limitation should be considered in real recordings, these data also suggest that the method will provide an adequate assessment of proximal inputs.

Possible application of the method for measurement of non-synaptic intrinsic conductances
Our method can also be used when voltage-dependent conductances evolve naturally, as we can measure these inputs at the resting potential of the cell, as long as the sinusoidal fluctuations across the membrane due to the injected current are small. Such an approach therefore can be used when performing pharmacological tests, such as testing effects of modulators, agonists and antagonists of various ion channels. Due to the ability to measure these inputs in a single trial, the time course of the effects can be studied in rapid time scales while examining the effects of such drugs on both inputs at the same time.
In summary, our theoretical study shows that synaptic and other conductances can be measured at high temporal resolution in a single trial when cells are recorded at their resting potential. More research is needed to find if this approach can be used successfully during physiological recordings from real neurons.

Feasibility of the technique in real recordings
The expected signal to noise ratio, based on the addition of realistic noise (Fig 7) is sufficiently high to measure the excitatory and inhibitory input during in-vitro recordings. However, it is clear that this framework has to be tested in real recordings of neurons. We fully disclose that we made attempts to test the method in real recordings and discovered that in most of our recordings, none shown here, measurements were unsuccessful. Following tests for impulse response of the amplifier, we found that this results from an active feedback circuit in our intracellular amplifiers. We are currently improving the amplifier circuitry and in parallel developing algorithms that will incorporate the frequency response characteristics of these amplifiers.

Simulations
To develop the method we constructed a simple simulation of a single compartment neuron attached to a resistor, simulating the resistance of the recording pipette (R s is the electrode resistance). I m is the injected current and the other variables as shown in Eqs (1) and (2). Also note that the capacitive current is given by: I c = I m −k�(V p −V m )/R s , where V p is the recorded voltage (across the recording the pipette), V m is the voltage across the membrane only I c is stray current. For k = 0 we assume no stray capacitance and for k = 1, capacitance was included. Hence at each time point we calculated (dt is the time step of the simulation): To test the performance of our method in extraction of excitatory and inhibitory conductances, we simulated the response of a cell to a train of synaptic inputs which depress according to the mathematical description of short term synaptic depression (STD, [52]) with τ inact = 0.003S (inactivation time constant) for excitation and τ rec = 0.5S (recovery time constant) for excitation and the same inactivation time constant for inhibition (0.003S) but a longer recovery time constant (τ rec = 1.3S) but exhibiting the same utilization (0.7). The values of the passive properties of the cell and the strengths of synaptic conductances in the simulation were chosen to be at a similar range of experimental data [8,14,15]. Namely, resting input resistance of 150MΩ, total capacitance of 0.15nF and pipette resistance of 30MΩ. Simulations were run using a simple Euler method with a time step of 0.1msfor all point neuron simulations except for Fig 7 (0.025ms).

Morphologically realistic simulations
We used NEURON 7.6.7 [53] in Python 3.7.6 to simulate a CA1 pyramidal cell [35]. We loaded this cell directly into NEURON without changes to the neuron model. 50 inhibitory and 50 excitatory were distributed on parts of the apical tree. The synaptic mechanism was a modified version of the Tsodyks-Markram synapse [52] where we added a synaptic rise time (NEURON mechanism available at https://github.com/danielmk/ENCoI/tree/main/Python/mechs/ tmgexp2syn.mod). The synaptic parameters are detailed in Table 1. Event frequency of both synapses was 10Hz and events were jitter with a Gaussian distribution of 10ms SD.
All measurements were performed at the soma. To simulate an access resistor in current clamp we added a section with a specified resistance between the current clamp point process and the soma. The access resistance was 10MOhm. For the stimulation current we summed two sine waves of 210Hz and 315Hz. The combined sine waves had a peak-to-peak amplitude of 1nA. Voltage clamp was performed in separate simulations with 10MOhm access resistance as during current clamp. While isolating the excitatory current, we clamped at the reversal potential of inhibitory synapses (-75mV). While isolating the inhibitory current, we clamped at the reversal potential of excitatory synapses (0mV). To convert current to conductance, we divided the current by the clamped voltage minus the synaptic reversal potential.
To investigate the relationship between measurement quality and dendritic path distance to soma, we moved a single excitatory and a single inhibitory synapse to the same dendritic section. Sections were chosen by iterating through the list of apical dendrites in steps of 5. The synaptic parameters are detailed in Table 1.
Python simulation results were saved as.m files using SciPy [54]. Simultaneous conductance analysis and plotting were performed in MATLAB.