bluecellulab 2.6.50__tar.gz → 2.6.51__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.50 → bluecellulab-2.6.51}/PKG-INFO +1 -1
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/analysis/analysis.py +48 -34
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/utils.py +26 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/validation/validation.py +72 -44
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab.egg-info/PKG-INFO +1 -1
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/.compile_mod.sh +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/.gitattributes +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/.github/dependabot.yml +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/.github/workflows/release.yml +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/.github/workflows/test.yml +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/.gitignore +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/.gitlab-ci.yml +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/.readthedocs.yml +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/.zenodo.json +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/AUTHORS.txt +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/CHANGELOG.rst +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/CITATION.cff +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/CONTRIBUTING.rst +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/LICENSE +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/MANIFEST.in +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/Makefile +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/README.rst +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/__init__.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/analysis/__init__.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/analysis/inject_sequence.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/analysis/plotting.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/analysis/utils.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/__init__.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/ballstick/__init__.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/ballstick/emodel.hoc +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/ballstick/morphology.asc +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/cell_dict.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/core.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/injector.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/plotting.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/random.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/recording.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/section_distance.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/serialized_sections.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/sonata_proxy.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/stimuli_generator.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/cell/template.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/__init__.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/circuit_access/__init__.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/circuit_access/bluepy_circuit_access.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/circuit_access/definition.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/circuit_access/sonata_circuit_access.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/config/__init__.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/config/bluepy_simulation_config.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/config/definition.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/config/sections.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/config/sonata_simulation_config.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/format.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/iotools.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/node_id.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/simulation_access.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/synapse_properties.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/validate.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit_simulation.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/connection.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/dendrogram.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/exceptions.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/graph.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/hoc/Cell.hoc +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/hoc/RNGSettings.hoc +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/hoc/TDistFunc.hoc +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/hoc/TStim.hoc +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/hoc/fileUtils.hoc +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/importer.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/neuron_interpreter.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/plotwindow.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/psection.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/psegment.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/rngsettings.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/simulation/__init__.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/simulation/neuron_globals.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/simulation/parallel.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/simulation/simulation.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/stimulus/__init__.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/stimulus/circuit_stimulus_definitions.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/stimulus/factory.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/stimulus/stimulus.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/synapse/__init__.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/synapse/synapse_factory.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/synapse/synapse_types.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/tools.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/type_aliases.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/verbosity.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab.egg-info/SOURCES.txt +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab.egg-info/dependency_links.txt +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab.egg-info/requires.txt +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab.egg-info/top_level.txt +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/docs/Makefile +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/docs/images/voltage-readme.png +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/docs/make.bat +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/docs/requirements_docs.txt +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/docs/source/_static/.gitkeep +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/docs/source/api.rst +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/docs/source/changelog.rst +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/docs/source/compiling-mechanisms.rst +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/docs/source/conf.py +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/docs/source/contributing.rst +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/docs/source/index.rst +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/docs/source/list_of_stim.rst +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/docs/source/logo/BlueCelluLabBanner.jpg +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/pyproject.toml +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/setup.cfg +0 -0
- {bluecellulab-2.6.50 → bluecellulab-2.6.51}/tox.ini +0 -0
|
@@ -4,14 +4,17 @@ 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
|
|
13
15
|
import seaborn as sns
|
|
14
16
|
|
|
17
|
+
|
|
15
18
|
from bluecellulab import Cell
|
|
16
19
|
from bluecellulab.analysis.inject_sequence import run_stimulus
|
|
17
20
|
from bluecellulab.analysis.plotting import plot_iv_curve, plot_fi_curve
|
|
@@ -87,30 +90,35 @@ def compute_plot_iv_curve(cell,
|
|
|
87
90
|
|
|
88
91
|
list_amp = np.linspace(rheobase - 2, rheobase - 0.1, nb_bins) # [nA]
|
|
89
92
|
|
|
90
|
-
steps = []
|
|
91
|
-
times = []
|
|
92
|
-
voltages = []
|
|
93
93
|
# inject step current and record voltage response
|
|
94
94
|
stim_factory = StimulusFactory(dt=0.1)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
95
|
+
steps = [
|
|
96
|
+
stim_factory.step(pre_delay=stim_start, duration=duration, post_delay=post_delay, amplitude=amp)
|
|
97
|
+
for amp in list_amp
|
|
98
|
+
]
|
|
99
|
+
|
|
100
|
+
with Pool(len(steps)) as p:
|
|
101
|
+
recordings = p.starmap(
|
|
102
|
+
run_stimulus,
|
|
103
|
+
zip(
|
|
104
|
+
repeat(cell.template_params),
|
|
105
|
+
steps,
|
|
106
|
+
repeat(injecting_section),
|
|
107
|
+
repeat(injecting_segment),
|
|
108
|
+
repeat(True), # cvode
|
|
109
|
+
repeat(True), # add_hypamp
|
|
110
|
+
repeat(recording_section),
|
|
111
|
+
repeat(recording_segment),
|
|
112
|
+
)
|
|
113
|
+
)
|
|
106
114
|
|
|
107
115
|
steady_states = []
|
|
108
116
|
# compute steady state response
|
|
109
117
|
efel.set_setting('Threshold', threshold_voltage)
|
|
110
|
-
for
|
|
118
|
+
for recording in recordings:
|
|
111
119
|
trace = {
|
|
112
|
-
'T':
|
|
113
|
-
'V': voltage,
|
|
120
|
+
'T': recording.time,
|
|
121
|
+
'V': recording.voltage,
|
|
114
122
|
'stim_start': [stim_start],
|
|
115
123
|
'stim_end': [stim_start + duration]
|
|
116
124
|
}
|
|
@@ -194,24 +202,30 @@ def compute_plot_fi_curve(cell,
|
|
|
194
202
|
rheobase = calculate_rheobase(cell=cell, section=injecting_section, segx=injecting_segment)
|
|
195
203
|
|
|
196
204
|
list_amp = np.linspace(rheobase, max_current, nb_bins) # [nA]
|
|
197
|
-
steps = []
|
|
198
|
-
spikes = []
|
|
199
|
-
# inject step current and record spike response
|
|
200
205
|
stim_factory = StimulusFactory(dt=0.1)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
206
|
+
steps = [
|
|
207
|
+
stim_factory.step(pre_delay=stim_start, duration=duration, post_delay=post_delay, amplitude=amp)
|
|
208
|
+
for amp in list_amp
|
|
209
|
+
]
|
|
210
|
+
|
|
211
|
+
with Pool(len(steps)) as p:
|
|
212
|
+
recordings = p.starmap(
|
|
213
|
+
run_stimulus,
|
|
214
|
+
zip(
|
|
215
|
+
repeat(cell.template_params),
|
|
216
|
+
steps,
|
|
217
|
+
repeat(injecting_section),
|
|
218
|
+
repeat(injecting_segment),
|
|
219
|
+
repeat(True), # cvode
|
|
220
|
+
repeat(True), # add_hypamp
|
|
221
|
+
repeat(recording_section),
|
|
222
|
+
repeat(recording_segment),
|
|
223
|
+
repeat(True), # enable_spike_detection
|
|
224
|
+
repeat(threshold_voltage), # threshold_spike_detection
|
|
225
|
+
)
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
spike_count = [len(recording.spike) for recording in recordings]
|
|
215
229
|
|
|
216
230
|
plot_fi_curve(list_amp,
|
|
217
231
|
spike_count,
|
|
@@ -4,6 +4,8 @@ from __future__ import annotations
|
|
|
4
4
|
import contextlib
|
|
5
5
|
import io
|
|
6
6
|
import json
|
|
7
|
+
import multiprocessing
|
|
8
|
+
from multiprocessing import pool
|
|
7
9
|
|
|
8
10
|
import numpy as np
|
|
9
11
|
|
|
@@ -56,3 +58,27 @@ class NumpyEncoder(json.JSONEncoder):
|
|
|
56
58
|
elif isinstance(obj, np.ndarray):
|
|
57
59
|
return obj.tolist()
|
|
58
60
|
return json.JSONEncoder.default(self, obj)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class NoDaemonProcess(multiprocessing.Process):
|
|
64
|
+
"""Class that represents a non-daemon process."""
|
|
65
|
+
|
|
66
|
+
# pylint: disable=dangerous-default-value
|
|
67
|
+
|
|
68
|
+
def __init__(self, group=None, target=None, name=None, args=(), kwargs={}):
|
|
69
|
+
"""Ensures group=None, for macosx."""
|
|
70
|
+
super().__init__(group=None, target=target, name=name, args=args, kwargs=kwargs)
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def daemon(self):
|
|
74
|
+
return False
|
|
75
|
+
|
|
76
|
+
@daemon.setter
|
|
77
|
+
def daemon(self, val):
|
|
78
|
+
pass
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class NestedPool(pool.Pool): # pylint: disable=abstract-method
|
|
82
|
+
"""Class that represents a MultiProcessing nested pool."""
|
|
83
|
+
|
|
84
|
+
Process = NoDaemonProcess
|
|
@@ -24,6 +24,7 @@ from bluecellulab.analysis.analysis import compute_plot_fi_curve
|
|
|
24
24
|
from bluecellulab.analysis.analysis import compute_plot_iv_curve
|
|
25
25
|
from bluecellulab.analysis.inject_sequence import run_multirecordings_stimulus
|
|
26
26
|
from bluecellulab.analysis.inject_sequence import run_stimulus
|
|
27
|
+
from bluecellulab.cell.core import Cell
|
|
27
28
|
from bluecellulab.stimulus.factory import IDRestTimings
|
|
28
29
|
from bluecellulab.stimulus.factory import StimulusFactory
|
|
29
30
|
from bluecellulab.tools import calculate_input_resistance
|
|
@@ -79,12 +80,12 @@ def plot_traces(recordings, out_dir, fname, title, labels=None, xlim=None):
|
|
|
79
80
|
return outpath
|
|
80
81
|
|
|
81
82
|
|
|
82
|
-
def spiking_test(
|
|
83
|
+
def spiking_test(template_params, rheobase, out_dir, spike_threshold_voltage=-30.):
|
|
83
84
|
"""Spiking test: cell should spike."""
|
|
84
85
|
stim_factory = StimulusFactory(dt=1.0)
|
|
85
86
|
step_stimulus = stim_factory.idrest(threshold_current=rheobase, threshold_percentage=200)
|
|
86
87
|
recording = run_stimulus(
|
|
87
|
-
|
|
88
|
+
template_params,
|
|
88
89
|
step_stimulus,
|
|
89
90
|
"soma[0]",
|
|
90
91
|
0.5,
|
|
@@ -111,13 +112,13 @@ def spiking_test(cell, rheobase, out_dir, spike_threshold_voltage=-30.):
|
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
|
|
114
|
-
def depolarization_block_test(
|
|
115
|
+
def depolarization_block_test(template_params, rheobase, out_dir):
|
|
115
116
|
"""Depolarization block test: no depolarization block should be detected."""
|
|
116
117
|
# Run the stimulus
|
|
117
118
|
stim_factory = StimulusFactory(dt=1.0)
|
|
118
119
|
step_stimulus = stim_factory.idrest(threshold_current=rheobase, threshold_percentage=200)
|
|
119
120
|
recording = run_stimulus(
|
|
120
|
-
|
|
121
|
+
template_params,
|
|
121
122
|
step_stimulus,
|
|
122
123
|
"soma[0]",
|
|
123
124
|
0.5,
|
|
@@ -151,16 +152,16 @@ def depolarization_block_test(cell, rheobase, out_dir):
|
|
|
151
152
|
}
|
|
152
153
|
|
|
153
154
|
|
|
154
|
-
def bpap_test(
|
|
155
|
+
def bpap_test(template_params, rheobase, out_dir="./"):
|
|
155
156
|
"""Back-propagating action potential test: exponential fit should decay.
|
|
156
157
|
|
|
157
158
|
Args:
|
|
158
|
-
|
|
159
|
+
template_params (dict): The template parameters for creating the cell.
|
|
159
160
|
rheobase (float): The rheobase current to use for the test.
|
|
160
161
|
out_dir (str): Directory to save the figure.
|
|
161
162
|
"""
|
|
162
163
|
amplitude = 10. * rheobase # Use 1000% of the rheobase current
|
|
163
|
-
bpap = BPAP(
|
|
164
|
+
bpap = BPAP(Cell.from_template_parameters(template_params))
|
|
164
165
|
bpap.run(duration=1500, amplitude=amplitude)
|
|
165
166
|
soma_amp, dend_amps, dend_dist, apic_amps, apic_dist = bpap.get_amplitudes_and_distances()
|
|
166
167
|
validated, notes = bpap.validate(soma_amp, dend_amps, dend_dist, apic_amps, apic_dist)
|
|
@@ -190,11 +191,11 @@ def bpap_test(cell, rheobase, out_dir="./"):
|
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
|
|
193
|
-
def ais_spiking_test(
|
|
194
|
+
def ais_spiking_test(template_params, rheobase, out_dir, spike_threshold_voltage=-30.):
|
|
194
195
|
"""AIS spiking test: axon should spike before soma."""
|
|
195
196
|
name = "Simulatable Neuron AIS Spiking Validation"
|
|
196
197
|
# Check that the cell has an axon
|
|
197
|
-
if len(
|
|
198
|
+
if len(Cell.from_template_parameters(template_params).axonal) == 0:
|
|
198
199
|
return {
|
|
199
200
|
"name": name,
|
|
200
201
|
"passed": True,
|
|
@@ -206,7 +207,7 @@ def ais_spiking_test(cell, rheobase, out_dir, spike_threshold_voltage=-30.):
|
|
|
206
207
|
stim_factory = StimulusFactory(dt=1.0)
|
|
207
208
|
step_stimulus = stim_factory.idrest(threshold_current=rheobase, threshold_percentage=200)
|
|
208
209
|
recordings = run_multirecordings_stimulus(
|
|
209
|
-
|
|
210
|
+
template_params,
|
|
210
211
|
step_stimulus,
|
|
211
212
|
"soma[0]",
|
|
212
213
|
0.5,
|
|
@@ -259,14 +260,14 @@ def ais_spiking_test(cell, rheobase, out_dir, spike_threshold_voltage=-30.):
|
|
|
259
260
|
}
|
|
260
261
|
|
|
261
262
|
|
|
262
|
-
def hyperpolarization_test(
|
|
263
|
+
def hyperpolarization_test(template_params, rheobase, out_dir):
|
|
263
264
|
"""Hyperpolarization test: hyperpolarized voltage should be lower than RMP."""
|
|
264
265
|
name = "Simulatable Neuron Hyperpolarization Validation"
|
|
265
266
|
# Run the stimulus
|
|
266
267
|
stim_factory = StimulusFactory(dt=1.0)
|
|
267
268
|
step_stimulus = stim_factory.iv(threshold_current=rheobase, threshold_percentage=-40)
|
|
268
269
|
recording = run_stimulus(
|
|
269
|
-
|
|
270
|
+
template_params,
|
|
270
271
|
step_stimulus,
|
|
271
272
|
"soma[0]",
|
|
272
273
|
0.5,
|
|
@@ -331,11 +332,11 @@ def rin_test(rin):
|
|
|
331
332
|
}
|
|
332
333
|
|
|
333
334
|
|
|
334
|
-
def iv_test(
|
|
335
|
+
def iv_test(template_params, rheobase, out_dir, spike_threshold_voltage=-30.):
|
|
335
336
|
"""IV curve should have a positive slope."""
|
|
336
337
|
name = "Simulatable Neuron IV Curve Validation"
|
|
337
338
|
amps, steady_states = compute_plot_iv_curve(
|
|
338
|
-
|
|
339
|
+
Cell.from_template_parameters(template_params),
|
|
339
340
|
rheobase=rheobase,
|
|
340
341
|
threshold_voltage=spike_threshold_voltage,
|
|
341
342
|
nb_bins=5,
|
|
@@ -369,11 +370,11 @@ def iv_test(cell, rheobase, out_dir, spike_threshold_voltage=-30.):
|
|
|
369
370
|
}
|
|
370
371
|
|
|
371
372
|
|
|
372
|
-
def fi_test(
|
|
373
|
+
def fi_test(template_params, rheobase, out_dir, spike_threshold_voltage=-30.):
|
|
373
374
|
"""FI curve should have a positive slope."""
|
|
374
375
|
name = "Simulatable Neuron FI Curve Validation"
|
|
375
376
|
amps, spike_counts = compute_plot_fi_curve(
|
|
376
|
-
|
|
377
|
+
Cell.from_template_parameters(template_params),
|
|
377
378
|
rheobase=rheobase,
|
|
378
379
|
threshold_voltage=spike_threshold_voltage,
|
|
379
380
|
nb_bins=5,
|
|
@@ -421,7 +422,6 @@ def run_validations(
|
|
|
421
422
|
out_dir = pathlib.Path(output_dir) / cell_name
|
|
422
423
|
out_dir.mkdir(parents=True, exist_ok=True)
|
|
423
424
|
|
|
424
|
-
# cell = Cell.from_template_parameters(template_params)
|
|
425
425
|
# get me-model properties
|
|
426
426
|
holding_current = cell.hypamp if cell.hypamp else 0.0
|
|
427
427
|
if cell.threshold:
|
|
@@ -437,41 +437,69 @@ def run_validations(
|
|
|
437
437
|
emodel_properties=cell.template_params.emodel_properties,
|
|
438
438
|
)
|
|
439
439
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
440
|
+
logger.debug("Running validations...")
|
|
441
|
+
from bluecellulab.utils import NestedPool
|
|
442
|
+
with NestedPool(processes=8) as pool:
|
|
443
|
+
# Validation 1: Spiking Test
|
|
444
|
+
spiking_test_result_future = pool.apply_async(
|
|
445
|
+
spiking_test,
|
|
446
|
+
(cell.template_params, rheobase, out_dir, spike_threshold_voltage)
|
|
447
|
+
)
|
|
443
448
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
449
|
+
# Validation 2: Depolarization Block Test
|
|
450
|
+
depolarization_block_result_future = pool.apply_async(
|
|
451
|
+
depolarization_block_test,
|
|
452
|
+
(cell.template_params, rheobase, out_dir)
|
|
453
|
+
)
|
|
447
454
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
455
|
+
# Validation 3: Backpropagating AP Test
|
|
456
|
+
bpap_result_future = pool.apply_async(
|
|
457
|
+
bpap_test,
|
|
458
|
+
(cell.template_params, rheobase, out_dir)
|
|
459
|
+
)
|
|
451
460
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
# We have to wait for ProbAMPANMDA_EMS to be present in entitycore to implement this test
|
|
461
|
+
# Validation 4: Postsynaptic Potential Test
|
|
462
|
+
# We have to wait for ProbAMPANMDA_EMS to be present in entitycore to implement this test
|
|
455
463
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
464
|
+
# Validation 5: AIS Spiking Test
|
|
465
|
+
ais_spiking_test_result_future = pool.apply_async(
|
|
466
|
+
ais_spiking_test,
|
|
467
|
+
(cell.template_params, rheobase, out_dir, spike_threshold_voltage)
|
|
468
|
+
)
|
|
459
469
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
470
|
+
# Validation 6: Hyperpolarization Test
|
|
471
|
+
hyperpolarization_result_future = pool.apply_async(
|
|
472
|
+
hyperpolarization_test,
|
|
473
|
+
(cell.template_params, rheobase, out_dir)
|
|
474
|
+
)
|
|
463
475
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
476
|
+
# Validation 7: Rin Test
|
|
477
|
+
rin_result_future = pool.apply_async(
|
|
478
|
+
rin_test,
|
|
479
|
+
(rin,)
|
|
480
|
+
)
|
|
481
|
+
|
|
482
|
+
# # Validation 8: IV Test
|
|
483
|
+
iv_test_result_future = pool.apply_async(
|
|
484
|
+
iv_test,
|
|
485
|
+
(cell.template_params, rheobase, out_dir, spike_threshold_voltage)
|
|
486
|
+
)
|
|
467
487
|
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
488
|
+
# # Validation 9: FI Test
|
|
489
|
+
fi_test_result_future = pool.apply_async(
|
|
490
|
+
fi_test,
|
|
491
|
+
(cell.template_params, rheobase, out_dir, spike_threshold_voltage)
|
|
492
|
+
)
|
|
471
493
|
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
494
|
+
# Wait for all validations to complete
|
|
495
|
+
spiking_test_result = spiking_test_result_future.get()
|
|
496
|
+
depolarization_block_result = depolarization_block_result_future.get()
|
|
497
|
+
bpap_result = bpap_result_future.get()
|
|
498
|
+
ais_spiking_test_result = ais_spiking_test_result_future.get()
|
|
499
|
+
hyperpolarization_result = hyperpolarization_result_future.get()
|
|
500
|
+
rin_result = rin_result_future.get()
|
|
501
|
+
iv_test_result = iv_test_result_future.get()
|
|
502
|
+
fi_test_result = fi_test_result_future.get()
|
|
475
503
|
|
|
476
504
|
return {
|
|
477
505
|
"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.50 → bluecellulab-2.6.51}/bluecellulab/circuit/circuit_access/definition.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bluecellulab-2.6.50 → bluecellulab-2.6.51}/bluecellulab/circuit/config/bluepy_simulation_config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bluecellulab-2.6.50 → bluecellulab-2.6.51}/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
|
{bluecellulab-2.6.50 → bluecellulab-2.6.51}/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
|