From 3eee0bd35015a5bbd2bd7761a1c3f1fce8cedd12 Mon Sep 17 00:00:00 2001 From: Sam Neymotin Date: Tue, 8 May 2018 11:55:52 -0400 Subject: [PATCH] more on the evoked/poisson ampa/nmda updates --- L2_basket.py | 3 +++ L2_pyramidal.py | 6 ++++++ L5_basket.py | 6 ++++-- L5_pyramidal.py | 6 ++++++ paramrw.py | 39 +++++++++++++++++++++++++++------------ params_default.py | 12 ++++++++---- 6 files changed, 54 insertions(+), 18 deletions(-) diff --git a/L2_basket.py b/L2_basket.py index 8870dc99f..be89014ab 100644 --- a/L2_basket.py +++ b/L2_basket.py @@ -159,6 +159,9 @@ def parreceive_ext(self, type, gid, gid_dict, pos_dict, p_ext): # connections depend on location of input - why only for L2 basket and not L5 basket? if p_ext['loc'] is 'proximal': self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_ampa, self.soma_ampa)) + # NEW: note that default/original is 0 nmda weight for the soma (for prox evoked) + self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_nmda, self.soma_nmda)) + elif p_ext['loc'] is 'distal': self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_ampa, self.soma_ampa)) self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_nmda, self.soma_nmda)) diff --git a/L2_pyramidal.py b/L2_pyramidal.py index 76ea76104..ce5d95d42 100644 --- a/L2_pyramidal.py +++ b/L2_pyramidal.py @@ -469,6 +469,12 @@ def parreceive_ext (self, type, gid, gid_dict, pos_dict, p_ext): self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_ampa, self.basal2_ampa)) self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_ampa, self.basal3_ampa)) self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_ampa, self.apicaloblique_ampa)) + + # NEW: note that default/original is 0 nmda weight for these proximal dends + self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_nmda, self.basal2_nmda)) + self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_nmda, self.basal3_nmda)) + self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_nmda, self.apicaloblique_nmda)) + elif p_ext['loc'] is 'distal': self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_ampa, self.apicaltuft_ampa)) self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_nmda, self.apicaltuft_nmda)) diff --git a/L5_basket.py b/L5_basket.py index ed652c9db..b69fe1a70 100644 --- a/L5_basket.py +++ b/L5_basket.py @@ -144,7 +144,7 @@ def parreceive(self, gid, gid_dict, pos_dict, p_ext): # one parreceive function to handle all types of external parreceives # types must be defined explicitly here def parreceive_ext(self, type, gid, gid_dict, pos_dict, p_ext): - if type.startswith(('evprox', 'evdist')): + if type.startswith(('evprox', 'evdist')): # shouldn't this just check for evprox? if self.celltype in p_ext.keys(): gid_ev = gid + gid_dict[type][0] @@ -167,7 +167,9 @@ def parreceive_ext(self, type, gid, gid_dict, pos_dict, p_ext): } self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_ampa, self.soma_ampa)) - #self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_nmda, self.soma_nmda)) + + # NEW: note that default/original is 0 nmda weight for the soma (both prox and distal evoked) + self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_nmda, self.soma_nmda)) elif type == 'extgauss': # gid is this cell's gid diff --git a/L5_pyramidal.py b/L5_pyramidal.py index e0d08fd99..28a31fc9c 100644 --- a/L5_pyramidal.py +++ b/L5_pyramidal.py @@ -570,6 +570,12 @@ def parreceive_ext(self, type, gid, gid_dict, pos_dict, p_ext): self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_ampa, self.basal2_ampa)) self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_ampa, self.basal3_ampa)) self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_ampa, self.apicaloblique_ampa)) + + # NEW: note that default/original is 0 nmda weight for these proximal dends + self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_nmda, self.basal2_nmda)) + self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_nmda, self.basal3_nmda)) + self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_nmda, self.apicaloblique_nmda)) + elif p_ext['loc'] is 'distal': # apical tuft self.ncfrom_ev.append(self.parconnect_from_src(gid_ev, nc_dict_ampa, self.apicaltuft_ampa)) diff --git a/paramrw.py b/paramrw.py index a463aafcf..3a3428602 100644 --- a/paramrw.py +++ b/paramrw.py @@ -566,7 +566,7 @@ def feed_validate(p_ext, d, tstop): # def checkevokedsynkeys (p, nprox, ndist): - # make sure ampa,nmda gbar values are in the param dict (for backwards compatibility) + # make sure ampa,nmda gbar values are in the param dict for evoked inputs(for backwards compatibility) lctprox = ['L2Pyr','L5Pyr','L2Basket','L5Basket'] # evoked distal target cell types lctdist = ['L2Pyr','L5Pyr','L2Basket'] # evoked proximal target cell types lsy = ['ampa','nmda'] # synapse types used in evoked inputs @@ -581,6 +581,19 @@ def checkevokedsynkeys (p, nprox, ndist): if k not in p: p[k] = p['gbar_'+skey+'_'+ct] +# +def checkpoissynkeys (p, nprox, ndist): + # make sure ampa,nmda gbar values are in the param dict for Poisson inputs (for backwards compatibility) + lct = ['L2Pyr','L5Pyr','L2Basket','L5Basket'] # target cell types + lsy = ['ampa','nmda'] # synapse types used in Poisson inputs + for ct in lct: + for sy in lsy: + skey = pref + str(i+1) + k = 'gbar_'+skey+'_'+ct+'_'+sy + # if the synapse-specific weight not present, set it to 0 in p + if k not in p: + p[k] = p['gbar_'+skey+'_'+ct] + # creates the external feed params based on individual simulation params p def create_pext (p, tstop): # indexable py list of param dicts for parallel @@ -645,7 +658,9 @@ def create_pext (p, tstop): nprox, ndist = countEvokedInputs(p) # print('nprox,ndist evoked inputs:', nprox, ndist) - # make sure all evoked synaptic weights present (for backwards compatibility) + # NEW: make sure all evoked synaptic weights present (for backwards compatibility) + # could cause differences between output of param files since some nmda weights should + # be 0 while others > 0 checkevokedsynkeys(p,nprox,ndist) # Create proximal evoked response parameters @@ -685,12 +700,12 @@ def create_pext (p, tstop): # this needs to create many feeds # (amplitude, delay, mu, sigma). ordered this way to preserve compatibility - p_unique['extgauss'] = { # note double weight specification since only use ampa for gauss inputs + p_unique['extgauss'] = { # NEW: note double weight specification since only use ampa for gauss inputs 'stim': 'gaussian', - 'L2_basket': (p['L2Basket_Gauss_A_weight'],p['L2Basket_Gauss_A_weight'], 1., p['L2Basket_Gauss_mu'], p['L2Basket_Gauss_sigma']), - 'L2_pyramidal': (p['L2Pyr_Gauss_A_weight'],p['L2Pyr_Gauss_A_weight'], 0.1, p['L2Pyr_Gauss_mu'], p['L2Pyr_Gauss_sigma']), - 'L5_basket': (p['L5Basket_Gauss_A_weight'],p['L5Basket_Gauss_A_weight'], 1., p['L5Basket_Gauss_mu'], p['L5Basket_Gauss_sigma']), - 'L5_pyramidal': (p['L5Pyr_Gauss_A_weight'],p['L5Pyr_Gauss_A_weight'], 1., p['L5Pyr_Gauss_mu'], p['L5Pyr_Gauss_sigma']), + 'L2_basket':(p['L2Basket_Gauss_A_weight'],p['L2Basket_Gauss_A_weight'],1.,p['L2Basket_Gauss_mu'],p['L2Basket_Gauss_sigma']), + 'L2_pyramidal':(p['L2Pyr_Gauss_A_weight'],p['L2Pyr_Gauss_A_weight'],0.1,p['L2Pyr_Gauss_mu'],p['L2Pyr_Gauss_sigma']), + 'L5_basket':(p['L5Basket_Gauss_A_weight'],p['L5Basket_Gauss_A_weight'],1.,p['L5Basket_Gauss_mu'],p['L5Basket_Gauss_sigma']), + 'L5_pyramidal':(p['L5Pyr_Gauss_A_weight'],p['L5Pyr_Gauss_A_weight'],1.,p['L5Pyr_Gauss_mu'],p['L5Pyr_Gauss_sigma']), 'lamtha': 100., 'prng_seedcore': int(p['prng_seedcore_extgauss']), 'loc': 'proximal', @@ -701,12 +716,12 @@ def create_pext (p, tstop): if p['T_pois'] in (0, -1): p['T_pois'] = tstop # Poisson distributed inputs to proximal - p_unique['extpois'] = {# note double weight specification since only use ampa for poisson inputs + p_unique['extpois'] = {# NEW: setting up AMPA and NMDA for Poisson inputs; why delays differ? 'stim': 'poisson', - 'L2_basket': (p['L2Basket_Pois_A_weight'],p['L2Basket_Pois_A_weight'], 1., p['L2Basket_Pois_lamtha']), - 'L2_pyramidal': (p['L2Pyr_Pois_A_weight'],p['L2Pyr_Pois_A_weight'], 0.1, p['L2Pyr_Pois_lamtha']), - 'L5_basket': (p['L5Basket_Pois_A_weight'],p['L5Basket_Pois_A_weight'], 1., p['L5Basket_Pois_lamtha']), - 'L5_pyramidal': (p['L5Pyr_Pois_A_weight'],p['L5Pyr_Pois_A_weight'], 1., p['L5Pyr_Pois_lamtha']), + 'L2_basket': (p['L2Basket_Pois_A_weight_ampa'],p['L2Basket_Pois_A_weight_nmda'],1.,p['L2Basket_Pois_lamtha']), + 'L2_pyramidal': (p['L2Pyr_Pois_A_weight_ampa'],p['L2Pyr_Pois_A_weight_nmda'], 0.1,p['L2Pyr_Pois_lamtha']), + 'L5_basket': (p['L5Basket_Pois_A_weight_ampa'],p['L5Basket_Pois_A_weight_nmda'],1.,p['L5Basket_Pois_lamtha']), + 'L5_pyramidal': (p['L5Pyr_Pois_A_weight_ampa'],p['L5Pyr_Pois_A_weight_nmda'],1.,p['L5Pyr_Pois_lamtha']), 'lamtha_space': 100., 'prng_seedcore': int(p['prng_seedcore_extpois']), 't_interval': (p['t0_pois'], p['T_pois']), diff --git a/params_default.py b/params_default.py index 37d0eac1a..ed1daa9f0 100644 --- a/params_default.py +++ b/params_default.py @@ -30,28 +30,32 @@ def get_params_default (nprox = 2, ndist = 1): 'L2Basket_Gauss_A_weight': 0., 'L2Basket_Gauss_mu': 2000., 'L2Basket_Gauss_sigma': 3.6, - 'L2Basket_Pois_A_weight': 0., + 'L2Basket_Pois_A_weight_ampa': 0., + 'L2Basket_Pois_A_weight_nmda': 0., 'L2Basket_Pois_lamtha': 0., # L2 Pyr params 'L2Pyr_Gauss_A_weight': 0., 'L2Pyr_Gauss_mu': 2000., 'L2Pyr_Gauss_sigma': 3.6, - 'L2Pyr_Pois_A_weight': 0., + 'L2Pyr_Pois_A_weight_ampa': 0., + 'L2Pyr_Pois_A_weight_nmda': 0., 'L2Pyr_Pois_lamtha': 0., # L5 Pyr params 'L5Pyr_Gauss_A_weight': 0., 'L5Pyr_Gauss_mu': 2000., 'L5Pyr_Gauss_sigma': 4.8, - 'L5Pyr_Pois_A_weight': 0., + 'L5Pyr_Pois_A_weight_ampa': 0., + 'L5Pyr_Pois_A_weight_nmda': 0., 'L5Pyr_Pois_lamtha': 0., # L5 Basket params 'L5Basket_Gauss_A_weight': 0., 'L5Basket_Gauss_mu': 2000., 'L5Basket_Gauss_sigma': 2., - 'L5Basket_Pois_A_weight': 0., + 'L5Basket_Pois_A_weight_ampa': 0., + 'L5Basket_Pois_A_weight_nmda': 0., 'L5Basket_Pois_lamtha': 0., # maximal conductances for all synapses