Debian Codegraph @

examples/frompapers/Stimberg_et_al_2018/example_4_rsmean.py

raw
1 # coding=utf-8
2 """
3 Modeling neuron-glia interactions with the Brian 2 simulator
4 Marcel Stimberg, Dan F. M. Goodman, Romain Brette, Maurizio De Pittà
5 bioRxiv 198366; doi: https://doi.org/10.1101/198366
6
7 Figure 4C: Closed-loop gliotransmission.
8
9 I/O curves in terms average per-spike release vs. rate of stimulation for three
10 synapses: one without gliotransmission, and the other two with open- and close-loop
11 gliotransmssion.
12 """
13 from brian2 import *
14
15 import plot_utils as pu
16
17 set_device('cpp_standalone', directory=None) # Use fast "C++ standalone mode"
18 seed(1929) # to get identical figures for repeated runs
19
20 ################################################################################
21 # Model parameters
22 ################################################################################
23 ### General parameters
24 N_synapses = 100
25 N_astro = 2
26 transient = 15*second
27 duration = transient + 180*second # Total simulation time
28 sim_dt = 1*ms # Integrator/sampling step
29
30 ### Neuron parameters
31
32 # ### Synapse parameters
33 ### Synapse parameters
34 rho_c = 0.005 # Synaptic vesicle-to-extracellular space volume ratio
35 Y_T = 500*mmolar # Total vesicular neurotransmitter concentration
36 Omega_c = 40/second # Neurotransmitter clearance rate
37 U_0__star = 0.6 # Resting synaptic release probability
38 Omega_f = 3.33/second # Synaptic facilitation rate
39 Omega_d = 2.0/second # Synaptic depression rate
40 # --- Presynaptic receptors
41 O_G = 1.5/umolar/second # Agonist binding (activating) rate
42 Omega_G = 0.5/(60*second) # Agonist release (deactivating) rate
43
44 ### Astrocyte parameters
45 # --- Calcium fluxes
46 O_P = 0.9*umolar/second # Maximal Ca^2+ uptake rate by SERCAs
47 K_P = 0.05 * umolar # Ca2+ affinity of SERCAs
48 C_T = 2*umolar # Total cell free Ca^2+ content
49 rho_A = 0.18 # ER-to-cytoplasm volume ratio
50 Omega_C = 6/second # Maximal rate of Ca^2+ release by IP_3Rs
51 Omega_L = 0.1/second # Maximal rate of Ca^2+ leak from the ER
52 # --- IP_3R kinectics
53 d_1 = 0.13*umolar # IP_3 binding affinity
54 d_2 = 1.05*umolar # Ca^2+ inactivation dissociation constant
55 O_2 = 0.2/umolar/second # IP_3R binding rate for Ca^2+ inhibition
56 d_3 = 0.9434*umolar # IP_3 dissociation constant
57 d_5 = 0.08*umolar # Ca^2+ activation dissociation constant
58 # --- IP_3 production
59 # --- Agonist-dependent IP_3 production
60 O_beta = 3.2*umolar/second # Maximal rate of IP_3 production by PLCbeta
61 O_N = 0.3/umolar/second # Agonist binding rate
62 Omega_N = 0.5/second # Maximal inactivation rate
63 K_KC = 0.5*umolar # Ca^2+ affinity of PKC
64 zeta = 10 # Maximal reduction of receptor affinity by PKC
65 # --- Endogenous IP3 production
66 O_delta = 0.6*umolar/second # Maximal rate of IP_3 production by PLCdelta
67 kappa_delta = 1.5* umolar # Inhibition constant of PLC_delta by IP_3
68 K_delta = 0.1*umolar # Ca^2+ affinity of PLCdelta
69 # --- IP_3 degradation
70 Omega_5P = 0.05/second # Maximal rate of IP_3 degradation by IP-5P
71 K_D = 0.7*umolar # Ca^2+ affinity of IP3-3K
72 K_3K = 1.0*umolar # IP_3 affinity of IP_3-3K
73 O_3K = 4.5*umolar/second # Maximal rate of IP_3 degradation by IP_3-3K
74 # --- IP_3 diffusion
75 F_ex = 2.0*umolar/second # Maximal exogenous IP3 flow
76 I_Theta = 0.3*umolar # Threshold gradient for IP_3 diffusion
77 omega_I = 0.05*umolar # Scaling factor of diffusion
78 # --- Gliotransmitter release and time course
79 C_Theta = 0.5*umolar # Ca^2+ threshold for exocytosis
80 Omega_A = 0.6/second # Gliotransmitter recycling rate
81 U_A = 0.6 # Gliotransmitter release probability
82 G_T = 200*mmolar # Total vesicular gliotransmitter concentration
83 rho_e = 6.5e-4 # Astrocytic vesicle-to-extracellular volume ratio
84 Omega_e = 60/second # Gliotransmitter clearance rate
85 alpha = 0.0 # Gliotransmission nature
86
87 ################################################################################
88 # Model definition
89 ################################################################################
90 defaultclock.dt = sim_dt # Set the integration time
91
92 f_vals = np.logspace(-1, 2, N_synapses)*Hz
93 source_neurons = PoissonGroup(N_synapses, rates=f_vals)
94 target_neurons = NeuronGroup(N_synapses, '')
95
96 ### Synapses
97 # Note that the synapse does not actually have any effect on the post-synaptic
98 # target
99 # Also note that for easier plotting we do not use the "event-driven" flag here,
100 # even though the value of u_S and x_S only needs to be updated on the arrival
101 # of a spike
102 synapses_eqs = '''
103 # Neurotransmitter
104 dY_S/dt = -Omega_c * Y_S : mmolar (clock-driven)
105 # Fraction of activated presynaptic receptors
106 dGamma_S/dt = O_G * G_A * (1 - Gamma_S) - Omega_G * Gamma_S : 1 (clock-driven)
107 # Usage of releasable neurotransmitter per single action potential:
108 du_S/dt = -Omega_f * u_S : 1 (event-driven)
109 # Fraction of synaptic neurotransmitter resources available for release:
110 dx_S/dt = Omega_d *(1 - x_S) : 1 (event-driven)
111 r_S : 1 # released synaptic neurotransmitter resources
112 G_A : mmolar # gliotransmitter concentration in the extracellular space
113 '''
114 synapses_action = '''
115 U_0 = (1 - Gamma_S) * U_0__star + alpha * Gamma_S
116 u_S += U_0 * (1 - u_S)
117 r_S = u_S * x_S
118 x_S -= r_S
119 Y_S += rho_c * Y_T * r_S
120 '''
121 synapses = Synapses(source_neurons, target_neurons,
122 model=synapses_eqs, on_pre=synapses_action,
123 method='exact')
124 # We create three synapses per connection: only the first two are modulated by
125 # the astrocyte however. Note that we could also create three synapses per
126 # connection with a single connect call by using connect(j='i', n=3), but this
127 # would create synapses arranged differently (synapses connection pairs
128 # (0, 0), (0, 0), (0, 0), (1, 1), (1, 1), (1, 1), ..., instead of
129 # connections (0, 0), (1, 1), ..., (0, 0), (1, 1), ..., (0, 0), (1, 1), ...)
130 # making the later connection descriptions more complicated.
131 synapses.connect(j='i') # closed-loop modulation
132 synapses.connect(j='i') # open modulation
133 synapses.connect(j='i') # no modulation
134 synapses.x_S = 1.0
135
136 ### Astrocytes
137 # The astrocyte emits gliotransmitter when its Ca^2+ concentration crosses
138 # a threshold
139 astro_eqs = '''
140 # Fraction of activated astrocyte receptors:
141 dGamma_A/dt = O_N * Y_S * (1 - Gamma_A) -
142 Omega_N*(1 + zeta * C/(C + K_KC)) * Gamma_A : 1
143
144 # IP_3 dynamics:
145 dI/dt = J_beta + J_delta - J_3K - J_5P + J_ex : mmolar
146 J_beta = O_beta * Gamma_A : mmolar/second
147 J_delta = O_delta/(1 + I/kappa_delta) *
148 C**2/(C**2 + K_delta**2) : mmolar/second
149 J_3K = O_3K * C**4/(C**4 + K_D**4) * I/(I + K_3K) : mmolar/second
150 J_5P = Omega_5P*I : mmolar/second
151 delta_I_bias = I - I_bias : mmolar
152 J_ex = -F_ex/2*(1 + tanh((abs(delta_I_bias) - I_Theta)/omega_I)) *
153 sign(delta_I_bias) : mmolar/second
154 I_bias : mmolar (constant)
155
156 # Ca^2+-induced Ca^2+ release:
157 dC/dt = (Omega_C * m_inf**3 * h**3 + Omega_L) * (C_T - (1 + rho_A)*C) -
158 O_P * C**2/(C**2 + K_P**2) : mmolar
159 dh/dt = (h_inf - h)/tau_h : 1 # IP3R de-inactivation probability
160 m_inf = I/(I + d_1) * C/(C + d_5) : 1
161 h_inf = Q_2/(Q_2 + C) : 1
162 tau_h = 1/(O_2 * (Q_2 + C)) : second
163 Q_2 = d_2 * (I + d_1)/(I + d_3) : mmolar
164
165 # Fraction of gliotransmitter resources available for release
166 dx_A/dt = Omega_A * (1 - x_A) : 1
167 # gliotransmitter concentration in the extracellular space
168 dG_A/dt = -Omega_e*G_A : mmolar
169 # Neurotransmitter concentration in the extracellular space
170 Y_S : mmolar
171 '''
172 glio_release = '''
173 G_A += rho_e * G_T * U_A * x_A
174 x_A -= U_A * x_A
175 '''
176 astrocyte = NeuronGroup(N_astro*N_synapses, astro_eqs,
177 # The following formulation makes sure that a "spike" is
178 # only triggered at the first threshold crossing
179 threshold='C>C_Theta',
180 refractory='C>C_Theta',
181 # The gliotransmitter release happens when the threshold
182 # is crossed, in Brian terms it can therefore be
183 # considered a "reset"
184 reset=glio_release,
185 method='rk4')
186 astrocyte.h = 0.9
187 astrocyte.x_A = 1.0
188 # Only the second group of N_synapses astrocytes are activated by external stimulation
189 astrocyte.I_bias = (np.r_[np.zeros(N_synapses), np.ones(N_synapses)])*1.0*umolar
190
191 ## Connections
192 ecs_syn_to_astro = Synapses(synapses, astrocyte,
193 'Y_S_post = Y_S_pre : mmolar (summed)')
194 # Connect the first N_synapses synapses--astrocyte pairs
195 ecs_syn_to_astro.connect(j='i if i < N_synapses')
196
197 ecs_astro_to_syn = Synapses(astrocyte, synapses,
198 'G_A_post = G_A_pre : mmolar (summed)')
199 # Connect the first N_synapses astrocytes--pairs
200 # (closed-loop configuration)
201 ecs_astro_to_syn.connect(j='i if i < N_synapses')
202 # Connect the second N_synapses astrocyte--synapses pairs
203 # (open-loop configuration)
204 ecs_astro_to_syn.connect(j='i if i >= N_synapses and i < 2*N_synapses')
205
206 ################################################################################
207 # Monitors
208 ################################################################################
209 syn_mon = StateMonitor(synapses, 'r_S',
210 record=np.arange(N_synapses*(N_astro+1)))
211
212 ################################################################################
213 # Simulation run
214 ################################################################################
215 run(duration, report='text')
216
217 ################################################################################
218 # Analysis and plotting
219 ################################################################################
220 plt.style.use('figures.mplstyle')
221
222 fig, ax = plt.subplots(nrows=4, ncols=1, figsize=(3.07, 3.07*1.33), sharex=False,
223 gridspec_kw={'height_ratios': [1, 3, 3, 3],
224 'top': 0.98, 'bottom': 0.12,
225 'left': 0.22, 'right': 0.93})
226
227 ## Turn off one axis to display accordingly to the other figure in example_4_synrel.py
228 ax[0].axis('off')
229
230 ax[1].errorbar(f_vals/Hz, np.mean(syn_mon.r_S[2*N_synapses:], axis=1),
231 np.std(syn_mon.r_S[2*N_synapses:], axis=1),
232 fmt='o', color='black', lw=0.5)
233 ax[1].set(xlim=(0.08, 100), xscale='log',
234 ylim=(0., 0.7),
235 ylabel=r'$\langle r_S \rangle$')
236 pu.adjust_spines(ax[1], ['left'])
237
238 ax[2].errorbar(f_vals/Hz, np.mean(syn_mon.r_S[N_synapses:2*N_synapses], axis=1),
239 np.std(syn_mon.r_S[N_synapses:2*N_synapses], axis=1),
240 fmt='o', color='C2', lw=0.5)
241 ax[2].set(xlim=(0.08, 100), xscale='log',
242 ylim=(0., 0.2), ylabel=r'$\langle r_S \rangle$')
243 pu.adjust_spines(ax[2], ['left'])
244
245 ax[3].errorbar(f_vals/Hz, np.mean(syn_mon.r_S[:N_synapses], axis=1),
246 np.std(syn_mon.r_S[:N_synapses], axis=1),
247 fmt='o', color='C3', lw=0.5)
248 ax[3].set(xlim=(0.08, 100), xticks=np.logspace(-1, 2, 4), xscale='log',
249 ylim=(0., 0.7), xlabel='input frequency (Hz)',
250 ylabel=r'$\langle r_S \rangle$')
251 ax[3].xaxis.set_major_formatter(ScalarFormatter())
252 pu.adjust_spines(ax[3], ['left', 'bottom'])
253
254 pu.adjust_ylabels(ax, x_offset=-0.2)
255
256 plt.show()