Skip to content

Commit

Permalink
Adapted notebooks to run with public thalamus circuit in Zenodo (#153)
Browse files Browse the repository at this point in the history
* Adapted notebooks to run with public thalamus circuit in Zenodo
* Update doc/source/notebooks/02_node_populations.ipynb
* Updated text on node populations names
  • Loading branch information
elisabettai committed Mar 17, 2022
1 parent 778c6d9 commit 1768a62
Show file tree
Hide file tree
Showing 4 changed files with 352 additions and 276 deletions.
86 changes: 63 additions & 23 deletions doc/source/notebooks/01_circuits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,34 @@
"In this tutorial we cover how to load a SONATA circuit using BlueBrain SNAP and access its properties."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Downloading a circuit\n",
"\n",
"As a preliminary step, we download a Sonata circuit. You can learn more about the scientific aspects of this circuit in this [preprint](https://www.biorxiv.org/content/10.1101/2022.02.28.482273)."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"# This step might take some minutes (large file size)\n",
"\n",
"from urllib.request import urlretrieve\n",
"from zipfile import ZipFile\n",
"\n",
"url = \"https://zenodo.org/record/6259750/files/thalamus_microcircuit.zip?download=1\"\n",
"extract_dir=\".\"\n",
"\n",
"zip_path, _ = urlretrieve(url)\n",
"with ZipFile(zip_path, \"r\") as f:\n",
" f.extractall(extract_dir)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -18,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -35,11 +63,11 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"circuit_path = \"/gpfs/bbp.cscs.ch/project/proj30/hippocampus/single_column/sonata/struct_circuit_config.json\"\n",
"circuit_path = \"sonata/circuit_sonata.json\"\n",
"circuit = bluepysnap.Circuit(circuit_path)"
]
},
Expand All @@ -57,22 +85,34 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'components': {'morphologies_dir': '/gpfs/bbp.cscs.ch/project/proj30/hippocampus/single_column/sonata/components/morphologies',\n",
" 'biophysical_neuron_models_dir': '/gpfs/bbp.cscs.ch/project/proj30/hippocampus/single_column/sonata/components/biophysical_neuron_models'},\n",
" 'node_sets_file': '/gpfs/bbp.cscs.ch/project/proj30/hippocampus/single_column/sonata/node_sets.json',\n",
" 'networks': {'nodes': [{'nodes_file': '/gpfs/bbp.cscs.ch/project/proj30/hippocampus/single_column/sonata/networks/nodes/All/nodes.h5',\n",
" 'node_types_file': None}],\n",
" 'edges': [{'edges_file': '/gpfs/bbp.cscs.ch/project/proj30/hippocampus/single_column/sonata/networks/edges/structural/All/edges.h5',\n",
" 'edge_types_file': None}]}}"
"{'version': 2,\n",
" 'node_sets_file': '/home/elisabetta/BBP/snap/doc/source/notebooks/sonata/networks/nodes/node_sets.json',\n",
" 'networks': {'nodes': [{'nodes_file': '/home/elisabetta/BBP/snap/doc/source/notebooks/sonata/networks/nodes/thalamus_neurons/nodes.h5',\n",
" 'populations': {'thalamus_neurons': {'type': 'biophysical',\n",
" 'biophysical_neuron_models_dir': '/gpfs/bbp.cscs.ch/project/proj82/home/iavarone/modelmanagement/20191105/memodels/hoc',\n",
" 'alternate_morphologies': {'neurolucida-asc': '/gpfs/bbp.cscs.ch/project/proj82/home/iavarone/morphology_release/20191031/ascii',\n",
" 'h5v1': '/gpfs/bbp.cscs.ch/project/proj82/home/iavarone/morphology_release/20191031/h5'}}}},\n",
" {'nodes_file': '/home/elisabetta/BBP/snap/doc/source/notebooks/sonata/networks/nodes/CorticoThalamic_projections/nodes.h5',\n",
" 'populations': {'CorticoThalamic_projections': {'type': 'virtual'}}},\n",
" {'nodes_file': '/home/elisabetta/BBP/snap/doc/source/notebooks/sonata/networks/nodes/MedialLemniscus_projections/nodes.h5',\n",
" 'populations': {'MedialLemniscus_projections': {'type': 'virtual'}}}],\n",
" 'edges': [{'edges_file': '/home/elisabetta/BBP/snap/doc/source/notebooks/sonata/networks/edges/thalamus_neurons__thalamus_neurons__chemical/edges.h5',\n",
" 'populations': {'thalamus_neurons__thalamus_neurons__chemical': {'type': 'chemical'}}},\n",
" {'edges_file': '/home/elisabetta/BBP/snap/doc/source/notebooks/sonata/networks/edges/thalamus_neurons__thalamus_neurons__electrical_synapse/edges.h5',\n",
" 'populations': {'thalamus_neurons__thalamus_neurons__electrical_synapse': {'type': 'electrical'}}},\n",
" {'edges_file': '/home/elisabetta/BBP/snap/doc/source/notebooks/sonata/networks/edges/MedialLemniscus_projections__thalamus_neurons__chemical/edges.h5',\n",
" 'populations': {'MedialLemniscus_projections__thalamus_neurons__chemical': {'type': 'chemical'}}},\n",
" {'edges_file': '/home/elisabetta/BBP/snap/doc/source/notebooks/sonata/networks/edges/CorticoThalamic_projections__thalamus_neurons__chemical/edges.h5',\n",
" 'populations': {'CorticoThalamic_projections__thalamus_neurons__chemical': {'type': 'chemical'}}}]}}"
]
},
"execution_count": 3,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -83,16 +123,16 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<bluepysnap.nodes.Nodes at 0x7f8f24fd80d0>"
"<bluepysnap.nodes.Nodes at 0x7f0f10385280>"
]
},
"execution_count": 4,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -103,16 +143,16 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<bluepysnap.edges.Edges at 0x7f8f24fd8350>"
"<bluepysnap.edges.Edges at 0x7f0f10385250>"
]
},
"execution_count": 5,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -123,16 +163,16 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<bluepysnap.node_sets.NodeSets at 0x7f8f24fd8850>"
"<bluepysnap.node_sets.NodeSets at 0x7f0eddce1070>"
]
},
"execution_count": 6,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -153,7 +193,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -167,7 +207,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.12"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 1768a62

Please sign in to comment.