Skip to content

Commit 06fa45b

Browse files
Merge pull request #3093 from HanjiaJiang/rename_ca_astro
Rename the variable "Ca" in astrocyte_lr_1994 to "Ca_astro"
2 parents 8cb5798 + 677bbd0 commit 06fa45b

File tree

12 files changed

+51
-49
lines changed

12 files changed

+51
-49
lines changed

doc/htmldoc/model_details/astrocyte_model_implementation.ipynb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,39 +84,39 @@
8484
" Parameters\n",
8585
" ----------\n",
8686
" y : list\n",
87-
" Vector containing the state variables [IP3, Ca, h_IP3R]\n",
87+
" Vector containing the state variables [IP3, Ca_astro, h_IP3R]\n",
8888
" _ : unused var\n",
8989
" p : Params instance\n",
9090
" Object containing the astrocyte parameters.\n",
9191
"\n",
9292
" Returns\n",
9393
" -------\n",
94-
" dCa : double\n",
95-
" Derivative of Ca\n",
94+
" dCa_astro : double\n",
95+
" Derivative of Ca_astro\n",
9696
" dIP3 : double\n",
9797
" Derivative of IP3\n",
9898
" dh_IP3R : double\n",
9999
" Derivative of h_IP3R\n",
100100
" \"\"\"\n",
101101
" IP3 = y[0]\n",
102-
" Ca = y[1]\n",
102+
" Ca_astro = y[1]\n",
103103
" h_IP3R = y[2]\n",
104104
"\n",
105-
" Ca = max(0, min(Ca, p.Ca_tot * (1 + p.ratio_ER_cyt)))\n",
105+
" Ca_astro = max(0, min(Ca_astro, p.Ca_tot * (1 + p.ratio_ER_cyt)))\n",
106106
" alpha = p.k_IP3R * p.Kd_inh * (IP3 + p.Kd_IP3_1) / (IP3 + p.Kd_IP3_2)\n",
107-
" beta = p.k_IP3R * Ca\n",
108-
" Ca_ER = (p.Ca_tot - Ca) / p.ratio_ER_cyt\n",
107+
" beta = p.k_IP3R * Ca_astro\n",
108+
" Ca_ER = (p.Ca_tot - Ca_astro) / p.ratio_ER_cyt\n",
109109
" m_inf = IP3 / (IP3 + p.Kd_IP3_1)\n",
110-
" n_inf = Ca / (Ca + p.Kd_act)\n",
111-
" J_ch = p.ratio_ER_cyt * p.rate_IP3R * ((m_inf * n_inf * h_IP3R) ** 3) * (Ca_ER - Ca)\n",
112-
" J_pump = p.rate_SERCA * (Ca**2) / (p.Km_SERCA**2 + Ca**2)\n",
113-
" J_leak = p.ratio_ER_cyt * p.rate_L * (Ca_ER - Ca)\n",
110+
" n_inf = Ca_astro / (Ca_astro + p.Kd_act)\n",
111+
" J_ch = p.ratio_ER_cyt * p.rate_IP3R * ((m_inf * n_inf * h_IP3R) ** 3) * (Ca_ER - Ca_astro)\n",
112+
" J_pump = p.rate_SERCA * (Ca_astro**2) / (p.Km_SERCA**2 + Ca_astro**2)\n",
113+
" J_leak = p.ratio_ER_cyt * p.rate_L * (Ca_ER - Ca_astro)\n",
114114
"\n",
115-
" dCa = J_ch - J_pump + J_leak\n",
115+
" dCa_astro = J_ch - J_pump + J_leak\n",
116116
" dIP3 = (p.IP3_0 - IP3) / p.tau_IP3\n",
117117
" dh_IP3R = alpha * (1 - h_IP3R) - beta * h_IP3R\n",
118118
"\n",
119-
" return dIP3, dCa, dh_IP3R"
119+
" return dIP3, dCa_astro, dh_IP3R"
120120
]
121121
},
122122
{
@@ -164,7 +164,7 @@
164164
" \"\"\"\n",
165165
" t = np.arange(0, simtime, dt) # time axis\n",
166166
" n = len(t)\n",
167-
" y = np.zeros((n, 3)) # state variables: IP3, Ca, h_IP3R\n",
167+
" y = np.zeros((n, 3)) # state variables: IP3, Ca_astro, h_IP3R\n",
168168
" # for the state variables, assign the same initial values as in test_astrocyte.py\n",
169169
" y[0, 0] = 1.0\n",
170170
" y[0, 1] = 1.0\n",
@@ -282,7 +282,7 @@
282282
"implementation detailed in\n",
283283
"``doc/htmldoc/model_details/astrocyte_model_implementation.ipynb``.\n",
284284
"This data is used as reference for the tests in ``test_astrocyte.py``.\\n\n",
285-
" Times IP3 Ca h_IP3R \"\"\",\n",
285+
" Times IP3 Ca_astro h_IP3R\"\"\",\n",
286286
")"
287287
]
288288
},

