Skip to content

Commit

Permalink
Update notebooks due to libsonata additions
Browse files Browse the repository at this point in the history
  • Loading branch information
Joni Herttuainen committed Aug 26, 2022
1 parent 0a577e3 commit c021f6f
Showing 1 changed file with 67 additions and 24 deletions.
91 changes: 67 additions & 24 deletions doc/source/notebooks/01_circuits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,45 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We start by importing the `bluepysnap` package:"
"## 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": 1,
"metadata": {},
"outputs": [],
"source": [
"# This step might take some minutes (large file size)\n",
"\n",
"from urllib.request import urlretrieve\n",
"from pathlib import Path\n",
"from zipfile import ZipFile\n",
"\n",
"url = \"https://zenodo.org/record/6259750/files/thalamus_microcircuit.zip?download=1\"\n",
"extract_dir=\".\"\n",
"\n",
"circuit_path = Path('./sonata')\n",
"if not circuit_path.exists():\n",
" zip_path, _ = urlretrieve(url)\n",
" with ZipFile(zip_path, \"r\") as f:\n",
" f.extractall(extract_dir)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We start by importing the `bluepysnap` package:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import bluepysnap"
]
Expand All @@ -35,11 +66,11 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"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 +88,34 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"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}]}}"
"{'networks': {'edges': [{'edges_file': '/gpfs/bbp.cscs.ch/project/proj12/NSE/bluepysnap-functional-tests/sonata/networks/edges/thalamus_neurons__thalamus_neurons__chemical/edges.h5',\n",
" 'populations': {'thalamus_neurons__thalamus_neurons__chemical': {'type': 'chemical'}}},\n",
" {'edges_file': '/gpfs/bbp.cscs.ch/project/proj12/NSE/bluepysnap-functional-tests/sonata/networks/edges/thalamus_neurons__thalamus_neurons__electrical_synapse/edges.h5',\n",
" 'populations': {'thalamus_neurons__thalamus_neurons__electrical_synapse': {'type': 'electrical'}}},\n",
" {'edges_file': '/gpfs/bbp.cscs.ch/project/proj12/NSE/bluepysnap-functional-tests/sonata/networks/edges/MedialLemniscus_projections__thalamus_neurons__chemical/edges.h5',\n",
" 'populations': {'MedialLemniscus_projections__thalamus_neurons__chemical': {'type': 'chemical'}}},\n",
" {'edges_file': '/gpfs/bbp.cscs.ch/project/proj12/NSE/bluepysnap-functional-tests/sonata/networks/edges/CorticoThalamic_projections__thalamus_neurons__chemical/edges.h5',\n",
" 'populations': {'CorticoThalamic_projections__thalamus_neurons__chemical': {'type': 'chemical'}}}],\n",
" 'nodes': [{'nodes_file': '/gpfs/bbp.cscs.ch/project/proj12/NSE/bluepysnap-functional-tests/sonata/networks/nodes/thalamus_neurons/nodes.h5',\n",
" 'populations': {'thalamus_neurons': {'alternate_morphologies': {'h5v1': '/gpfs/bbp.cscs.ch/project/proj82/home/iavarone/morphology_release/20191031/09_CloneMorphologies-h5v1',\n",
" 'neurolucida-asc': '/gpfs/bbp.cscs.ch/project/proj82/home/iavarone/morphology_release/20191031/09_CloneMorphologies-ASC'},\n",
" 'biophysical_neuron_models_dir': '/gpfs/bbp.cscs.ch/project/proj82/home/iavarone/modelmanagement/20191105/output/emodels_hoc',\n",
" 'type': 'biophysical'}}},\n",
" {'nodes_file': '/gpfs/bbp.cscs.ch/project/proj12/NSE/bluepysnap-functional-tests/sonata/networks/nodes/CorticoThalamic_projections/nodes.h5',\n",
" 'populations': {'CorticoThalamic_projections': {'type': 'virtual'}}},\n",
" {'nodes_file': '/gpfs/bbp.cscs.ch/project/proj12/NSE/bluepysnap-functional-tests/sonata/networks/nodes/MedialLemniscus_projections/nodes.h5',\n",
" 'populations': {'MedialLemniscus_projections': {'type': 'virtual'}}}]},\n",
" 'node_sets_file': '/gpfs/bbp.cscs.ch/project/proj12/NSE/bluepysnap-functional-tests/sonata/networks/nodes/node_sets.json',\n",
" 'version': 2}"
]
},
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -83,16 +126,16 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<bluepysnap.nodes.Nodes at 0x7f8f24fd80d0>"
"<bluepysnap.nodes.Nodes at 0x2aaae3d8d100>"
]
},
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -103,16 +146,16 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<bluepysnap.edges.Edges at 0x7f8f24fd8350>"
"<bluepysnap.edges.Edges at 0x2aaae3d8d0a0>"
]
},
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -123,16 +166,16 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<bluepysnap.node_sets.NodeSets at 0x7f8f24fd8850>"
"<bluepysnap.node_sets.NodeSets at 0x2aaae3d8d460>"
]
},
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -153,7 +196,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -167,9 +210,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.12"
"version": "3.9.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}

0 comments on commit c021f6f

Please sign in to comment.