-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnmda_plateaus_d1_x_2.py
88 lines (72 loc) · 2.59 KB
/
nmda_plateaus_d1_x_2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 2 17:50:36 2019
@author: daniel
"""
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 15 17:48:41 2016
@author: daniel
"""
from neuron import h,rxd
import d1msn_2 as msn
#import iMSN
import spillover_experiment as pe
import pickle
import parameters as p
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import json
import scipy.signal as ss
import os, sys, traceback
# --- 1. Create a cell and other useful stuff
dMSN_library = 'D1_71bestFit_updRheob.pkl'
iMSN_library = 'D2_34bestFit_updRheob.pkl'
with open(dMSN_library, 'rb') as f:
model_sets = pickle.load(f, encoding="latin1")
cell_ID = 58
cell_ids = list(model_sets.keys())
for cell_id in cell_ids:
print (" cell id ", cell_id)
variables = model_sets[cell_id]['variables']
# print(variables)
cell = msn.MSN(variables = variables)
for d in p.input_dends:
print (" input dendrite ", d)
cell.dendlist[d].nseg *=5
dend_record_list = [22] #[3,4,9,10,21,22,24,26,35,36,51,52]
dend_stim_list = []#[3,4,9,10,35,36]
plateau_cluster_list = [22]
plateau_cluster_size = np.arange(1,31,1)
vs = []
vspine = []
vd = []
legend = []
max_vs = []
max_vspine = []
max_vd = []
g_nmda = []
i_nmda = []
sns.set(font_scale = 1.0)
sns.set_style('whitegrid')
fig_vs = plt.figure();
fig_vspine = plt.figure();
fig_vd = plt.figure();
ax_vs = fig_vs.add_subplot(111); ax_vs.set_ylabel('Vs (mV)'); ax_vs.set_xlabel('t (ms)')
ax_vspine = fig_vspine.add_subplot(111); ax_vspine.set_ylabel('Vspine (mV)'); ax_vspine.set_xlabel('t (ms)')
ax_vd = fig_vd.add_subplot(111); ax_vd.set_ylabel('Vd (mV)'); ax_vd.set_xlabel('t (ms)')
colors = sns.color_palette("coolwarm", plateau_cluster_size.max())
add_spine = 0
on_spine = 1
cell.insert_spines(plateau_cluster_list, p.cluster_start_pos, p.cluster_end_pos, num_spines = p.plateau_cluster_size_max)
sns.set_style("ticks")
for index_plateau, num_syns in enumerate(plateau_cluster_size):
print (" index_plateau ", index_plateau)
ex = pe.Spillover_Experiment('record_ca', cell)
# ex.insert_synapses('noise_SPN')
# try:
# ex.insert_synapses('my_spillover', plateau_cluster_list, deterministic = 0,
# num_syns = num_syns, add_spine = add_spine, on_spine = on_spine)
# except:
# traceback.print_exc(file=sys.stdout)