Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arbor-sim
arbor
Commits
6e1d0482
Unverified
Commit
6e1d0482
authored
4 years ago
by
Brent Huisman
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Docs: minor plot tweaking (#1184)
parent
e2bcc71e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/gs_single_cell.rst
+5
-4
5 additions, 4 deletions
doc/gs_single_cell.rst
doc/images/single_cell_model_result.svg
+358
-293
358 additions, 293 deletions
doc/images/single_cell_model_result.svg
python/example/single_cell_model.py
+3
-2
3 additions, 2 deletions
python/example/single_cell_model.py
with
366 additions
and
299 deletions
doc/gs_single_cell.rst
+
5
−
4
View file @
6e1d0482
...
...
@@ -22,7 +22,7 @@ Single compartment cell with HH dynamics
The most trivial representation of a cell in Arbor is to model the entire cell as a
cylinder. The following example shows the steps required to construct a model of a
cylindrical cell with radius 3 μm, Hodgkin–Huxley dynamics and a current clamp stimulus,
then run the model for
10
0 ms.
then run the model for
3
0 ms.
The first step is to construct the cell. In Arbor, the abstract representation used to
define a cell with branching "cable" morphology is a ``cable_cell``, which holds a
...
...
@@ -107,8 +107,8 @@ and provides an interface for recording potentials and running the simulation.
# (5) Attach voltage probe sampling at 10 kHz (every 0.1 ms).
m.probe('voltage', '"center"', frequency=10000)
# (6) Run simulation for
10
0 ms of simulated activity.
m.run(tfinal=
10
0)
# (6) Run simulation for
3
0 ms of simulated activity.
m.run(tfinal=
3
0)
Step **(4)** instantiates the :class:`arbor.single_cell_model<arbor.single_cell_model>`
with our single-compartment cell.
...
...
@@ -118,7 +118,7 @@ is used to record variables from the model. Three pieces of information are
provided: the type of quantity we want probed (voltage), the location where we want to
probe ('center'), and the frequency at which we want to sample (10kHz).
Finally, step **(6)** starts the actual simulation for a duration of
10
0 ms.
Finally, step **(6)** starts the actual simulation for a duration of
3
0 ms.
Results
----------------------------------------------------
...
...
@@ -139,6 +139,7 @@ spike_detector and a voltage probe. Let's see what they have produced!
# (8) Plot the recorded voltages over time.
import pandas, seaborn # You may have to pip install these.
seaborn.set_theme() # Apply some styling to the plot
df = pandas.DataFrame({'t/ms': m.traces[0].time, 'U/mV': m.traces[0].value})
seaborn.relplot(data=df, kind="line", x="t/ms", y="U/mV").savefig('single_cell_model_result.svg')
...
...
This diff is collapsed.
Click to expand it.
doc/images/single_cell_model_result.svg
+
358
−
293
View file @
6e1d0482
This diff is collapsed.
Click to expand it.
python/example/single_cell_model.py
+
3
−
2
View file @
6e1d0482
...
...
@@ -21,8 +21,8 @@ m = arbor.single_cell_model(cell)
# (5) Attach voltage probe sampling at 10 kHz (every 0.1 ms).
m
.
probe
(
'
voltage
'
,
'"
center
"'
,
frequency
=
10000
)
# (6) Run simulation for
10
0 ms of simulated activity.
m
.
run
(
tfinal
=
10
0
)
# (6) Run simulation for
3
0 ms of simulated activity.
m
.
run
(
tfinal
=
3
0
)
# (7) Print spike times, if any.
if
len
(
m
.
spikes
)
>
0
:
...
...
@@ -34,6 +34,7 @@ else:
# (8) Plot the recorded voltages over time.
import
pandas
,
seaborn
# You may have to pip install these.
seaborn
.
set_theme
()
# Apply some styling to the plot
df
=
pandas
.
DataFrame
({
'
t/ms
'
:
m
.
traces
[
0
].
time
,
'
U/mV
'
:
m
.
traces
[
0
].
value
})
seaborn
.
relplot
(
data
=
df
,
kind
=
"
line
"
,
x
=
"
t/ms
"
,
y
=
"
U/mV
"
).
savefig
(
'
single_cell_model_result.svg
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment