Skip to content

Commit

Permalink
more on the evoked/poisson ampa/nmda updates
Browse files Browse the repository at this point in the history
  • Loading branch information
samnemo committed May 8, 2018
1 parent 317d332 commit 3eee0bd
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 18 deletions.
3 changes: 3 additions & 0 deletions L2_basket.py
Expand Up @@ -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))
Expand Down
6 changes: 6 additions & 0 deletions L2_pyramidal.py
Expand Up @@ -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))
Expand Down
6 changes: 4 additions & 2 deletions L5_basket.py
Expand Up @@ -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]

Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions L5_pyramidal.py
Expand Up @@ -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))
Expand Down
39 changes: 27 additions & 12 deletions paramrw.py
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand All @@ -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']),
Expand Down
12 changes: 8 additions & 4 deletions params_default.py
Expand Up @@ -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
Expand Down

0 comments on commit 3eee0bd

Please sign in to comment.