Debian Codegraph @

examples/frompapers/Stimberg_et_al_2018/example_3_io_synapse.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 3: Modeling of modulation of synaptic release by gliotransmission.
8
9 Three synapses: the first one without astrocyte, the remaining two respectively with
10 open-loop and close-loop gliotransmission (see De Pitta' et al., 2011, 2016)
11 """
12 from brian2 import *
13
14 import plot_utils as pu
15
16 set_device('cpp_standalone', directory=None) # Use fast "C++ standalone mode"
17
18 ################################################################################
19 # Model parameters
20 ################################################################################
21 ### General parameters
22 transient = 16.5*second
23 duration = transient + 600*ms # Total simulation time
24 sim_dt = 1*ms # Integrator/sampling step
25
26 ### Synapse parameters
27 rho_c = 0.005 # Synaptic vesicle-to-extracellular space volume ratio
28 Y_T = 500*mmolar # Total vesicular neurotransmitter concentration
29 Omega_c = 40/second # Neurotransmitter clearance rate
30 U_0__star = 0.6 # Resting synaptic release probability
31 Omega_f = 3.33/second # Synaptic facilitation rate
32 Omega_d = 2.0/second # Synaptic depression rate
33 # --- Presynaptic receptors
34 O_G = 1.5/umolar/second # Agonist binding (activating) rate
35 Omega_G = 0.5/(60*second) # Agonist release (deactivating) rate
36
37 ### Astrocyte parameters
38 # --- Calcium fluxes
39 O_P = 0.9*umolar/second # Maximal Ca^2+ uptake rate by SERCAs
40 K_P = 0.05 * umolar # Ca2+ affinity of SERCAs
41 C_T = 2*umolar # Total cell free Ca^2+ content
42 rho_A = 0.18 # ER-to-cytoplasm volume ratio
43 Omega_C = 6/second # Maximal rate of Ca^2+ release by IP_3Rs
44 Omega_L = 0.1/second # Maximal rate of Ca^2+ leak from the ER
45 # --- IP_3R kinectics
46 d_1 = 0.13*umolar # IP_3 binding affinity
47 d_2 = 1.05*umolar # Ca^2+ inactivation dissociation constant
48 O_2 = 0.2/umolar/second # IP_3R binding rate for Ca^2+ inhibition
49 d_3 = 0.9434*umolar # IP_3 dissociation constant
50 d_5 = 0.08*umolar # Ca^2+ activation dissociation constant
51 # --- IP_3 production
52 O_delta = 0.6*umolar/second # Maximal rate of IP_3 production by PLCdelta
53 kappa_delta = 1.5* umolar # Inhibition constant of PLC_delta by IP_3
54 K_delta = 0.1*umolar # Ca^2+ affinity of PLCdelta
55 # --- IP_3 degradation
56 Omega_5P = 0.05/second # Maximal rate of IP_3 degradation by IP-5P
57 K_D = 0.7*umolar # Ca^2+ affinity of IP3-3K
58 K_3K = 1.0*umolar # IP_3 affinity of IP_3-3K
59 O_3K = 4.5*umolar/second # Maximal rate of IP_3 degradation by IP_3-3K
60 # --- IP_3 diffusion
61 F_ex = 2.0*umolar/second # Maximal exogenous IP3 flow
62 I_Theta = 0.3*umolar # Threshold gradient for IP_3 diffusion
63 omega_I = 0.05*umolar # Scaling factor of diffusion
64 # --- Gliotransmitter release and time course
65 C_Theta = 0.5*umolar # Ca^2+ threshold for exocytosis
66 Omega_A = 0.6/second # Gliotransmitter recycling rate
67 U_A = 0.6 # Gliotransmitter release probability
68 G_T = 200*mmolar # Total vesicular gliotransmitter concentration
69 rho_e = 6.5e-4 # Astrocytic vesicle-to-extracellular volume ratio
70 Omega_e = 60/second # Gliotransmitter clearance rate
71 alpha = 0.0 # Gliotransmission nature
72
73 ################################################################################
74 # Model definition
75 ################################################################################
76 defaultclock.dt = sim_dt # Set the integration time
77
78 ### "Neurons"
79 # We are only interested in the activity of the synapse, so we replace the
80 # neurons by trivial "dummy" groups
81 spikes = [0, 50, 100, 150, 200,
82 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400]*ms
83 spikes += transient # allow for some initial transient
84 source_neurons = SpikeGeneratorGroup(1, np.zeros(len(spikes)), spikes)
85 target_neurons = NeuronGroup(1, '')
86
87 ### Synapses
88 # Note that the synapse does not actually have any effect on the post-synaptic
89 # target
90 # Also note that for easier plotting we do not use the "event-driven" flag here,
91 # even though the value of u_S and x_S only needs to be updated on the arrival
92 # of a spike
93 synapses_eqs = '''
94 # Neurotransmitter
95 dY_S/dt = -Omega_c * Y_S : mmolar (clock-driven)
96 # Fraction of activated presynaptic receptors
97 dGamma_S/dt = O_G * G_A * (1 - Gamma_S) -
98 Omega_G * Gamma_S : 1 (clock-driven)
99 # Usage of releasable neurotransmitter per single action potential:
100 du_S/dt = -Omega_f * u_S : 1 (clock-driven)
101 # Fraction of synaptic neurotransmitter resources available:
102 dx_S/dt = Omega_d *(1 - x_S) : 1 (clock-driven)
103 # released synaptic neurotransmitter resources:
104 r_S : 1
105 # gliotransmitter concentration in the extracellular space:
106 G_A : mmolar
107 '''
108 synapses_action = '''
109 U_0 = (1 - Gamma_S) * U_0__star + alpha * Gamma_S
110 u_S += U_0 * (1 - u_S)
111 r_S = u_S * x_S
112 x_S -= r_S
113 Y_S += rho_c * Y_T * r_S
114 '''
115 synapses = Synapses(source_neurons, target_neurons,
116 model=synapses_eqs, on_pre=synapses_action,
117 method='exact')
118 # We create three synapses, only the second and third ones are modulated by astrocytes
119 synapses.connect(True, n=3)
120
121 ### Astrocytes
122 # The astrocyte emits gliotransmitter when its Ca^2+ concentration crosses
123 # a threshold
124 astro_eqs = '''
125 # IP_3 dynamics:
126 dI/dt = J_delta - J_3K - J_5P + J_ex : mmolar
127 J_delta = O_delta/(1 + I/kappa_delta) * C**2/(C**2 + K_delta**2) : mmolar/second
128 J_3K = O_3K * C**4/(C**4 + K_D**4) * I/(I + K_3K) : mmolar/second
129 J_5P = Omega_5P*I : mmolar/second
130 # Exogenous stimulation
131 delta_I_bias = I - I_bias : mmolar
132 J_ex = -F_ex/2*(1 + tanh((abs(delta_I_bias) - I_Theta)/omega_I)) *
133 sign(delta_I_bias) : mmolar/second
134 I_bias : mmolar (constant)
135
136 # Ca^2+-induced Ca^2+ release:
137 dC/dt = (Omega_C * m_inf**3 * h**3 + Omega_L) * (C_T - (1 + rho_A)*C) -
138 O_P * C**2/(C**2 + K_P**2) : mmolar
139 dh/dt = (h_inf - h)/tau_h : 1 # IP3R de-inactivation probability
140 m_inf = I/(I + d_1) * C/(C + d_5) : 1
141 h_inf = Q_2/(Q_2 + C) : 1
142 tau_h = 1/(O_2 * (Q_2 + C)) : second
143 Q_2 = d_2 * (I + d_1)/(I + d_3) : mmolar
144 # Fraction of gliotransmitter resources available:
145 dx_A/dt = Omega_A * (1 - x_A) : 1
146 # gliotransmitter concentration in the extracellular space:
147 dG_A/dt = -Omega_e*G_A : mmolar
148 '''
149 glio_release = '''
150 G_A += rho_e * G_T * U_A * x_A
151 x_A -= U_A * x_A
152 '''
153 # The following formulation makes sure that a "spike" is only triggered at the
154 # first threshold crossing -- the astrocyte is considered "refractory" (i.e.,
155 # not allowed to trigger another event) as long as the Ca2+ concentration
156 # remains above threshold
157 # The gliotransmitter release happens when the threshold is crossed, in Brian
158 # terms it can therefore be considered a "reset"
159 astrocyte = NeuronGroup(2, astro_eqs,
160 threshold='C>C_Theta',
161 refractory='C>C_Theta',
162 reset=glio_release,
163 method='rk4')
164 # Different length of stimulation
165 astrocyte.x_A = 1.0
166 astrocyte.h = 0.9
167 astrocyte.I = 0.4*umolar
168 astrocyte.I_bias = np.asarray([0.8, 1.25])*umolar
169
170 # Connection between astrocytes and the second synapse. Note that in this
171 # special case, where the synapse is only influenced by the gliotransmitter from
172 # a single astrocyte, the '(linked)' variable mechanism could be used instead.
173 # The mechanism used below is more general and can add the contribution of
174 # several astrocytes
175 ecs_astro_to_syn = Synapses(astrocyte, synapses,
176 'G_A_post = G_A_pre : mmolar (summed)')
177 # Connect second and third synapse to a different astrocyte
178 ecs_astro_to_syn.connect(j='i+1')
179
180 ################################################################################
181 # Monitors
182 ################################################################################
183 # Note that we cannot use "record=True" for synapses in C++ standalone mode --
184 # the StateMonitor needs to know the number of elements to record from during
185 # its initialization, but in C++ standalone mode, no synapses have been created
186 # yet. We therefore explicitly state to record from the three synapses.
187 syn_mon = StateMonitor(synapses, variables=['u_S', 'x_S', 'r_S', 'Y_S'],
188 record=[0, 1, 2])
189 ast_mon = StateMonitor(astrocyte, variables=['C', 'G_A'], record=True)
190
191 ################################################################################
192 # Simulation run
193 ################################################################################
194 run(duration, report='text')
195
196 ################################################################################
197 # Analysis and plotting
198 ################################################################################
199 from matplotlib import cycler
200 plt.style.use('figures.mplstyle')
201
202 fig, ax = plt.subplots(nrows=7, ncols=1, figsize=(6.26894, 6.26894 * 1.2),
203 gridspec_kw={'height_ratios': [3, 2, 1, 1, 3, 3, 3],
204 'top': 0.98, 'bottom': 0.08,
205 'left': 0.15, 'right': 0.95})
206
207 ## Ca^2+ traces of the two astrocytes
208 ax[0].plot((ast_mon.t-transient)/second, ast_mon.C[0]/umolar, '-', color='C2')
209 ax[0].plot((ast_mon.t-transient)/second, ast_mon.C[1]/umolar, '-', color='C3')
210 ## Add threshold for gliotransmitter release
211 ax[0].plot(np.asarray([-transient/second, 0.0]),
212 np.asarray([C_Theta, C_Theta])/umolar, ':', color='gray')
213 ax[0].set(xlim=[-transient/second, 0.0], yticks=[0., 0.4, 0.8, 1.2],
214 ylabel=r'$C$ ($\mu$M)')
215 pu.adjust_spines(ax[0], ['left'])
216
217 ## Gliotransmitter concentration in the extracellular space
218 ax[1].plot((ast_mon.t-transient)/second, ast_mon.G_A[0]/umolar, '-', color='C2')
219 ax[1].plot((ast_mon.t-transient)/second, ast_mon.G_A[1]/umolar, '-', color='C3')
220 ax[1].set(yticks=[0., 50., 100.], xlim=[-transient/second, 0.0],
221 xlabel='time (s)', ylabel=r'$G_A$ ($\mu$M)')
222 pu.adjust_spines(ax[1], ['left', 'bottom'])
223
224 ## Turn off one axis to display x-labeling of ax[1] correctly
225 ax[2].axis('off')
226
227 ## Synaptic stimulation
228 ax[3].vlines((spikes-transient)/ms, 0, 1, clip_on=False)
229 ax[3].set(xlim=(0, (duration-transient)/ms))
230 ax[3].axis('off')
231
232 ## Synaptic variables
233 # Use a custom cycle that uses black as the first color
234 prop_cycle = cycler(color='k').concat(matplotlib.rcParams['axes.prop_cycle'][2:])
235 ax[4].set(xlim=(0, (duration-transient)/ms), ylim=[0., 1.],
236 yticks=np.arange(0, 1.1, .25), ylabel='$u_S$',
237 prop_cycle=prop_cycle)
238 ax[4].plot((syn_mon.t-transient)/ms, syn_mon.u_S.T)
239 pu.adjust_spines(ax[4], ['left'])
240
241 ax[5].set(xlim=(0, (duration-transient)/ms), ylim=[-0.05, 1.],
242 yticks=np.arange(0, 1.1, .25), ylabel='$x_S$',
243 prop_cycle=prop_cycle)
244 ax[5].plot((syn_mon.t-transient)/ms, syn_mon.x_S.T)
245 pu.adjust_spines(ax[5], ['left'])
246
247 ax[6].set(xlim=(0, (duration-transient)/ms), ylim=(-5., 1500),
248 xticks=np.arange(0, (duration-transient)/ms, 100), xlabel='time (ms)',
249 yticks=[0, 500, 1000, 1500], ylabel=r'$Y_S$ ($\mu$M)',
250 prop_cycle=prop_cycle)
251 ax[6].plot((syn_mon.t-transient)/ms, syn_mon.Y_S.T/umolar)
252 ax[6].legend(['no gliotransmission',
253 'weak gliotransmission',
254 'stronger gliotransmission'], loc='upper right')
255 pu.adjust_spines(ax[6], ['left', 'bottom'])
256
257 pu.adjust_ylabels(ax, x_offset=-0.11)
258
259 plt.show()