diff --git a/doc/source/notebooks/01_circuits.ipynb b/doc/source/notebooks/01_circuits.ipynb index efaeffc5..14a05b42 100644 --- a/doc/source/notebooks/01_circuits.ipynb +++ b/doc/source/notebooks/01_circuits.ipynb @@ -13,7 +13,9 @@ "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)." ] }, { @@ -21,6 +23,35 @@ "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" ] @@ -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)" ] }, @@ -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" } @@ -83,16 +126,16 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -103,16 +146,16 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 5, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -123,16 +166,16 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 6, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -153,7 +196,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -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 }