Example #1
0
 def addSegmentSynapse(self, layerDict, dist2sec, distKeys, synList,
                       synType):
     for layer in layerDict:
         for dist in distKeys:
             sec_choice = dist2sec[dist]
             for seg_choice in layerDict[layer][sec_choice]:
                 nmda_flag = 0
                 if self.synvars['type'] == "E2-NMDA2":
                     syn = h.Exp2Syn(sec_choice(seg_choice))
                     nmda = h.Exp2NMDA_Wang(sec_choice(seg_choice))
                     nmda_flag = 1
                 if self.synvars['type'] == "Log_E2Syn":
                     syn = h.Log_E2Syn(sec_choice(seg_choice))
                 if self.synvars['type'] == "Add_E2Syn":
                     syn = h.Add_E2Syn(sec_choice(seg_choice))
                 if self.synvars['type'] == "Mult_E2Syn":
                     syn = h.Mult_E2Syn(sec_choice(seg_choice))
                 if self.synvars['type'] == "E2":
                     syn = h.Exp2Syn(sec_choice(seg_choice))
                 if self.synvars['type'] == "E2_Prob":
                     syn = h.E2_Prob(sec_choice(seg_choice))
                     syn.P = self.synvars['P']
                 if self.synvars['type'] == "E2_STP_Prob":
                     syn = h.E2_STP_Prob(sec_choice(seg_choice))
                 if self.synvars['type'] == "STDPE2":
                     syn = h.STDPE2(sec_choice(seg_choice))
                 if self.synvars['type'] == "STDPE2_Clo":
                     syn = h.STDPE2_Clo(sec_choice(seg_choice))
                 if self.synvars['type'] == "STDPE2_STP":
                     syn = h.STDPE2_STP(sec_choice(seg_choice))
                 if self.synvars['type'] == "STDPE2_Prob":
                     syn = h.STDPE2_Prob(sec_choice(seg_choice))
                     syn.P = self.synvars['P']
                 #initializes different variables depending on synapse
                 if (self.synvars['type'] == "STDPE2_STP") | (
                         self.synvars['type'] == "E2_STP_Prob"):
                     syn.F1 = self.synvars['F1']
                 if (self.synvars['type'] == "STDPE2_Clo") | (
                         self.synvars['type'] == "STDPE2_STP") | (
                             self.synvars['type'] == "STDPE2") | (
                                 self.synvars['type'] == "STDPE2_Prob"):
                     syn.wmax = self.synvars['wmax']
                     syn.wmin = self.synvars['wmin']
                     syn.thresh = self.synvars['thresh']
                 if (self.synvars['type'] == "E2_Prob") | (
                         self.synvars['type'] == "E2_STP_Prob") | (
                             self.synvars['type'] == "STDPE2_STP") | (
                                 self.synvars['type'] == "STDPE2_Prob"):
                     h.use_mcell_ran4(1)
                     syn.seed = self.ranGen.randint(1, 4.295e9)
                 syn.tau1 = 0.5
                 syn.tau2 = 0.6
                 syn.e = 0
                 if nmda_flag == 1:
                     if synType == 'NMDA':
                         synList[layer].append(nmda)
                     else:
                         synList[layer].append(syn)
                 else:
                     synList[layer].append(syn)
def createSyn(synvars,sec_choice,seg_choice):
	if synvars['type'] == "E3_NMDA":
		syn = h.E3_NMDA(sec_choice(seg_choice))
	if synvars['type'] == "E2":	
		syn = h.Exp2Syn(sec_choice(seg_choice))
	if synvars['type'] == "E2_Prob":
		syn = h.E2_Prob(sec_choice(seg_choice))
		syn.P = synvars['P']
	if synvars['type'] == "E2_STP_Prob":
		syn = h.E2_STP_Prob(sec_choice(seg_choice))
	if synvars['type'] == "STDPE2":
		syn = h.STDPE2(sec_choice(seg_choice))
	if synvars['type'] == "STDPE2_Clo":
		syn = h.STDPE2_Clo(sec_choice(seg_choice))	
	if synvars['type'] == "STDPE2_STP"	:
		syn = h.STDPE2_STP(sec_choice(seg_choice))
	if synvars['type'] == "STDPE2_Prob":
		syn = h.STDPE2_Prob(sec_choice(seg_choice))
		syn.P = synvars['P']
	#initializes different variables depending on synapse		
	if (synvars['type'] == "STDPE2_STP")|(synvars['type'] == "E2_STP_Prob"):	
		syn.F1 = synvars['F1']		
	if  (synvars['type'] == "STDPE2_Clo" )|( synvars['type'] == "STDPE2_STP")|( synvars['type'] == "STDPE2")| (synvars['type'] == "STDPE2_Prob"):	
		syn.wmax = synvars['wmax']
		syn.wmin = synvars['wmin']
		syn.thresh = synvars['thresh']
	if  (synvars['type'] == "E2_Prob" )|( synvars['type'] == "E2_STP_Prob")|(synvars['type'] == "STDPE2_STP") | (synvars['type'] == "STDPE2_Prob"):
		h.use_mcell_ran4(1)   		
		syn.seed = self.ranGen.randint(1,4.295e9)
	syn.tau1 = 0.5
	syn.tau2 = 0.6
	syn.e = 0
        
        return syn
