Skip to content

Commit

Permalink
update base notebooks to use proj12/proj data
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeplf committed Aug 16, 2022
1 parent 2640307 commit f6ef2ff
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 103 deletions.
91 changes: 24 additions & 67 deletions doc/source/notebooks/01_circuits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,6 @@
"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": 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": {},
Expand All @@ -49,7 +18,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -66,11 +35,11 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"circuit_path = \"sonata/circuit_sonata.json\"\n",
"circuit_path = \"/gpfs/bbp.cscs.ch/project/proj30/hippocampus/single_column/sonata/struct_circuit_config.json\"\n",
"circuit = bluepysnap.Circuit(circuit_path)"
]
},
Expand All @@ -88,34 +57,22 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'version': 2,\n",
" 'node_sets_file': '/gpfs/bbp.cscs.ch/home/herttuai/snap/doc/source/notebooks/sonata/networks/nodes/node_sets.json',\n",
" 'networks': {'nodes': [{'nodes_file': '/gpfs/bbp.cscs.ch/home/herttuai/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': '/gpfs/bbp.cscs.ch/home/herttuai/snap/doc/source/notebooks/sonata/networks/nodes/CorticoThalamic_projections/nodes.h5',\n",
" 'populations': {'CorticoThalamic_projections': {'type': 'virtual'}}},\n",
" {'nodes_file': '/gpfs/bbp.cscs.ch/home/herttuai/snap/doc/source/notebooks/sonata/networks/nodes/MedialLemniscus_projections/nodes.h5',\n",
" 'populations': {'MedialLemniscus_projections': {'type': 'virtual'}}}],\n",
" 'edges': [{'edges_file': '/gpfs/bbp.cscs.ch/home/herttuai/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': '/gpfs/bbp.cscs.ch/home/herttuai/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': '/gpfs/bbp.cscs.ch/home/herttuai/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': '/gpfs/bbp.cscs.ch/home/herttuai/snap/doc/source/notebooks/sonata/networks/edges/CorticoThalamic_projections__thalamus_neurons__chemical/edges.h5',\n",
" 'populations': {'CorticoThalamic_projections__thalamus_neurons__chemical': {'type': 'chemical'}}}]}}"
"{'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}]}}"
]
},
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -126,16 +83,16 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<bluepysnap.nodes.Nodes at 0x2aaae172acd0>"
"<bluepysnap.nodes.Nodes at 0x7f8f24fd80d0>"
]
},
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -146,16 +103,16 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<bluepysnap.edges.Edges at 0x2aaae172a510>"
"<bluepysnap.edges.Edges at 0x7f8f24fd8350>"
]
},
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -166,16 +123,16 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<bluepysnap.node_sets.NodeSets at 0x2aaae1737250>"
"<bluepysnap.node_sets.NodeSets at 0x7f8f24fd8850>"
]
},
"execution_count": 7,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -196,7 +153,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -210,9 +167,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 4
"nbformat_minor": 2
}
41 changes: 22 additions & 19 deletions doc/source/notebooks/05_simulations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"metadata": {},
"outputs": [],
"source": [
"simulation_path = \"/gpfs/bbp.cscs.ch/project/proj42/circuits/CA1.O1/mooc-circuit/simulation_config_bluepy_examples.json\"\n",
"simulation_path = \"/gpfs/bbp.cscs.ch/project/proj12/NSE/bluepysnap-functional-tests/simulation_config_bluepy_examples.json\"\n",
"simulation = bluepysnap.Simulation(simulation_path)"
]
},
Expand Down Expand Up @@ -69,21 +69,24 @@
{
"data": {
"text/plain": [
"{'run': {'tstop': 1000.0, 'dt': 0.025, 'seed': 264118},\n",
" 'target_simulator': 'CORENEURON',\n",
"{'inputs': None,\n",
" 'network': '/gpfs/bbp.cscs.ch/project/proj42/circuits/CA1.O1/mooc-circuit/circuit_config.json',\n",
" 'node_sets_file': '/gpfs/bbp.cscs.ch/project/proj42/circuits/CA1.O1/mooc-circuit/node_sets.json',\n",
" 'inputs': {},\n",
" 'output': {'output_dir': '/gpfs/bbp.cscs.ch/project/proj42/circuits/CA1.O1/mooc-circuit/simulations/sonata_report',\n",
" 'log_file': 'simout-914515.log',\n",
" 'output': {'log_file': 'simout-914515.log',\n",
" 'output_dir': '/gpfs/bbp.cscs.ch/project/proj42/circuits/CA1.O1/mooc-circuit/simulations/sonata_report',\n",
" 'spikes_file': 'out.h5',\n",
" 'spikes_sort_order': 'time'},\n",
" 'spikes_sort_order': 'by_time'},\n",
" 'reports': {'soma_report': {'cells': 'CA1',\n",
" 'variable_name': 'v',\n",
" 'sections': 'soma',\n",
" 'enabled': True,\n",
" 'dt': 0.1,\n",
" 'file_name': 'soma'}}}"
" 'enabled': True,\n",
" 'end_time': 1000,\n",
" 'file_name': 'soma',\n",
" 'sections': 'soma',\n",
" 'start_time': 0,\n",
" 'type': 'compartment',\n",
" 'variable_name': 'v'}},\n",
" 'run': {'dt': 0.025, 'random_seed': 264118, 'tstop': 1000.0},\n",
" 'target_simulator': 'CORENEURON'}"
]
},
"execution_count": 3,
Expand All @@ -103,7 +106,7 @@
{
"data": {
"text/plain": [
"{'tstop': 1000.0, 'dt': 0.025, 'seed': 264118}"
"{'dt': 0.025, 'random_seed': 264118, 'tstop': 1000.0}"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -203,7 +206,7 @@
{
"data": {
"text/plain": [
"<bluepysnap.circuit.Circuit at 0x7f4e0eb07250>"
"<bluepysnap.circuit.Circuit at 0x2aaae3d924f0>"
]
},
"execution_count": 9,
Expand All @@ -223,7 +226,7 @@
{
"data": {
"text/plain": [
"<bluepysnap.node_sets.NodeSets at 0x7f4e0eb07050>"
"<bluepysnap.node_sets.NodeSets at 0x2aaae3d92400>"
]
},
"execution_count": 10,
Expand All @@ -243,7 +246,7 @@
{
"data": {
"text/plain": [
"<bluepysnap.spike_report.SpikeReport at 0x7f4e0eb1b190>"
"<bluepysnap.spike_report.SpikeReport at 0x2aaab7f1a2e0>"
]
},
"execution_count": 11,
Expand All @@ -263,7 +266,7 @@
{
"data": {
"text/plain": [
"{'soma_report': <bluepysnap.frame_report.SomaReport at 0x7f4e0fb32e90>}"
"{'soma_report': <bluepysnap.frame_report.SomaReport at 0x2aaae3d9e520>}"
]
},
"execution_count": 12,
Expand All @@ -286,7 +289,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -300,9 +303,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
}
Loading

0 comments on commit f6ef2ff

Please sign in to comment.