# mGluRIII
Latest release: v1.0 (use Latest Release tag on the right side of this page!)

**Overview**

This is a NEURON compartmental model designed to validate experimental data showing that mGluRIII activation reduces proximal and distal inhibition onto CA1 pyramidal cells (PCs) from parvalbumin and somatostatin interneurons (PV- and SST-INs, respectively). The model is implemented using the NEURON software (v8.2.0), developed in Visual Studio Code with Python (v3.10.14), and runs using the 3D morphology of a biocytin filled CA1-PCs previously developed by the Scimemi lab (PMID: 33053337). The spatial distribution of PV- and SST-inputs onto CA1-PCs is set using NRN-EZ (v1.1.7; PMID: 36627356) PV-inputs are located on the soma and <50 µm away from it on apical dendrites. SST-inputs are located at a distance of >200 um away from the soma, on apical dendrites. First, the model aims to reproduce voltage escape errors that occur when performing somatic voltage clamp recordings from CA1-PCs (folder Voltage escape). This is done by introducing a passive conductance along the dendrites, which becomes larger at increasing distance from the soma. To set gpas, we randomly distribute one inhibitory synaptic input along the soma and apical dendrites of the CA1-PC. We measure the attenuation ratio for each event (i.e., local/somatic amplitude), and adjust gpas so that the space dependency of the attenuation ratio matches with the one obtained by using dendritic patch-clamp recordings (PMID: 18552844) and collected in prior computational work (PMID: 30835719). Second, the model is used to set the synaptic weight of inhibitory inputs onto CA1-PCs based on somatic voltage clamp recordings of mIPSCs from CA1-PCs in our own experiments (folder Set I-weight from mIPSC). Third, we reproduce the effect of mGluRIII activation on IPSCs evoked by optogenetic stimulation of PV- and SST-INs (oIPSCs; folders Effect of DHK on PV inhibition and Effect of DHK on SST inhibition). 

**Generate a location file for inhibitory synaptic inputs using NRN-EZ**

Files containing information about the spatial distribution of inhibitory synapses are generated using the software NRN-EZ (https://github.com/scimemia/NRN-EZ). In the NRN-EZ user interface, set the input parameters as follows:

*Left Panel*
- Click on *Browse* to load the morphology file of the CA1-PC (.swc file). 
- Set the output path for the destination folder using the *Set Path* field.
- Set the value of *Run* to 1. This can be changed to a different number when generating multiple simulations with inputs distributed over the same range of distances from the soma.  

*Middle Panel*
- From the drop-down option in the *Module* section select the module entry *Synaptic Input*.
- Assign a name to your module (e.g., IPSC) and set the *Weight* to *Single*. This allows the synaptic weight to be the same for all inputs.
- Set values for the GABA IPSC reversal potential (*E*), rise time (*Tau1*), and exponential decay time (*Tau2*).                        
- Set the input location to *Multiple Uniform* to randomly distribute inputs on the dendrites of the CA1-PC. We used the following *Mean* and *S.D.* values:
- 
**Voltage escape**:
  
  	Segment Number = 0 of Soma
	Mean = 250 µm
	S.D. = 250 µm
These settings allow one input to be located throughout the Apical Dendrite, which extends for ~500 µm from the soma. This requires setting the Location Limits in the *Right Panel* (see below).

**Set I-weight from mIPSCs**:
  
	Segment Number = 0 of Soma
	Mean = 100 µm
	S.D. = 100 µm
These settings allow for recording the current from a single input located within 200 µm of the soma. This requires setting the Location Limits in the *Right Panel* (see below).  

**Effect of DHK on PV inhibition**:
  
	Segment Number = 0 of Soma
	Mean = 30 µm
	S.D. = 20 µm
These settings allow distributing PV-inputs on the soma and <50 µm away from the soma, on the apical dendrite. This requires setting the Location Limits in the *Right Panel* (see below). 

**Effect of DHK on SST inhibition**:
  
	Segment Number = 319 of Apical
	Mean = 0 µm
	S.D. =165 µm 

We calculated the distance of each segment of the apical section from the soma. The *Apical Segment Number* 319, located ~360 µm away from the soma, was set as our reference point to distribute SST-inputs >200 µm from the soma, in the apical dendrite. This simulation requires setting the Location Limits in the *Right Panel* (see below). 

*Right Panel*
- Set the *Location limits* to identify the compartments with inhibitory inputs. In our simulations, we selected the following settings:

**Voltage escape**:
  
Soma, Apical Dendrite

**Set I-weight from mIPSCs**:

Soma, Apical Dendrite

**Effect of DHK on PV inhibition**:

Soma, Apical Dendrite

**Effect of DHK on PV inhibition**:

Apical Dendrite

- Assign a *Tag* to the inputs (e.g., *Inhibitory*), and set the *Onset time* (100 ms), and *Interval* (0 ms). The *Number of inputs* are elected as follows: 

**Voltage escape**:
  
	100 inputs

**Set I-weight from mIPSCs**:
  
	1 input

**Effect of DHK on PV inhibition**:
  
	Ctrl = 40 inputs
	DHK = 30 inputs

**Effect of DHK on SST inhibition**:

	Ctrl = 332 inputs
	DHK = 260 inputs

- Set *Timing* to *Single*.
- Finally, click *Run* in the bottom left panel. This creates a folder called *run_1* within the main simulation folder (e.g.,nrnez_2024_08_01_10_02_01). The *run_1* folder contains all files generated by NRN-EZ, including the synapse location, onset time, weight, a morphology .nrn file and a .mod file that can be used to adjust the biophysical properties of the neuron. An example of the compiled NRN-EZ interface window is shown below:

**Run the NEURON Model Using VS Code**

To run each simulation, follow these steps:
- Open the .ipynb file in VS Code
- In the header of the .ipynb file, set the following variables: 
*output_file_path*: This is the path to the csv output file containing the time course of the mIPSC/oIPSC.
*h.load_file*: This is used to set the path to the “CA1PC.nrn” file, in the *run_1* folder created by NRN-EZ
*syn_loc_file*: This is the path to the .dat file containing the location of inhibitory inputs, created by NRN-EZ in *run_1* (e.g., Inhibitory)
- Click “Run All” from the main toolbar of the VSCode user interface. 
- The code generates an output .csv file (also displayed as a graph) and prints a summary of the amplitude and kinetics of the mIPSCs/oIPSCs. When applicable, experimentally measured amplitude and kinetics values for mIPSCs/oIPSCs are reported as a reference at the end of each code. For the Effect of DHK on PV inhibition and Effect of DHK on SST inhibition the variable called “selected_synapses” represents the number of randomly selected synapses that allow reproducing the experimental oIPSCs in Ctrl or DHK. 

**Contributors**

The model was created by Namit Dwivedi (namitdwivedi08@gmail.com), conceptualized and supervised by Dr. Annalisa Scimemi (scimemia@gmail.com or ascimemi@albany.edu). This work was funded by the NIH grant R56NS129556.

![CA1-PC screenshot](https://github.com/user-attachments/assets/1b8eaded-e214-4a19-8552-1b7e8b3a261e)