Example #3
0
 def addSegmentSynapse(self, layerDict, list, synList, synType, in_param):
     s = 0
     for layer in sorted(layerDict.keys()):
         c = 0
         for sec_choice in list:
             dict = layerDict[layer]
             for seg_choice in dict[sec_choice]:
                 nmda_flag = 0
                 if self.synvars['type'] == "E2-NMDA2":
                     syn = h.Exp2Syn(sec_choice(seg_choice))
                     nmda = h.Exp2NMDA_Wang(sec_choice(seg_choice))
                     nmda_flag = 1
                 if self.synvars['type'] == "E2":
                     if layer == in_param["syn_layer"] and c == in_param[
                             "syn_id"]:
                         print layer, sec_choice, seg_choice
                     c = c + 1
                     syn = h.Exp2Syn(sec_choice(seg_choice))
                 if self.synvars['type'] == "E2_Prob":
                     syn = h.E2_Prob(sec_choice(seg_choice))
                     syn.P = self.synvars['P']
                 if self.synvars['type'] == "E2_STP_Prob":
                     syn = h.E2_STP_Prob(sec_choice(seg_choice))
                 if self.synvars['type'] == "STDPE2":
                     syn = h.STDPE2(sec_choice(seg_choice))
                 if self.synvars['type'] == "STDPE2_Clo":
                     syn = h.STDPE2_Clo(sec_choice(seg_choice))
                 if self.synvars['type'] == "STDPE2_STP":
                     syn = h.STDPE2_STP(sec_choice(seg_choice))
                 if self.synvars['type'] == "STDPE2_Prob":
                     syn = h.STDPE2_Prob(sec_choice(seg_choice))
                     syn.P = self.synvars['P']
                 #initializes different variables depending on synapse
                 if (self.synvars['type'] == "STDPE2_STP") | (
                         self.synvars['type'] == "E2_STP_Prob"):
                     syn.F1 = self.synvars['F1']
                 if (self.synvars['type'] == "STDPE2_Clo") | (
                         self.synvars['type'] == "STDPE2_STP") | (
                             self.synvars['type'] == "STDPE2") | (
                                 self.synvars['type'] == "STDPE2_Prob"):
                     syn.wmax = self.synvars['wmax']
                     syn.wmin = self.synvars['wmin']
                     syn.thresh = self.synvars['thresh']
                 if (self.synvars['type'] == "E2_Prob") | (
                         self.synvars['type'] == "E2_STP_Prob") | (
                             self.synvars['type'] == "STDPE2_STP") | (
                                 self.synvars['type'] == "STDPE2_Prob"):
                     h.use_mcell_ran4(1)
                     syn.seed = self.ranGen.randint(1, 4.295e9)
                 syn.tau1 = 0.5
                 syn.tau2 = 0.6
                 syn.e = 0
                 if nmda_flag == 1:
                     if synType == 'NMDA':
                         synList[layer].append(nmda)
                     else:
                         synList[layer].append(syn)
                 else:
                     synList[layer].append(syn)
         s = s + c
     print "total_synapses = ", s
             record_all=1,
             background=0,
             model_type='C',
             Dt=save_dt) for i in range(50)
]
for gid, stl in enumerate(stls):
    pc.set_gid2node(gid, rank)
    #nc = stl.connect2target(None)
    #pc.cell(gid, stl.nc)

# Set Temperature
h.celsius = 35

# Initialize Random number generator
lowindex = 12344556
h.use_mcell_ran4(1)
h.mcell_ran4_init(lowindex)

#print 'Passive input resistance ',1/((3.14*stls[0].soma.diam**2.)*1e-8*stls[0].soma.gbar_MLI_lkg)/1e6, ' MOhm', stls[0].soma.gbar_MLI_lkg

# stim = h.IClamp(.5, sec=stls[0][1][1].soma)
# stim.amp = -0.015
# stim.dur = 200

[stl.createsyn(npf=1, ngrc=1, record_all=1) for stl in stls]

# vc = h.VClamp(0.5)
# vc.amp[0] = -30
# vc.dur[0] = 200

nc_pf = []