models/astrocyte_lr_1994.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ RecordablesMap< astrocyte_lr_1994 >::create()
6161
{
6262
// use standard names whereever you can for consistency!
6363
insert_( names::IP3, &astrocyte_lr_1994::get_y_elem_< astrocyte_lr_1994::State_::IP3 > );
64-
insert_( names::Ca, &astrocyte_lr_1994::get_y_elem_< astrocyte_lr_1994::State_::Ca > );
64+
insert_( names::Ca_astro, &astrocyte_lr_1994::get_y_elem_< astrocyte_lr_1994::State_::Ca_astro > );
6565
insert_( names::h_IP3R, &astrocyte_lr_1994::get_y_elem_< astrocyte_lr_1994::State_::h_IP3R > );
6666
}
6767

@@ -85,7 +85,7 @@ astrocyte_lr_1994_dynamics( double time, const double y[], double f[], void* pno
8585
const double& ip3 = y[ S::IP3 ];
8686
// Ca_tot_ corresponds to the c_0 (total [Ca++] in terms of cytosolic vol)
8787
// in De Young & Keizer (1992) and Li & Rinzel (1994)
88-
const double& calc = std::max( 0.0, std::min( y[ S::Ca ], node.P_.Ca_tot_ ) ); // keep calcium within limits
88+
const double& calc = std::max( 0.0, std::min( y[ S::Ca_astro ], node.P_.Ca_tot_ ) ); // keep calcium within limits
8989
const double& h_ip3r = y[ S::h_IP3R ];
9090

9191
const double alpha_h_ip3r =
@@ -101,7 +101,7 @@ astrocyte_lr_1994_dynamics( double time, const double y[], double f[], void* pno
101101
* std::pow( h_ip3r, 3 ) * ( calc_ER - calc );
102102

103103
f[ S::IP3 ] = ( node.P_.IP3_0_ - ip3 ) / node.P_.tau_IP3_;
104-
f[ S::Ca ] = J_channel - J_pump + J_leak + node.B_.J_noise_;
104+
f[ S::Ca_astro ] = J_channel - J_pump + J_leak + node.B_.J_noise_;
105105
f[ S::h_IP3R ] = alpha_h_ip3r * ( 1.0 - h_ip3r ) - beta_h_ip3r * h_ip3r;
106106

107107
return GSL_SUCCESS;
@@ -137,7 +137,7 @@ nest::astrocyte_lr_1994::State_::State_( const Parameters_& p )
137137
{
138138
// initial values based on Li & Rinzel (1994) and Nadkarni & Jung (2003)
139139
y_[ IP3 ] = p.IP3_0_;
140-
y_[ Ca ] = 0.073;
140+
y_[ Ca_astro ] = 0.073;
141141
y_[ h_IP3R ] = 0.793;
142142
}
143143

@@ -278,22 +278,22 @@ void
278278
nest::astrocyte_lr_1994::State_::get( DictionaryDatum& d ) const
279279
{
280280
def< double >( d, names::IP3, y_[ IP3 ] );
281-
def< double >( d, names::Ca, y_[ Ca ] );
281+
def< double >( d, names::Ca_astro, y_[ Ca_astro ] );
282282
def< double >( d, names::h_IP3R, y_[ h_IP3R ] );
283283
}
284284

285285
void
286286
nest::astrocyte_lr_1994::State_::set( const DictionaryDatum& d, const Parameters_&, Node* node )
287287
{
288288
updateValueParam< double >( d, names::IP3, y_[ IP3 ], node );
289-
updateValueParam< double >( d, names::Ca, y_[ Ca ], node );
289+
updateValueParam< double >( d, names::Ca_astro, y_[ Ca_astro ], node );
290290
updateValueParam< double >( d, names::h_IP3R, y_[ h_IP3R ], node );
291291

292292
if ( y_[ IP3 ] < 0 )
293293
{
294294
throw BadProperty( "IP3 concentration must be non-negative." );
295295
}
296-
if ( y_[ Ca ] < 0 )
296+
if ( y_[ Ca_astro ] < 0 )
297297
{
298298
throw BadProperty( "Calcium concentration must be non-negative." );
299299
}
@@ -465,15 +465,15 @@ nest::astrocyte_lr_1994::update( Time const& origin, const long from, const long
465465
}
466466

467467
// keep calcium within limits
468-
S_.y_[ State_::Ca ] = std::max( 0.0, std::min( S_.y_[ State_::Ca ], P_.Ca_tot_ ) );
468+
S_.y_[ State_::Ca_astro ] = std::max( 0.0, std::min( S_.y_[ State_::Ca_astro ], P_.Ca_tot_ ) );
469469

470470
// this is to add the incoming spikes to IP3
471471
S_.y_[ State_::IP3 ] += P_.delta_IP3_ * B_.spike_exc_.get_value( lag );
472472

473473
// SIC generation according to Nadkarni & Jung, 2003
474474
// Suprathreshold log of calcium concentration determines SIC generation
475475
// 1000.0: change unit to nM as in the original paper
476-
const double calc_thr = ( S_.y_[ State_::Ca ] - P_.SIC_th_ ) * 1000.0;
476+
const double calc_thr = ( S_.y_[ State_::Ca_astro ] - P_.SIC_th_ ) * 1000.0;
477477
const double sic_value = calc_thr > 1.0 ? std::log( calc_thr ) * P_.SIC_scale_ : 0.0;
478478
B_.sic_values[ lag ] = sic_value;
479479

models/astrocyte_lr_1994.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,15 @@ Parameters
164164
165165
The following parameters can be set in the status dictionary.
166166
167-
====== ========= =============================================================
167+
======== ========= =============================================================
168168
**Dynamic state variables**
169-
-------------------------------------------------------------------------------
170-
IP3 µM Inositol 1,4,5-trisphosphate concentration in the astrocytic
171-
cytosol
172-
Ca µM Calcium concentration in the astrocytic cytosol
173-
h_IP3R unitless Fraction of IP3 receptors on the astrocytic ER that are not
174-
yet inactivated by calcium
175-
====== ========= =============================================================
169+
--------------------------------------------------------------------------------
170+
IP3 µM Inositol 1,4,5-trisphosphate concentration in the astrocytic
171+
cytosol
172+
Ca_astro µM Calcium concentration in the astrocytic cytosol
173+
h_IP3R unitless Fraction of IP3 receptors on the astrocytic ER that are not
174+
yet inactivated by calcium
175+
======== ========= =============================================================
176176
177177
=============== ========= =====================================================
178178
**Parameters**
@@ -354,8 +354,8 @@ class astrocyte_lr_1994 : public StructuralPlasticityNode
354354
enum StateVecElems
355355
{
356356
IP3 = 0,
357-
Ca, // 1
358-
h_IP3R, // 2
357+
Ca_astro, // 1
358+
h_IP3R, // 2
359359
STATE_VEC_SIZE
360360
};
361361

nestkernel/nest_names.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ const Name buffer_size_target_data( "buffer_size_target_data" );
8484

8585
const Name C_m( "C_m" );
8686
const Name Ca( "Ca" );
87+
const Name Ca_astro( "Ca_astro" );
8788
const Name Ca_tot( "Ca_tot" );
8889
const Name c( "c" );
8990
const Name c_1( "c_1" );

nestkernel/nest_names.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ extern const Name buffer_size_target_data;
110110

111111
extern const Name C_m;
112112
extern const Name Ca;
113+
extern const Name Ca_astro;
113114
extern const Name Ca_tot;
114115
extern const Name c;
115116
extern const Name c_1;

pynest/examples/astrocytes/astrocyte_brunel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def plot_dynamics(astro_data, neuron_data, start):
256256
# astrocyte data
257257
astro_mask = astro_data["times"] > start
258258
astro_ip3 = astro_data["IP3"][astro_mask]
259-
astro_cal = astro_data["Ca"][astro_mask]
259+
astro_cal = astro_data["Ca_astro"][astro_mask]
260260
astro_times = astro_data["times"][astro_mask]
261261
astro_times_set = list(set(astro_times))
262262
ip3_means = np.array([np.mean(astro_ip3[astro_times == t]) for t in astro_times_set])
@@ -329,7 +329,7 @@ def run_simulation():
329329
# create and connect recorders (multimeter default resolution = 1 ms)
330330
sr_neuron = nest.Create("spike_recorder")
331331
mm_neuron = nest.Create("multimeter", params={"record_from": ["I_SIC"]})
332-
mm_astro = nest.Create("multimeter", params={"record_from": ["IP3", "Ca"]})
332+
mm_astro = nest.Create("multimeter", params={"record_from": ["IP3", "Ca_astro"]})
333333

334334
# select nodes randomly and connect them with recorders
335335
print("Connecting recorders ...")

pynest/examples/astrocytes/astrocyte_interaction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
# Create and connect the astrocyte and its devices.
9696

9797
astrocyte = nest.Create("astrocyte_lr_1994", params=params_astro)
98-
mm_astro = nest.Create("multimeter", params={"record_from": ["IP3", "Ca"]})
98+
mm_astro = nest.Create("multimeter", params={"record_from": ["IP3", "Ca_astro"]})
9999
nest.Connect(mm_astro, astrocyte)
100100

101101
###############################################################################
@@ -133,7 +133,7 @@
133133
axes[0].plot(data_pre["times"], data_pre["V_m"])
134134
axes[1].plot(data_astro["times"], data_astro["IP3"])
135135
axes[2].plot(data_post["times"], data_post["I_SIC"])
136-
axes[3].plot(data_astro["times"], data_astro["Ca"])
136+
axes[3].plot(data_astro["times"], data_astro["Ca_astro"])
137137
axes[0].set_title(f"Presynaptic neuron\n(Poisson rate = {poisson_rate_neuro} Hz)")
138138
axes[0].set_ylabel("Membrane potential (mV)")
139139
axes[2].set_title("Postsynaptic neuron")

pynest/examples/astrocytes/astrocyte_single.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878

7979
astrocyte = nest.Create("astrocyte_lr_1994", params=params_astro)
8080
ps_astro = nest.Create("poisson_generator", params={"rate": poisson_rate})
81-
mm_astro = nest.Create("multimeter", params={"record_from": ["IP3", "Ca"]})
81+
mm_astro = nest.Create("multimeter", params={"record_from": ["IP3", "Ca_astro"]})
8282
nest.Connect(ps_astro, astrocyte, syn_spec={"weight": poisson_weight})
8383
nest.Connect(mm_astro, astrocyte)
8484

@@ -93,7 +93,7 @@
9393

9494
fig, axes = plt.subplots(2, 1, sharex=True, figsize=(6.4, 4.8), dpi=100)
9595
axes[0].plot(data["times"], data["IP3"])
96-
axes[1].plot(data["times"], data["Ca"])
96+
axes[1].plot(data["times"], data["Ca_astro"])
9797
axes[0].set_ylabel(r"[IP$_{3}$] ($\mu$M)")
9898
axes[1].set_ylabel(r"[Ca$^{2+}$] ($\mu$M)")
9999
axes[1].set_xlabel("Time (ms)")

pynest/examples/astrocytes/astrocyte_small_network.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def plot_dynamics(astro_data, neuron_data, start):
342342
print("Plotting dynamics ...")
343343
# get astrocyte data
344344
astro_times, astro_ip3_mean, astro_ip3_sd = get_plot_data(astro_data, "IP3")
345-
astro_times, astro_ca_mean, astro_ca_sd = get_plot_data(astro_data, "Ca")
345+
astro_times, astro_ca_mean, astro_ca_sd = get_plot_data(astro_data, "Ca_astro")
346346
# get neuron data
347347
neuron_times, neuron_sic_mean, neuron_sic_sd = get_plot_data(neuron_data, "I_SIC")
348348
# set plots
@@ -413,7 +413,7 @@ def plot_dynamics(astro_data, neuron_data, start):
413413
)
414414
mm_pre_neurons = nest.Create("multimeter", params={"record_from": ["V_m"]})
415415
mm_post_neurons = nest.Create("multimeter", params={"record_from": ["V_m", "I_SIC"]})
416-
mm_astrocytes = nest.Create("multimeter", params={"record_from": ["IP3", "Ca"]})
416+
mm_astrocytes = nest.Create("multimeter", params={"record_from": ["IP3", "Ca_astro"]})
417417
nest.Connect(mm_pre_neurons, pre_neurons)
418418
nest.Connect(mm_post_neurons, post_neurons)
419419
nest.Connect(mm_astrocytes, astrocytes)

testsuite/pytests/test_astrocyte.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# ``doc/htmldoc/model_details/astrocyte_model_implementation.ipynb``.
1010
# This data is used as reference for the tests in ``test_astrocyte.py``.
1111
#
12-
# Times IP3 Ca h_IP3R
12+
# Times IP3 Ca_astro h_IP3R
1313
1.000000000000000056e-01 9.999882386709698645e-01 1.000187105302611235e+00 9.999799984511013040e-01
1414
2.000000000000000111e-01 9.999764775066160016e-01 1.000374129429669079e+00 9.999599938057039950e-01
1515
3.000000000000000444e-01 9.999647165069364130e-01 1.000561072405474095e+00 9.999399860656773553e-01

0 commit comments

Comments
 (0)