for i, gna in enumerate(ais_gna_x):
            for j, l in enumerate(len_x):
                print('na12m:', na12m, '; na16m:', na16m, ';gna:', gna,
                      'pS/um2; len:', l, 'um;')
                cell = nm.NeuronModel(ail=int(l),
                                      na_type=2,
                                      na12_map=na12m,
                                      na16_map=na16m,
                                      aina12=gna,
                                      aina16=gna)
                stim = nm.attach_current_clamp(cell, amp=.7)
                vec = nm.set_recording_vectors(cell)
                nm.simulate()
                nm.save_vec(
                    vec, save_data_path + str(na12m) + str(na16m) + '_gna_' +
                    str(gna) + '_len_' + str(l) + '_')
                nm.show_output(
                    vec, save_figure_path + str(na12m) + str(na16m) + 'gna_' +
                    str(gna) + '_len_' + str(l) + '_')
                bpv_len_sum[i, j], fwv_len_sum[i, j], ___ = nm.cal_velocity(
                    vec, ['ais'])
                cell.dend1 = None
                cell.dend2 = None
                cell.soma = None
                cell.hill = None
                cell.ais = None
                cell.axon = None
                for sec in h.allsec():
                    print(sec)
         file_name = 'type'+str(na_type)\
            +'_aina12_'+str(aina12_x[p])\
            +'_aina16_'+str(aina16_x[p])\
            +'_aik_'+str(aik_x[p])\
            +'_dist_'+str(d)+'_len_'+str(l)+'_v_vec.p'
         print(na_type, p, d, l)
         cell = nm.NeuronModel(hl=int(d),\
                   ail=int(l),\
                na_type=na_type,\
                aina12=aina12_x[p],\
                aina16=aina16_x[p],\
                aik=aik_x[p])
         stim = nm.attach_current_clamp(cell, amp=.7)
         vec = nm.set_recording_vectors(cell)
         nm.simulate()
         nm.save_vec(vec, save_data_path + file_name)
         nm.show_output(vec, save_figure_path + file_name)
         bpv_sum[i, j], fwv_sum[i,
                                j], ___ = nm.cal_velocity(vec, ['ais'])
         cell.dend1 = None
         cell.dend2 = None
         cell.soma = None
         cell.hill = None
         cell.ais = None
         cell.axon = None
         for sec in h.allsec():
             print(sec)
 with open(save_data_path+'type'+str(na_type)\
      +'_aina12_'+str(aina12_x[p])\
      +'_aina16_'+str(aina16_x[p])\
      +'_aik_'+str(aik_x[p])\
示例#3
0
 for j, l in enumerate(len_x):
     print(p, d, l)
     cell = nm.NeuronModel(hl=int(d), \
               ail=int(l), \
            na_type=2, \
            na12_map=1,
            na16_map=1,
            aina12=aina12_x[p],\
            aina16=aina16_x[p],\
            aik=aik_x[p])
     stim = nm.attach_current_clamp(cell, amp=.7)
     vec = nm.set_recording_vectors(cell)
     nm.simulate()
     nm.save_vec(vec, save_data_path\
        +'type2_map1'\
        +'_aina12_'+str(aina12_x[p])\
        +'_aina16_'+str(aina16_x[p])\
        +'_aik_'+str(aik_x[p])\
        +'_dist_'+str(d)+'_len_'+str(l)+'_')
     nm.show_output(vec, save_figure_path\
        +'type2_map1'\
        +'_aina12_'+str(aina12_x[p])\
        +'_aina16_'+str(aina16_x[p])\
        +'_aik_'+str(aik_x[p])\
        +'_dist_'+str(d)+'_len_'+str(l)+'_')
     bpv_sum[i, j], fwv_sum[i, j], ___ = nm.cal_velocity(vec, ['ais'])
     cell.dend1 = None
     cell.dend2 = None
     cell.soma = None
     cell.hill = None
     cell.ais = None
     cell.axon = None
fwv_len_sum = np.zeros([len(hill_gna_x), len(len_x)])
bpv_dist_sum = np.zeros([len(hill_gna_x), len(dist_x)])
fwv_dist_sum = np.zeros([len(hill_gna_x), len(dist_x)])

save_data_path = 'E:/02_AIS/Simulation/AIS/190708/fit_v2/data/hna/'
save_figure_path = 'E:/02_AIS/Simulation/AIS/190708/fit_v2/figure/hna/'

for i, gna in enumerate(hill_gna_x):

    for j, l in enumerate(len_x):
        print('hna:', gna, 'pS/um2; len:', l, 'um;')
        cell = nm.NeuronModel(ail=int(l), na_type=1, hna=gna)
        stim = nm.attach_current_clamp(cell, amp=.7)
        vec = nm.set_recording_vectors(cell)
        nm.simulate()
        nm.save_vec(
            vec, save_data_path + 'hna_' + str(gna) + '_len_' + str(l) + '_')
        nm.show_output(
            vec, save_figure_path + 'hna_' + str(gna) + '_len_' + str(l) + '_')
        bpv_len_sum[i, j], fwv_len_sum[i,
                                       j], ___ = nm.cal_velocity(vec, ['ais'])
        cell.dend1 = None
        cell.dend2 = None
        cell.soma = None
        cell.hill = None
        cell.ais = None
        cell.axon = None
        for sec in h.allsec():
            print(sec)

    for j, d in enumerate(dist_x):
        print('hna:', gna, 'pS/um2; dist:', d, 'um;')
for p in aina_x + [aina]:
    bpv_sum = np.zeros([len(dist_x), len(len_x)])
    fwv_sum = np.zeros([len(dist_x), len(len_x)])
    for i, d in enumerate(dist_x):
        for j, l in enumerate(len_x):
            print(p, d, l)
            cell = nm.NeuronModel(hl=int(d), \
                      ail=int(l), \
                   na_type=1, \
                   aina=p,\
                   aik=aik)
            stim = nm.attach_current_clamp(cell, amp=.7)
            vec = nm.set_recording_vectors(cell)
            nm.simulate()
            nm.save_vec(
                vec, save_data_path + 'aina_' + str(p) + '_aik_' + str(aik) +
                '_dist_' + str(d) + '_len_' + str(l) + '_')
            nm.show_output(
                vec, save_figure_path + 'aina_' + str(p) + '_aik_' + str(aik) +
                '_dist_' + str(d) + '_len_' + str(l) + '_')
            bpv_sum[i, j], fwv_sum[i, j], ___ = nm.cal_velocity(vec, ['ais'])
            cell.dend1 = None
            cell.dend2 = None
            cell.soma = None
            cell.hill = None
            cell.ais = None
            cell.axon = None
            for sec in h.allsec():
                print(sec)
    with open(
            save_data_path + 'aina_' + str(p) + '_aik_' + str(aik) + '_bpv.p',
save_data_path = 'E:/02_AIS/Simulation/AIS/190708/fit_v2/data/aik/'
save_figure_path = 'E:/02_AIS/Simulation/AIS/190708/fit_v2/figure/aik/'
if not os.path.exists(save_data_path):
	os.makedirs(save_data_path)
if not os.path.exists(save_figure_path):
	os.makedirs(save_figure_path)

for i,gk in enumerate(ais_gk_x):
	for j, l in enumerate(len_x):
		print('gk:', gk, 'pS/um2; len:', l,'um;')		
		cell = nm.NeuronModel(ail=int(l), na_type=1, aik=gk)
		stim = nm.attach_current_clamp(cell, amp=.7)
		vec = nm.set_recording_vectors(cell)
		nm.simulate()
		nm.save_vec(vec, save_data_path+'gk_'+str(gk)+'_len_'+str(l)+'_')
		nm.show_output(vec, save_figure_path+'gk_'+str(gk)+'_len_'+str(l)+'_')
		bpv_len_sum[i,j], fwv_len_sum[i,j], ___ = nm.cal_velocity(vec, ['ais'])
		cell.dend1 = None
		cell.dend2 = None
		cell.soma = None
		cell.hill = None
		cell.ais  = None
		cell.axon = None
		for sec in h.allsec():
			print(sec)

	for j, d in enumerate(dist_x):
		print('gk:', gk, 'pS/um2; dist:', d,'um;')		
		cell = nm.NeuronModel(hl=int(d), na_type=1, aik=gk)
		stim = nm.attach_current_clamp(cell, amp=.7)
示例#7
0
        cell = nm.NeuronModel(ail=int(l), \
               na_type=na_type_i, \
#						   na12_map=na12_map_i, \
#						   na16_map=na16_map_i, \
               aina12=aina12_ii, \
               aina16=aina16_i, \
               aik=aik_i,\
               hna=hna_i,\
               hk=hk_i,\
               hl = hl_i,\
               hd = hd_i)
        stim = nm.attach_current_clamp(cell, amp=.7)
        vec = nm.set_recording_vectors(cell)
        nm.simulate()
        nm.save_vec(
            vec, save_data_path + 'aina12_' + str(aina12_ii) + '_dist_' +
            str(hl_i) + '_len_' + str(l) + '_')
        nm.show_output(
            vec, save_figure_path + 'aina12_' + str(aina12_ii) + '_dist_' +
            str(hl_i) + '_len_' + str(l) + '_')
        bpv_len_sum[i, j], fwv_len_sum[i,
                                       j], ___ = nm.cal_velocity(vec, ['ais'])
        cell.dend1 = None
        cell.dend2 = None
        cell.soma = None
        cell.hill = None
        cell.ais = None
        cell.axon = None
        for sec in h.allsec():
            print(sec)