Models used in Endocannabinoids and Dopamine Balance Basal Ganglia Output, Gorodetski et all. Front Cell Neurosci. 2021 Mar 17;15:639082. doi: 10.3389/fncel.2021.639082.
The model investigates the effect of endocannabinoid mediated plasticity on transmitting striatal, pallidal and subthalamic nucleus inputs.  The model was implemented in the Moose simulation, using the declarative parameter specification moose_nerp, available here: https://github.com/neurord/moose_nerp

The ep model neuron was created using the automatic parameter optimization algorithm Ajustador.
https://github.com/neurord/ajustador, which provides an interface to Moose

The optimization scripts to create the model are here:
https://github.com/neurord/optimization_scripts/tree/master/epopt-all
epOpt_0321.py, epOpt_0327.py, epOpt_0515.py and epOpt_1206.py
and the data used for fitting is here: https://github.com/neurord/waves/tree/master/EPmeasurements

All remaining simulations used the model that fit to 0321

1. Figure 7 shows response to current injection.
   Fig 7A1 and 7B are generated from
       python3 ep/__main__.py

   Fig 7B is generated by processing the simulation output using
    python3 neur_anal.py PSP filename_dir epAP_
    with these parameters: 
    	 param2=[{'_freq': '0','_plas':'0'}]
    	 param3=[{'_inj':'00'},{'_inj':'00.025'},{'_inj':'00.05'},{'_inj':'00.075'},{'_inj':'00.1'},{'_inj':'00.15'},{'_inj':'00.2'}]
    	 start_stim=0.2
    	 end_stim=0.6
    
    Fig 7C is generated from calcium response to action potentials evoked with set of short duration current injections:
    	python3 ep/multisim.py 0 1 'none'
    	The simulations are processed using
    	python3 neur_anal.py PSP filename_dir epAP_
    	with these parameters: 
    	     param2=[{'_freq': '10'},{'_freq': '20'},{'_freq': '40'},{'_freq': '50'}]
    	     param3=[{'_plas':'0','_inj':'0.00'}]
    	     start_stim=1.0
    	     end_stim=1.0
    	where filename_dir is the directory where the simulation output files reside
    	then plot the data in fI
	Fig 7C shows mean calcium for soma, p0b1 and p1b1b1 compartments

2. Figure 8 shows the effect of short term plasticity (STP) on EP firing frequency and phase locking.
   Fig 8A and Fig 8B: change in firing frequency produced by Str or GPe inputs, with and without STP, are produced by:
       python3 ep_net/multisim.py -c GABA -n 15 -syn str -stp 1 -f 20 --ttGPe ep_net/GPe_lognorm_freq18 --ttSTN ep_net/STN_lognorm --ttstr ep_net/SPN_lognorm 
       python3 ep_net/multisim.py -c GABA -n 15 -syn GPe -stp 1 -f 20 --ttGPe ep_net/GPe_lognorm_freq18 --ttSTN ep_net/STN_lognorm --ttstr ep_net/SPN_lognorm 
       python3 ep_net/multisim.py -c GABA -n 15 -syn str -stp 0 -f 20 --ttGPe ep_net/GPe_lognorm_freq18 --ttSTN ep_net/STN_lognorm --ttstr ep_net/SPN_lognorm 
       python3 ep_net/multisim.py -c GABA -n 15 -syn GPe -stp 0 -f 20 --ttGPe ep_net/GPe_lognorm_freq18 --ttSTN ep_net/STN_lognorm --ttstr ep_net/SPN_lognorm 
   Then, process the output files using net_anal.py
   	 in net_anal.py, uncomment the parameters in example 2B
   	 python3 -i net_anal.py
	 Fig 8B is a plot of fft_stim20Hz.txt
	 Fig 8A is a plot of spike_rate_stim20Hz.txt

   Fig 8C the change in PSP amplitude for different frequencies,
   generated by running ep/multisim.py, which has three input parameters
   	     a. current injection
   	     b. whether turn on or off short term plasticity
   	     c. which type of pre-synaptic neuron
   Each of the following will simulate the response to synaptic input at 10,20,40 and 50 hz, for both GPe and striatal inputs
   	python3 ep/multisim.py -15e-12 0 "GPe str"
   	python3 ep/multisim.py -15e-12 1 "GPe str"
   	python3 ep/multisim.py 0 0 "GPe str"
   	python3 ep/multisim.py 0 1 "GPe str"
   data is processed using
   	python3 neur_anal.py PSP filename_dir epPSP_
   	where filename_dir is the directory where the simulation output files reside

3. Figure 9 shows the response to distributed synaptic input
   Fig 9A simulations:
       python3 ep_net/multisim.py -c GABAosc -n 15 -syn non -stp 1 -f 0 --ttGPe ep_net/GPe_InhomPoisson_freq29.3_osc2.0.npz --ttSTN ep_net/STN_InhomPoisson_freq18_osc0.6.npz -ttstr ep_net/str_InhomPoisson_freq4.0_osc0.2.npz 
       python3 ep_net/multisim.py -c POST-HFSosc -n 15 -syn non -stp 1 -f 0 --ttGPe ep_net/GPe_InhomPoisson_freq29.3_osc2.0.npz --ttSTN ep_net/STN_InhomPoisson_freq18_osc0.6.npz -ttstr ep_net/str_InhomPoisson_freq4.0_osc0.2.npz 
       python3 ep_net/multisim.py -c POST-NoDaosc -n 15 -syn non -stp 1 -f 0 --ttGPe ep_net/GPe_InhomPoisson_freq29.3_osc2.0.npz --ttSTN ep_net/STN_InhomPoisson_freq18_osc0.6.npz -ttstr ep_net/str_InhomPoisson_freq4.0_osc0.2.npz 

  Fig 9A & C: data processing
      in net_anal.py, uncomment the parameters in example 2A
      python3 -i net_anal.py

  Fig 9B simulations:
       python3 ep_net/multisim.py -c POST-HFS -n 15 -syn non -stp 1 -f 0 --ttGPe ep_net/GPe_lognorm_freq29 --ttSTN ep_net/STN_lognorm --ttstr ep_net/SPN_lognorm
       python3 ep_net/multisim.py -c GABA -n 15 -syn non -stp 1 -f 0 --ttGPe ep_net/GPe_lognorm_freq29 --ttSTN ep_net/STN_lognorm --ttstr ep_net/SPN_lognorm 
       python3 ep_net/multisim.py -c POST-NoDa -n 15 -syn non -stp 1 -f 0  --ttGPe ep_net/GPe_lognorm_freq29 --ttSTN ep_net/STN_lognorm --ttstr ep_net/SPN_lognorm

  Fig 9B: data processing
      in net_anal.py, uncomment the parameters in example 2B
      python3 -i net_anal.py