bluecellulab 2.6.62__tar.gz → 2.6.64__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bluecellulab might be problematic. Click here for more details.
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/PKG-INFO +1 -1
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/analysis/analysis.py +67 -39
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/validation/validation.py +65 -30
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab.egg-info/PKG-INFO +1 -1
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/.compile_mod.sh +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/.gitattributes +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/.github/dependabot.yml +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/.github/workflows/release.yml +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/.github/workflows/test.yml +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/.gitignore +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/.gitlab-ci.yml +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/.readthedocs.yml +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/.zenodo.json +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/AUTHORS.txt +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/CHANGELOG.rst +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/CITATION.cff +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/CONTRIBUTING.rst +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/LICENSE +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/MANIFEST.in +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/Makefile +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/README.rst +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/__init__.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/analysis/__init__.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/analysis/inject_sequence.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/analysis/plotting.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/analysis/utils.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/__init__.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/ballstick/__init__.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/ballstick/emodel.hoc +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/ballstick/morphology.asc +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/cell_dict.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/core.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/injector.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/plotting.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/random.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/recording.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/section_distance.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/serialized_sections.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/sonata_proxy.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/stimuli_generator.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/cell/template.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/__init__.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/circuit_access/__init__.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/circuit_access/bluepy_circuit_access.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/circuit_access/definition.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/circuit_access/sonata_circuit_access.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/config/__init__.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/config/bluepy_simulation_config.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/config/definition.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/config/sections.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/config/sonata_simulation_config.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/format.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/iotools.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/node_id.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/simulation_access.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/synapse_properties.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/validate.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit_simulation.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/connection.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/dendrogram.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/exceptions.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/graph.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/hoc/Cell.hoc +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/hoc/RNGSettings.hoc +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/hoc/TDistFunc.hoc +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/hoc/TStim.hoc +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/hoc/fileUtils.hoc +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/importer.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/neuron_interpreter.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/plotwindow.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/psection.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/psegment.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/reports/__init__.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/reports/manager.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/reports/utils.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/reports/writers/__init__.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/reports/writers/base_writer.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/reports/writers/compartment.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/reports/writers/spikes.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/rngsettings.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/simulation/__init__.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/simulation/neuron_globals.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/simulation/parallel.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/simulation/report.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/simulation/simulation.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/stimulus/__init__.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/stimulus/circuit_stimulus_definitions.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/stimulus/factory.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/stimulus/stimulus.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/synapse/__init__.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/synapse/synapse_factory.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/synapse/synapse_types.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/tools.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/type_aliases.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/utils.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/verbosity.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab.egg-info/SOURCES.txt +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab.egg-info/dependency_links.txt +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab.egg-info/requires.txt +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab.egg-info/top_level.txt +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/docs/Makefile +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/docs/images/voltage-readme.png +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/docs/make.bat +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/docs/requirements_docs.txt +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/docs/source/_static/.gitkeep +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/docs/source/api.rst +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/docs/source/changelog.rst +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/docs/source/compiling-mechanisms.rst +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/docs/source/conf.py +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/docs/source/contributing.rst +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/docs/source/index.rst +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/docs/source/list_of_stim.rst +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/docs/source/logo/BlueCelluLabBanner.jpg +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/pyproject.toml +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/setup.cfg +0 -0
- {bluecellulab-2.6.62 → bluecellulab-2.6.64}/tox.ini +0 -0
|
@@ -4,9 +4,11 @@ try:
|
|
|
4
4
|
except ImportError:
|
|
5
5
|
efel = None
|
|
6
6
|
from itertools import islice
|
|
7
|
+
from itertools import repeat
|
|
7
8
|
import logging
|
|
8
9
|
from matplotlib.collections import LineCollection
|
|
9
10
|
import matplotlib.pyplot as plt
|
|
11
|
+
from multiprocessing import Pool
|
|
10
12
|
import neuron
|
|
11
13
|
import numpy as np
|
|
12
14
|
import pathlib
|
|
@@ -40,7 +42,8 @@ def compute_plot_iv_curve(cell,
|
|
|
40
42
|
show_figure=True,
|
|
41
43
|
save_figure=False,
|
|
42
44
|
output_dir="./",
|
|
43
|
-
output_fname="iv_curve.pdf"
|
|
45
|
+
output_fname="iv_curve.pdf",
|
|
46
|
+
n_processes=None):
|
|
44
47
|
"""Compute and plot the Current-Voltage (I-V) curve for a given cell by
|
|
45
48
|
injecting a range of currents.
|
|
46
49
|
|
|
@@ -72,6 +75,9 @@ def compute_plot_iv_curve(cell,
|
|
|
72
75
|
save_figure (bool): Whether to save the figure. Default is False.
|
|
73
76
|
output_dir (str): The directory to save the figure if save_figure is True. Default is "./".
|
|
74
77
|
output_fname (str): The filename to save the figure as if save_figure is True. Default is "iv_curve.png".
|
|
78
|
+
n_processes (int, optional): The number of processes to use for parallel execution.
|
|
79
|
+
If None or if it is higher than the number of steps,
|
|
80
|
+
it will use the number of steps as the number of processes.
|
|
75
81
|
|
|
76
82
|
Returns:
|
|
77
83
|
tuple: A tuple containing:
|
|
@@ -95,15 +101,22 @@ def compute_plot_iv_curve(cell,
|
|
|
95
101
|
for amp in list_amp
|
|
96
102
|
]
|
|
97
103
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
if n_processes is None or n_processes > len(steps):
|
|
105
|
+
n_processes = len(steps)
|
|
106
|
+
with Pool(n_processes) as p:
|
|
107
|
+
recordings = p.starmap(
|
|
108
|
+
run_stimulus,
|
|
109
|
+
zip(
|
|
110
|
+
repeat(cell.template_params),
|
|
111
|
+
steps,
|
|
112
|
+
repeat(injecting_section),
|
|
113
|
+
repeat(injecting_segment),
|
|
114
|
+
repeat(True), # cvode
|
|
115
|
+
repeat(True), # add_hypamp
|
|
116
|
+
repeat(recording_section),
|
|
117
|
+
repeat(recording_segment),
|
|
118
|
+
)
|
|
119
|
+
)
|
|
107
120
|
|
|
108
121
|
steady_states = []
|
|
109
122
|
# compute steady state response
|
|
@@ -148,7 +161,8 @@ def compute_plot_fi_curve(cell,
|
|
|
148
161
|
show_figure=True,
|
|
149
162
|
save_figure=False,
|
|
150
163
|
output_dir="./",
|
|
151
|
-
output_fname="fi_curve.pdf"
|
|
164
|
+
output_fname="fi_curve.pdf",
|
|
165
|
+
n_processes=None):
|
|
152
166
|
"""Compute and plot the Frequency-Current (F-I) curve for a given cell by
|
|
153
167
|
injecting a range of currents.
|
|
154
168
|
|
|
@@ -182,6 +196,9 @@ def compute_plot_fi_curve(cell,
|
|
|
182
196
|
save_figure (bool): Whether to save the figure. Default is False.
|
|
183
197
|
output_dir (str): The directory to save the figure if save_figure is True. Default is "./".
|
|
184
198
|
output_fname (str): The filename to save the figure as if save_figure is True. Default is "iv_curve.png".
|
|
199
|
+
n_processes (int, optional): The number of processes to use for parallel execution.
|
|
200
|
+
If None or if it is higher than the number of steps,
|
|
201
|
+
it will use the number of steps as the number of processes.
|
|
185
202
|
|
|
186
203
|
Returns:
|
|
187
204
|
tuple: A tuple containing:
|
|
@@ -201,19 +218,26 @@ def compute_plot_fi_curve(cell,
|
|
|
201
218
|
for amp in list_amp
|
|
202
219
|
]
|
|
203
220
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
221
|
+
if n_processes is None or n_processes > len(steps):
|
|
222
|
+
n_processes = len(steps)
|
|
223
|
+
with Pool(n_processes) as p:
|
|
224
|
+
recordings = p.starmap(
|
|
225
|
+
run_stimulus,
|
|
226
|
+
zip(
|
|
227
|
+
repeat(cell.template_params),
|
|
228
|
+
steps,
|
|
229
|
+
repeat(injecting_section),
|
|
230
|
+
repeat(injecting_segment),
|
|
231
|
+
repeat(True), # cvode
|
|
232
|
+
repeat(True), # add_hypamp
|
|
233
|
+
repeat(recording_section),
|
|
234
|
+
repeat(recording_segment),
|
|
235
|
+
repeat(True), # enable_spike_detection
|
|
236
|
+
repeat(threshold_voltage), # threshold_spike_detection
|
|
237
|
+
)
|
|
238
|
+
)
|
|
215
239
|
|
|
216
|
-
spike_count = [len(spike) for
|
|
240
|
+
spike_count = [len(recording.spike) for recording in recordings]
|
|
217
241
|
|
|
218
242
|
plot_fi_curve(list_amp,
|
|
219
243
|
spike_count,
|
|
@@ -327,29 +351,32 @@ class BPAP:
|
|
|
327
351
|
return soma_amp, dend_amps, dend_dist, apic_amps, apic_dist
|
|
328
352
|
|
|
329
353
|
@staticmethod
|
|
330
|
-
def fit(soma_amp,
|
|
354
|
+
def fit(soma_amp, branch_amps, branch_dist):
|
|
331
355
|
"""Fit the amplitudes vs distances to an exponential decay function."""
|
|
332
356
|
from scipy.optimize import curve_fit
|
|
333
357
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
amps = soma_amp + apic_amps # add soma amplitude
|
|
344
|
-
popt_apic, _ = curve_fit(exp_decay, dist, amps)
|
|
345
|
-
|
|
346
|
-
return popt_dend, popt_apic
|
|
358
|
+
if not branch_amps or not branch_dist or len(branch_amps) != len(branch_dist):
|
|
359
|
+
return None, False
|
|
360
|
+
try:
|
|
361
|
+
dist = [0] + branch_dist
|
|
362
|
+
amps = soma_amp + branch_amps
|
|
363
|
+
popt, _ = curve_fit(exp_decay, dist, amps)
|
|
364
|
+
return popt, False
|
|
365
|
+
except RuntimeError:
|
|
366
|
+
return None, True
|
|
347
367
|
|
|
348
368
|
def validate(self, soma_amp, dend_amps, dend_dist, apic_amps, apic_dist):
|
|
349
369
|
"""Check that the exponential fit is decaying."""
|
|
350
370
|
validated = True
|
|
351
371
|
notes = ""
|
|
352
|
-
popt_dend,
|
|
372
|
+
popt_dend, dend_fit_error = self.fit(soma_amp, dend_amps, dend_dist)
|
|
373
|
+
popt_apic, apic_fit_error = self.fit(soma_amp, apic_amps, apic_dist)
|
|
374
|
+
if dend_fit_error or apic_fit_error:
|
|
375
|
+
logger.debug("Fitting error occurred.")
|
|
376
|
+
validated = False
|
|
377
|
+
notes += "Validation failed: Fitting error occurred.\n"
|
|
378
|
+
return validated, notes
|
|
379
|
+
|
|
353
380
|
if dend_amps is not None:
|
|
354
381
|
plt.cla()
|
|
355
382
|
plt.plot([0], soma_amp, '.')
|
|
@@ -391,7 +418,8 @@ class BPAP:
|
|
|
391
418
|
output_fname="bpap.pdf",
|
|
392
419
|
):
|
|
393
420
|
"""Plot the results of the BPAP analysis."""
|
|
394
|
-
popt_dend,
|
|
421
|
+
popt_dend, _ = self.fit(soma_amp, dend_amps, dend_dist)
|
|
422
|
+
popt_apic, _ = self.fit(soma_amp, apic_amps, apic_dist)
|
|
395
423
|
|
|
396
424
|
outpath = pathlib.Path(output_dir) / output_fname
|
|
397
425
|
fig, ax1 = plt.subplots(figsize=(10, 6))
|
|
@@ -337,7 +337,7 @@ def rin_test(rin):
|
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
|
|
340
|
-
def iv_test(template_params, rheobase, out_dir, spike_threshold_voltage=-30
|
|
340
|
+
def iv_test(template_params, rheobase, out_dir, spike_threshold_voltage=-30., n_processes=None):
|
|
341
341
|
"""IV curve should have a positive slope."""
|
|
342
342
|
name = "Simulatable Neuron IV Curve Validation"
|
|
343
343
|
amps, steady_states = compute_plot_iv_curve(
|
|
@@ -348,7 +348,9 @@ def iv_test(template_params, rheobase, out_dir, spike_threshold_voltage=-30.):
|
|
|
348
348
|
show_figure=False,
|
|
349
349
|
save_figure=True,
|
|
350
350
|
output_dir=out_dir,
|
|
351
|
-
output_fname="iv_curve.pdf"
|
|
351
|
+
output_fname="iv_curve.pdf",
|
|
352
|
+
n_processes=n_processes,
|
|
353
|
+
)
|
|
352
354
|
|
|
353
355
|
outpath = pathlib.Path(out_dir) / "iv_curve.pdf"
|
|
354
356
|
|
|
@@ -375,7 +377,7 @@ def iv_test(template_params, rheobase, out_dir, spike_threshold_voltage=-30.):
|
|
|
375
377
|
}
|
|
376
378
|
|
|
377
379
|
|
|
378
|
-
def fi_test(template_params, rheobase, out_dir, spike_threshold_voltage=-30
|
|
380
|
+
def fi_test(template_params, rheobase, out_dir, spike_threshold_voltage=-30., n_processes=None):
|
|
379
381
|
"""FI curve should have a positive slope."""
|
|
380
382
|
name = "Simulatable Neuron FI Curve Validation"
|
|
381
383
|
amps, spike_counts = compute_plot_fi_curve(
|
|
@@ -386,7 +388,9 @@ def fi_test(template_params, rheobase, out_dir, spike_threshold_voltage=-30.):
|
|
|
386
388
|
show_figure=False,
|
|
387
389
|
save_figure=True,
|
|
388
390
|
output_dir=out_dir,
|
|
389
|
-
output_fname="fi_curve.pdf"
|
|
391
|
+
output_fname="fi_curve.pdf",
|
|
392
|
+
n_processes=n_processes,
|
|
393
|
+
)
|
|
390
394
|
|
|
391
395
|
outpath = pathlib.Path(out_dir) / "fi_curve.pdf"
|
|
392
396
|
|
|
@@ -448,7 +452,8 @@ def run_validations(
|
|
|
448
452
|
spike_threshold_voltage=-30,
|
|
449
453
|
v_init=-80.0,
|
|
450
454
|
celsius=34.0,
|
|
451
|
-
output_dir="./memodel_validation_figures"
|
|
455
|
+
output_dir="./memodel_validation_figures",
|
|
456
|
+
n_processes=None,
|
|
452
457
|
):
|
|
453
458
|
"""Run all the validations on the cell.
|
|
454
459
|
|
|
@@ -459,6 +464,9 @@ def run_validations(
|
|
|
459
464
|
v_init: Initial membrane potential. Default is -80.0 mV.
|
|
460
465
|
celsius: Temperature in Celsius. Default is 34.0.
|
|
461
466
|
output_dir (str): The directory to save the validation figures.
|
|
467
|
+
n_processes (int, optional): The number of processes to use for parallel execution
|
|
468
|
+
in IV and FI curves computation. If None or higher than the number of steps,
|
|
469
|
+
then it will use the number of steps as the number of processes instead.
|
|
462
470
|
"""
|
|
463
471
|
out_dir = pathlib.Path(output_dir) / cell_name
|
|
464
472
|
out_dir.mkdir(parents=True, exist_ok=True)
|
|
@@ -484,41 +492,68 @@ def run_validations(
|
|
|
484
492
|
)
|
|
485
493
|
|
|
486
494
|
logger.debug("Running validations...")
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
495
|
+
from bluecellulab.utils import NestedPool
|
|
496
|
+
val_n_processes = n_processes if n_processes is not None else 7
|
|
497
|
+
with NestedPool(processes=val_n_processes) as pool:
|
|
498
|
+
# Validation 1: Spiking Test
|
|
499
|
+
spiking_test_result_future = pool.apply_async(
|
|
500
|
+
spiking_test,
|
|
501
|
+
(cell.template_params, rheobase, out_dir, spike_threshold_voltage)
|
|
502
|
+
)
|
|
491
503
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
504
|
+
# Validation 2: Depolarization Block Test
|
|
505
|
+
depolarization_block_result_future = pool.apply_async(
|
|
506
|
+
depolarization_block_test,
|
|
507
|
+
(cell.template_params, rheobase, out_dir)
|
|
508
|
+
)
|
|
496
509
|
|
|
497
|
-
|
|
498
|
-
|
|
510
|
+
# Validation 3: Backpropagating AP Test
|
|
511
|
+
bpap_result_future = pool.apply_async(
|
|
512
|
+
bpap_test,
|
|
513
|
+
(cell.template_params, rheobase, out_dir)
|
|
514
|
+
)
|
|
499
515
|
|
|
500
|
-
|
|
501
|
-
|
|
516
|
+
# Validation 4: Postsynaptic Potential Test
|
|
517
|
+
# We have to wait for ProbAMPANMDA_EMS to be present in entitycore to implement this test
|
|
502
518
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
519
|
+
# Validation 5: AIS Spiking Test
|
|
520
|
+
ais_spiking_test_result_future = pool.apply_async(
|
|
521
|
+
ais_spiking_test,
|
|
522
|
+
(cell.template_params, rheobase, out_dir, spike_threshold_voltage)
|
|
523
|
+
)
|
|
507
524
|
|
|
508
|
-
|
|
509
|
-
|
|
525
|
+
# Validation 6: Hyperpolarization Test
|
|
526
|
+
hyperpolarization_result_future = pool.apply_async(
|
|
527
|
+
hyperpolarization_test,
|
|
528
|
+
(cell.template_params, rheobase, out_dir)
|
|
529
|
+
)
|
|
510
530
|
|
|
511
|
-
|
|
512
|
-
|
|
531
|
+
# Validation 7: Rin Test
|
|
532
|
+
rin_result_future = pool.apply_async(
|
|
533
|
+
rin_test,
|
|
534
|
+
(rin,)
|
|
535
|
+
)
|
|
513
536
|
|
|
537
|
+
# Validation 10: Thumbnail Test
|
|
538
|
+
thumbnail_result_future = pool.apply_async(
|
|
539
|
+
thumbnail_test,
|
|
540
|
+
(cell.template_params, rheobase, out_dir)
|
|
541
|
+
)
|
|
542
|
+
|
|
543
|
+
spiking_test_result = spiking_test_result_future.get()
|
|
544
|
+
depolarization_block_result = depolarization_block_result_future.get()
|
|
545
|
+
bpap_result = bpap_result_future.get()
|
|
546
|
+
ais_spiking_test_result = ais_spiking_test_result_future.get()
|
|
547
|
+
hyperpolarization_result = hyperpolarization_result_future.get()
|
|
548
|
+
rin_result = rin_result_future.get()
|
|
549
|
+
thumbnail_result = thumbnail_result_future.get()
|
|
550
|
+
|
|
551
|
+
# IV and FI tests are outside of nestedpool, because they use multiprocessing internaly
|
|
514
552
|
# Validation 8: IV Test
|
|
515
|
-
iv_test_result = iv_test(cell.template_params, rheobase, out_dir, spike_threshold_voltage)
|
|
553
|
+
iv_test_result = iv_test(cell.template_params, rheobase, out_dir, spike_threshold_voltage, n_processes)
|
|
516
554
|
|
|
517
555
|
# Validation 9: FI Test
|
|
518
|
-
fi_test_result = fi_test(cell.template_params, rheobase, out_dir, spike_threshold_voltage)
|
|
519
|
-
|
|
520
|
-
# Validation 10: Thumbnail Test
|
|
521
|
-
thumbnail_result = thumbnail_test(cell.template_params, rheobase, out_dir)
|
|
556
|
+
fi_test_result = fi_test(cell.template_params, rheobase, out_dir, spike_threshold_voltage, n_processes)
|
|
522
557
|
|
|
523
558
|
return {
|
|
524
559
|
"memodel_properties": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/circuit_access/definition.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/config/bluepy_simulation_config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/circuit/config/sonata_simulation_config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bluecellulab-2.6.62 → bluecellulab-2.6.64}/bluecellulab/stimulus/circuit_stimulus_definitions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|