Debian Codegraph @

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