Channels¶
Channel¶
Channel base class. All channels inherit from this class.
As in NEURON, a Channel
is considered a distributed process, which means that its
conductances are to be specified in S/cm2
and its currents are to be specified in
uA/cm2
.
Source code in jaxley/channels/channel.py
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 89 90 91 |
|
name: Optional[str]
property
¶
The name of the channel (by default, this is the class name).
change_name(new_name)
¶
Change the channel name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_name |
str
|
The new name of the channel. |
required |
Returns:
Type | Description |
---|---|
Renamed channel, such that this function is chainable. |
Source code in jaxley/channels/channel.py
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 |
|
compute_current(states, v, params)
¶
Given channel states and voltage, return the current through the channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
states |
Dict[str, ndarray]
|
All states of the compartment. |
required |
v |
Voltage of the compartment in mV. |
required | |
params |
Dict[str, ndarray]
|
Parameters of the channel (conductances in |
required |
Returns:
Type | Description |
---|---|
Current in |
Source code in jaxley/channels/channel.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
init_state(states, v, params, delta_t)
¶
Initialize states of channel.
Source code in jaxley/channels/channel.py
83 84 85 86 87 88 89 90 91 |
|
update_states(states, dt, v, params)
¶
Return the updated states.
Source code in jaxley/channels/channel.py
62 63 64 65 66 |
|
HH¶
Bases: Channel
Hodgkin-Huxley channel.
Source code in jaxley/channels/hh.py
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 89 90 91 92 93 94 |
|
compute_current(states, v, params)
¶
Return current through HH channels.
Source code in jaxley/channels/hh.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
init_state(states, v, params, delta_t)
¶
Initialize the state such at fixed point of gate dynamics.
Source code in jaxley/channels/hh.py
66 67 68 69 70 71 72 73 74 75 76 |
|
update_states(states, dt, v, params)
¶
Return updated HH channel state.
Source code in jaxley/channels/hh.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
Pospischil¶
Bases: Channel
Leak current
Source code in jaxley/channels/pospischil.py
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 |
|
compute_current(states, v, params)
¶
Return current.
Source code in jaxley/channels/pospischil.py
58 59 60 61 62 63 64 65 |
|
update_states(states, dt, v, params)
¶
No state to update.
Source code in jaxley/channels/pospischil.py
48 49 50 51 52 53 54 55 56 |
|
Bases: Channel
Sodium channel
Source code in jaxley/channels/pospischil.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
compute_current(states, v, params)
¶
Return current.
Source code in jaxley/channels/pospischil.py
99 100 101 102 103 104 105 106 107 108 109 110 |
|
init_state(states, v, params, delta_t)
¶
Initialize the state such at fixed point of gate dynamics.
Source code in jaxley/channels/pospischil.py
112 113 114 115 116 117 118 119 120 |
|
update_states(states, dt, v, params)
¶
Update state.
Source code in jaxley/channels/pospischil.py
85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
Bases: Channel
Potassium channel
Source code in jaxley/channels/pospischil.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
|
compute_current(states, v, params)
¶
Return current.
Source code in jaxley/channels/pospischil.py
168 169 170 171 172 173 174 175 176 177 178 |
|
init_state(states, v, params, delta_t)
¶
Initialize the state such at fixed point of gate dynamics.
Source code in jaxley/channels/pospischil.py
180 181 182 183 184 |
|
update_states(states, dt, v, params)
¶
Update state.
Source code in jaxley/channels/pospischil.py
155 156 157 158 159 160 161 162 163 164 165 166 |
|
Bases: Channel
Slow M Potassium channel
Source code in jaxley/channels/pospischil.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
|
compute_current(states, v, params)
¶
Return current.
Source code in jaxley/channels/pospischil.py
225 226 227 228 229 230 231 232 233 234 |
|
init_state(states, v, params, delta_t)
¶
Initialize the state such at fixed point of gate dynamics.
Source code in jaxley/channels/pospischil.py
236 237 238 239 240 |
|
update_states(states, dt, v, params)
¶
Update state.
Source code in jaxley/channels/pospischil.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
|
Bases: Channel
L-type Calcium channel
Source code in jaxley/channels/pospischil.py
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
|
compute_current(states, v, params)
¶
Return current.
Source code in jaxley/channels/pospischil.py
279 280 281 282 283 284 285 286 287 288 289 |
|
init_state(states, v, params, delta_t)
¶
Initialize the state such at fixed point of gate dynamics.
Source code in jaxley/channels/pospischil.py
291 292 293 294 295 296 297 298 299 |
|
update_states(states, dt, v, params)
¶
Update state.
Source code in jaxley/channels/pospischil.py
265 266 267 268 269 270 271 272 273 274 275 276 277 |
|
Bases: Channel
T-type Calcium channel
Source code in jaxley/channels/pospischil.py
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
|
compute_current(states, v, params)
¶
Return current.
Source code in jaxley/channels/pospischil.py
349 350 351 352 353 354 355 356 357 358 359 360 |
|
init_state(states, v, params, delta_t)
¶
Initialize the state such at fixed point of gate dynamics.
Source code in jaxley/channels/pospischil.py
362 363 364 365 366 |
|
update_states(states, dt, v, params)
¶
Update state.
Source code in jaxley/channels/pospischil.py
334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
|
Synapses¶
Synapse¶
Base class for a synapse.
As in NEURON, a Synapse
is considered a point process, which means that its
conductances are to be specified in uS
and its currents are to be specified in
nA
.
Source code in jaxley/synapses/synapse.py
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 89 90 91 92 93 94 95 96 97 98 99 |
|
change_name(new_name)
¶
Change the synapse name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_name |
str
|
The new name of the channel. |
required |
Returns:
Type | Description |
---|---|
Renamed channel, such that this function is chainable. |
Source code in jaxley/synapses/synapse.py
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 |
|
compute_current(states, pre_voltage, post_voltage, params)
¶
Return current through one synapse in nA
.
Internally, we use jax.vmap
to vectorize this function across many synapses.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
states |
Dict[str, ndarray]
|
States of the synapse. |
required |
pre_voltage |
ndarray
|
Voltage of the presynaptic compartment, shape |
required |
post_voltage |
ndarray
|
Voltage of the postsynaptic compartment, shape |
required |
params |
Dict[str, ndarray]
|
Parameters of the synapse. Conductances in |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Current through the synapse in |
Source code in jaxley/synapses/synapse.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
update_states(states, delta_t, pre_voltage, post_voltage, params)
¶
ODE update step.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
states |
Dict[str, ndarray]
|
States of the synapse. |
required |
delta_t |
float
|
Time step in |
required |
pre_voltage |
ndarray
|
Voltage of the presynaptic compartment, shape |
required |
post_voltage |
ndarray
|
Voltage of the postsynaptic compartment, shape |
required |
params |
Dict[str, ndarray]
|
Parameters of the synapse. Conductances in |
required |
Returns:
Type | Description |
---|---|
Dict[str, ndarray]
|
Updated states. |
Source code in jaxley/synapses/synapse.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
Ionotropic Synapse¶
Bases: Synapse
Compute synaptic current and update synapse state for a generic ionotropic synapse.
The synapse state “s” is the probability that a postsynaptic receptor channel is open, and this depends on the amount of neurotransmitter released, which is in turn dependent on the presynaptic voltage.
The synaptic parameters are
- gS: the maximal conductance across the postsynaptic membrane (uS)
- e_syn: the reversal potential across the postsynaptic membrane (mV)
- k_minus: the rate constant of neurotransmitter unbinding from the postsynaptic receptor (s^-1)
Details of this implementation can be found in the following book chapter
L. F. Abbott and E. Marder, “Modeling Small Networks,” in Methods in Neuronal Modeling, C. Koch and I. Sergev, Eds. Cambridge: MIT Press, 1998.
Source code in jaxley/synapses/ionotropic.py
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 |
|
update_states(states, delta_t, pre_voltage, post_voltage, params)
¶
Return updated synapse state and current.
Source code in jaxley/synapses/ionotropic.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
TanH Rate Synapse¶
Bases: Synapse
Compute synaptic current for tanh synapse (no state).
Source code in jaxley/synapses/tanh_rate.py
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 |
|
compute_current(states, pre_voltage, post_voltage, params)
¶
Return updated synapse state and current.
Source code in jaxley/synapses/tanh_rate.py
37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
update_states(states, delta_t, pre_voltage, post_voltage, params)
¶
Return updated synapse state and current.
Source code in jaxley/synapses/tanh_rate.py
26 27 28 29 30 31 32 33 34 35 |
|