├── .gitignore ├── Contributing.md ├── Credits.ipynb ├── DynamicBrain ├── BrainObservatory.ipynb ├── CellTypes.ipynb ├── Connectivity.ipynb ├── Modeling │ ├── biophysical_notebook │ │ ├── biophysical_modeling.ipynb │ │ ├── components │ │ │ ├── biophysical │ │ │ │ ├── electrophysiology │ │ │ │ │ ├── 472363762_fit.json │ │ │ │ │ ├── 472912177_fit.json │ │ │ │ │ ├── 473862421_fit.json │ │ │ │ │ ├── 473863035_fit.json │ │ │ │ │ └── 473863510_fit.json │ │ │ │ └── morphology │ │ │ │ │ ├── Nr5a1-Cre_Ai14_IVSCC_-169250.03.02.01_471087815_m.swc │ │ │ │ │ ├── Pvalb-IRES-Cre_Ai14_IVSCC_-169125.03.01.01_469628681_m.swc │ │ │ │ │ ├── Pvalb-IRES-Cre_Ai14_IVSCC_-176847.04.02.01_470522102_m.swc │ │ │ │ │ ├── Rorb-IRES2-Cre-D_Ai14_IVSCC_-168053.05.01.01_325404214_m.swc │ │ │ │ │ └── Scnn1a-Tg3-Cre_Ai14_IVSCC_-177300.01.02.01_473845048_m.swc │ │ │ ├── hoc_templates │ │ │ │ ├── BioAllen_old.hoc │ │ │ │ ├── BioAxonStub.hoc │ │ │ │ └── Biophys1.hoc │ │ │ ├── intfire │ │ │ │ ├── IntFire1_exc_1.json │ │ │ │ └── IntFire1_inh_1.json │ │ │ ├── mechanisms │ │ │ │ ├── modfiles │ │ │ │ │ ├── CaDynamics.mod │ │ │ │ │ ├── Ca_HVA.mod │ │ │ │ │ ├── Ca_LVA.mod │ │ │ │ │ ├── Ih.mod │ │ │ │ │ ├── Im.mod │ │ │ │ │ ├── Im_v2.mod │ │ │ │ │ ├── K_P.mod │ │ │ │ │ ├── K_T.mod │ │ │ │ │ ├── Kd.mod │ │ │ │ │ ├── Kv2like.mod │ │ │ │ │ ├── Kv3_1.mod │ │ │ │ │ ├── NaTa.mod │ │ │ │ │ ├── NaTs.mod │ │ │ │ │ ├── NaV.mod │ │ │ │ │ ├── Nap.mod │ │ │ │ │ ├── SK.mod │ │ │ │ │ └── vecevent.mod │ │ │ │ └── x86_64 │ │ │ │ │ ├── .libs │ │ │ │ │ ├── CaDynamics.o │ │ │ │ │ ├── Ca_HVA.o │ │ │ │ │ ├── Ca_LVA.o │ │ │ │ │ ├── Ih.o │ │ │ │ │ ├── Im.o │ │ │ │ │ ├── Im_v2.o │ │ │ │ │ ├── K_P.o │ │ │ │ │ ├── K_T.o │ │ │ │ │ ├── Kd.o │ │ │ │ │ ├── Kv2like.o │ │ │ │ │ ├── Kv3_1.o │ │ │ │ │ ├── NaTa.o │ │ │ │ │ ├── NaTs.o │ │ │ │ │ ├── NaV.o │ │ │ │ │ ├── Nap.o │ │ │ │ │ ├── SK.o │ │ │ │ │ ├── libnrnmech.la │ │ │ │ │ ├── libnrnmech.lai │ │ │ │ │ ├── libnrnmech.so │ │ │ │ │ ├── libnrnmech.so.0 │ │ │ │ │ ├── libnrnmech.so.0.0.0 │ │ │ │ │ ├── mod_func.o │ │ │ │ │ └── vecevent.o │ │ │ │ │ ├── CaDynamics.c │ │ │ │ │ ├── CaDynamics.lo │ │ │ │ │ ├── CaDynamics.mod │ │ │ │ │ ├── Ca_HVA.c │ │ │ │ │ ├── Ca_HVA.lo │ │ │ │ │ ├── Ca_HVA.mod │ │ │ │ │ ├── Ca_LVA.c │ │ │ │ │ ├── Ca_LVA.lo │ │ │ │ │ ├── Ca_LVA.mod │ │ │ │ │ ├── Ih.c │ │ │ │ │ ├── Ih.lo │ │ │ │ │ ├── Ih.mod │ │ │ │ │ ├── Im.c │ │ │ │ │ ├── Im.lo │ │ │ │ │ ├── Im.mod │ │ │ │ │ ├── Im_v2.c │ │ │ │ │ ├── Im_v2.lo │ │ │ │ │ ├── Im_v2.mod │ │ │ │ │ ├── K_P.c │ │ │ │ │ ├── K_P.lo │ │ │ │ │ ├── K_P.mod │ │ │ │ │ ├── K_T.c │ │ │ │ │ ├── K_T.lo │ │ │ │ │ ├── K_T.mod │ │ │ │ │ ├── Kd.c │ │ │ │ │ ├── Kd.lo │ │ │ │ │ ├── Kd.mod │ │ │ │ │ ├── Kv2like.c │ │ │ │ │ ├── Kv2like.lo │ │ │ │ │ ├── Kv2like.mod │ │ │ │ │ ├── Kv3_1.c │ │ │ │ │ ├── Kv3_1.lo │ │ │ │ │ ├── Kv3_1.mod │ │ │ │ │ ├── NaTa.c │ │ │ │ │ ├── NaTa.lo │ │ │ │ │ ├── NaTa.mod │ │ │ │ │ ├── NaTs.c │ │ │ │ │ ├── NaTs.lo │ │ │ │ │ ├── NaTs.mod │ │ │ │ │ ├── NaV.c │ │ │ │ │ ├── NaV.lo │ │ │ │ │ ├── NaV.mod │ │ │ │ │ ├── Nap.c │ │ │ │ │ ├── Nap.lo │ │ │ │ │ ├── Nap.mod │ │ │ │ │ ├── SK.c │ │ │ │ │ ├── SK.lo │ │ │ │ │ ├── SK.mod │ │ │ │ │ ├── libnrnmech.la │ │ │ │ │ ├── mechanisms.mod │ │ │ │ │ ├── mod_func.c │ │ │ │ │ ├── mod_func.lo │ │ │ │ │ ├── special │ │ │ │ │ ├── vecevent.c │ │ │ │ │ ├── vecevent.lo │ │ │ │ │ └── vecevent.mod │ │ │ ├── recXelectrodes │ │ │ │ ├── linear_electrode.csv │ │ │ │ ├── mesh_electrode.csv │ │ │ │ └── mesh_electrode_half.csv │ │ │ └── synaptic_models │ │ │ │ ├── AMPA_ExcToExc.json │ │ │ │ ├── AMPA_ExcToInh.json │ │ │ │ ├── GABA_InhToExc.json │ │ │ │ ├── GABA_InhToInh.json │ │ │ │ ├── instanteneousExc.json │ │ │ │ └── instanteneousInh.json │ │ ├── config.json │ │ ├── schematics_png │ │ │ ├── External_input_connected.png │ │ │ ├── External_input_created.png │ │ │ ├── Full_figure.png │ │ │ ├── Neurons_created.png │ │ │ ├── Neurons_created_figure.png │ │ │ ├── Recurrent_connected.png │ │ │ ├── Recurrent_connected_figure.png │ │ │ └── full_network.png │ │ ├── set_cell_params.py │ │ ├── set_syn_params.py │ │ └── set_weights.py │ ├── layer4_analysis │ │ └── layer4_analysis.ipynb │ ├── pointnet_notebook │ │ ├── config.json │ │ ├── models │ │ │ ├── cell_models │ │ │ │ ├── 472363762_fit.json │ │ │ │ ├── 472363762_point.json │ │ │ │ ├── 472912177_fit.json │ │ │ │ ├── 472912177_point.json │ │ │ │ ├── 473862421_point.json │ │ │ │ ├── 473863035_point.json │ │ │ │ ├── 473863510_point.json │ │ │ │ ├── IntFire1_exc_1.json │ │ │ │ ├── IntFire1_exc_fit.json │ │ │ │ ├── IntFire1_exc_point.json │ │ │ │ ├── IntFire1_inh_1.json │ │ │ │ ├── IntFire1_inh_fit.json │ │ │ │ ├── IntFire1_inh_point.json │ │ │ │ └── filter_point.json │ │ │ └── synaptic_models │ │ │ │ ├── AMPA_ExcToExc.json │ │ │ │ ├── AMPA_ExcToInh.json │ │ │ │ ├── ExcToExc.json │ │ │ │ ├── ExcToInh.json │ │ │ │ ├── GABA_InhToExc.json │ │ │ │ ├── GABA_InhToInh.json │ │ │ │ ├── InhToExc.json │ │ │ │ ├── InhToInh.json │ │ │ │ ├── instanteneousExc.json │ │ │ │ └── instanteneousInh.json │ │ ├── network │ │ │ ├── recurrent_network │ │ │ │ ├── edge_types.csv │ │ │ │ ├── edges.h5 │ │ │ │ ├── node_types.csv │ │ │ │ └── nodes.csv │ │ │ └── source_input │ │ │ │ ├── input_edge_types.csv │ │ │ │ ├── input_edges.h5 │ │ │ │ ├── input_node_types.csv │ │ │ │ ├── input_nodes.csv │ │ │ │ └── poisson_input_spk_train.nwb │ │ ├── pointnet_modeling_example.ipynb │ │ └── set_weights.py │ └── popnet_notebook │ │ ├── components │ │ └── pop_models │ │ │ ├── excitatory_pop.json │ │ │ ├── filter_pop.json │ │ │ └── inhibitory_pop.json │ │ ├── config.json │ │ ├── network │ │ ├── recurrent_network │ │ │ ├── edge_types.csv │ │ │ ├── node_types.csv │ │ │ └── nodes.csv │ │ ├── recurrent_network_v2 │ │ │ ├── edge_types.csv │ │ │ └── node_types.csv │ │ └── source_input │ │ │ ├── edge_types.csv │ │ │ ├── input_edge_types.csv │ │ │ ├── input_node_types.csv │ │ │ ├── input_nodes.csv │ │ │ └── poisson_input_spk_train.nwb │ │ ├── output │ │ ├── logging.txt │ │ └── spike_rates.txt │ │ ├── population_modeling.ipynb │ │ └── schematics_png │ │ ├── DiPDE_ei_net.png │ │ ├── ei_ext_pop.png │ │ ├── ei_ext_pop_conn1.png │ │ ├── ei_ext_pop_conn1and2.png │ │ └── ei_pop.png ├── Tutorials │ └── 01_decoding_sklearn.ipynb └── solutions │ ├── 01_decoding_sklearn_solutions.ipynb │ ├── BrainObservatory_solutions.html │ ├── BrainObservatory_solutions.ipynb │ ├── CellTypes_solutions.html │ ├── CellTypes_solutions.ipynb │ ├── Connectivity_solutions.html │ ├── Connectivity_solutions.ipynb │ └── Modeling │ ├── biophysical_modeling_solutions.html │ ├── biophysical_modeling_solutions.ipynb │ ├── layer4_analysis_solutions.html │ ├── layer4_analysis_solutions.ipynb │ ├── population_modeling_solutions.html │ └── population_modeling_solutions.ipynb ├── LICENSE.txt ├── PythonBootcamp ├── 00_Introduction.ipynb ├── 01_Basic_Python_I_Object_and_Data_Structures.ipynb ├── 02_Basic_Python_II_Control_Flow_and_Functions.ipynb ├── 03_Intro_To_Scientific_Computing.ipynb ├── 04_Introduction_To_Numpy.ipynb ├── 05_Custom_Modules_and_Version_Control.ipynb ├── 06_Introduction_To_Matplotlib.ipynb ├── 07_Introduction_To_Pandas.ipynb ├── 08_Development_Tools.ipynb ├── 09_bike_crossing.ipynb ├── 10_glm_exercise.ipynb ├── 11_Image_data.ipynb ├── solutions │ ├── 01_Basic_Python_I_Object_and_Data_Structures_solutions.html │ ├── 01_Basic_Python_I_Object_and_Data_Structures_solutions.ipynb │ ├── 02_Basic_Python_II_Control_Flow_and_Functions_solutions.html │ ├── 02_Basic_Python_II_Control_Flow_and_Functions_solutions.ipynb │ ├── 03_Intro_To_Scientific_Computing_solutions.html │ ├── 03_Intro_To_Scientific_Computing_solutions.ipynb │ ├── 04_Introduction_To_Numpy_solutions.html │ ├── 04_Introduction_To_Numpy_solutions.ipynb │ ├── 05_Custom_Modules_and_Version_Control_solutions.html │ ├── 05_Custom_Modules_and_Version_Control_solutions.ipynb │ ├── 06_Introduction_To_Matplotlib_solutions.html │ ├── 06_Introduction_To_Matplotlib_solutions.ipynb │ ├── 07_Introduction_To_Pandas_solutions.html │ ├── 07_Introduction_To_Pandas_solutions.ipynb │ ├── 09_bike_crossing_solutions.html │ ├── 09_bike_crossing_solutions.ipynb │ ├── 11_Image_data_solutions.html │ └── 11_Image_data_solutions.ipynb └── support_files │ ├── CrossingDailyBarPlot.png │ ├── CrossingMonthlyBarPlot.png │ ├── SampleWorkbook.csv │ ├── blurred.png │ ├── cropped-SummerWorkshop_Header.png │ ├── cross_sections.png │ ├── grayscales.png │ ├── leafplot.png │ ├── maxpixel.png │ ├── neuron.jpg │ ├── pokemon_alopez247.csv │ ├── rgb_array.svg │ ├── stinkbug.png │ ├── sweeps.csv │ └── thresholdedimage.png ├── README.md └── resources ├── Neocortical Interneurons.png ├── connectivity_metadata.csv └── cropped-SummerWorkshop_Header.png /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | *.nwb 3 | *.ipynb_checkpoints/ 4 | .idea/ 5 | -------------------------------------------------------------------------------- /Contributing.md: -------------------------------------------------------------------------------- 1 | # Allen Institute Contribution Agreement 2 | 3 | This document describes the terms under which you may make “Contributions” — 4 | which may include without limitation, software additions, revisions, bug fixes, configuration changes, 5 | documentation, or any other materials — to any of the projects owned or managed by the Allen Institute. 6 | If you have questions about these terms, please contact us at terms@alleninstitute.org. 7 | 8 | You certify that: 9 | 10 | • Your Contributions are either: 11 | 12 | 1. Created in whole or in part by you and you have the right to submit them under the designated license 13 | (described below); or 14 | 2. Based upon previous work that, to the best of your knowledge, is covered under an appropriate 15 | open source license and you have the right under that license to submit that work with modifications, 16 | whether created in whole or in part by you, under the designated license; or 17 | 18 | 3. Provided directly to you by some other person who certified (1) or (2) and you have not modified them. 19 | 20 | • You are granting your Contributions to the Allen Institute under the terms of the [2-Clause BSD license](https://opensource.org/licenses/BSD-2-Clause) 21 | (the “designated license”). 22 | 23 | • You understand and agree that the Allen Institute projects and your Contributions are public and that 24 | a record of the Contributions (including all metadata and personal information you submit with them) is 25 | maintained indefinitely and may be redistributed consistent with the Allen Institute’s mission and the 26 | 2-Clause BSD license. 27 | -------------------------------------------------------------------------------- /Credits.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | " \n", 8 | "\n", 9 | "

Python Bootcamp and Summer Workshop on the Dynamic Brain

\n", 10 | "

August 19-September 3, 2016

" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "metadata": {}, 16 | "source": [ 17 | "
\n", 18 | "

Credits

\n", 19 | "\n", 20 | "

The material for the Python Bootcamp and the Summer Workshop on the Dynamic Brain is the result of hard work from many people. In no particular order, they are:\n", 21 | "\n", 22 | "

\n", 45 | "\n", 46 | "

This material builds upon work from previous years. Contributors are:\n", 47 | "

\n", 56 | "
" 57 | ] 58 | } 59 | ], 60 | "metadata": { 61 | "kernelspec": { 62 | "display_name": "Python 2", 63 | "language": "python", 64 | "name": "python2" 65 | }, 66 | "language_info": { 67 | "codemirror_mode": { 68 | "name": "ipython", 69 | "version": 2 70 | }, 71 | "file_extension": ".py", 72 | "mimetype": "text/x-python", 73 | "name": "python", 74 | "nbconvert_exporter": "python", 75 | "pygments_lexer": "ipython2", 76 | "version": "2.7.13" 77 | } 78 | }, 79 | "nbformat": 4, 80 | "nbformat_minor": 0 81 | } 82 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/biophysical/electrophysiology/472363762_fit.json: -------------------------------------------------------------------------------- 1 | { 2 | "passive": [ 3 | { 4 | "ra": 138.28, 5 | "cm": [ 6 | { 7 | "section": "soma", 8 | "cm": 1.0 9 | }, 10 | { 11 | "section": "axon", 12 | "cm": 1.0 13 | }, 14 | { 15 | "section": "apic", 16 | "cm": 2.12 17 | }, 18 | { 19 | "section": "dend", 20 | "cm": 2.12 21 | } 22 | ], 23 | "e_pas": -92.49911499023438 24 | } 25 | ], 26 | "axon_morph": [ 27 | { 28 | "delete_axon": [ 29 | "forsec axonal{delete_section()}", 30 | " create axon[2]", 31 | " axon[0]{", 32 | " L= 30", 33 | " diam = 1", 34 | " nseg = 1+2*int(L/40)", 35 | " all.append()", 36 | " axonal.append()", 37 | " }", 38 | " axon[1]{", 39 | " L= 30", 40 | " diam = 1", 41 | " nseg = 1+2*int(L/40)", 42 | " all.append()", 43 | " axonal.append()", 44 | " }", 45 | "", 46 | "nSecAxonal = 2", 47 | "connect axon(0), soma(0.5)", 48 | "connect axon[1](0), axon[0](1) ", 49 | "access soma" 50 | ], 51 | "setup_line": "create soma[1], dend[1], apic[1], axon[1]" 52 | } 53 | ], 54 | "fitting": [ 55 | { 56 | "junction_potential": -14.0, 57 | "sweeps": [ 58 | 38 59 | ] 60 | } 61 | ], 62 | "conditions": [ 63 | { 64 | "celsius": 34.0, 65 | "erev": [ 66 | { 67 | "ena": 53.0, 68 | "section": "soma", 69 | "ek": -107.0 70 | } 71 | ], 72 | "v_init": -92.49911499023438 73 | } 74 | ], 75 | "genome": [ 76 | { 77 | "value": 0.0012021154978800002, 78 | "section": "soma", 79 | "name": "gbar_Im", 80 | "mechanism": "Im" 81 | }, 82 | { 83 | "value": 4.12225901169e-05, 84 | "section": "soma", 85 | "name": "gbar_Ih", 86 | "mechanism": "Ih" 87 | }, 88 | { 89 | "value": 0.98228995892999993, 90 | "section": "soma", 91 | "name": "gbar_NaTs", 92 | "mechanism": "NaTs" 93 | }, 94 | { 95 | "value": 0.000209348990528, 96 | "section": "soma", 97 | "name": "gbar_Nap", 98 | "mechanism": "Nap" 99 | }, 100 | { 101 | "value": 0.051758360920800002, 102 | "section": "soma", 103 | "name": "gbar_K_P", 104 | "mechanism": "K_P" 105 | }, 106 | { 107 | "value": 0.00073160714529799998, 108 | "section": "soma", 109 | "name": "gbar_K_T", 110 | "mechanism": "K_T" 111 | }, 112 | { 113 | "value": 0.00019222004878899999, 114 | "section": "soma", 115 | "name": "gbar_SK", 116 | "mechanism": "SK" 117 | }, 118 | { 119 | "value": 0.057264803402699994, 120 | "section": "soma", 121 | "name": "gbar_Kv3_1", 122 | "mechanism": "Kv3_1" 123 | }, 124 | { 125 | "value": 0.00053599731839199991, 126 | "section": "soma", 127 | "name": "gbar_Ca_HVA", 128 | "mechanism": "Ca_HVA" 129 | }, 130 | { 131 | "value": 0.0070061294358100008, 132 | "section": "soma", 133 | "name": "gbar_Ca_LVA", 134 | "mechanism": "Ca_LVA" 135 | }, 136 | { 137 | "value": 0.0012510775510599999, 138 | "section": "soma", 139 | "name": "gamma_CaDynamics", 140 | "mechanism": "CaDynamics" 141 | }, 142 | { 143 | "value": 717.91660042899991, 144 | "section": "soma", 145 | "name": "decay_CaDynamics", 146 | "mechanism": "CaDynamics" 147 | }, 148 | { 149 | "value": 5.71880766722e-06, 150 | "section": "soma", 151 | "name": "g_pas", 152 | "mechanism": "" 153 | }, 154 | { 155 | "value": 0.00045738760076499994, 156 | "section": "axon", 157 | "name": "g_pas", 158 | "mechanism": "" 159 | }, 160 | { 161 | "value": 3.2393273274400003e-06, 162 | "section": "dend", 163 | "name": "g_pas", 164 | "mechanism": "" 165 | }, 166 | { 167 | "value": 9.5861855476200007e-05, 168 | "section": "apic", 169 | "name": "g_pas", 170 | "mechanism": "" 171 | } 172 | ] 173 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/biophysical/electrophysiology/472912177_fit.json: -------------------------------------------------------------------------------- 1 | { 2 | "passive": [ 3 | { 4 | "ra": 143.65, 5 | "cm": [ 6 | { 7 | "section": "soma", 8 | "cm": 2.16 9 | }, 10 | { 11 | "section": "axon", 12 | "cm": 2.16 13 | }, 14 | { 15 | "section": "dend", 16 | "cm": 2.16 17 | } 18 | ], 19 | "e_pas": -95.53709411621094 20 | } 21 | ], 22 | "axon_morph": [ 23 | { 24 | "delete_axon": [ 25 | "forsec axonal{delete_section()}", 26 | " create axon[2]", 27 | " axon[0]{", 28 | " L= 30", 29 | " diam = 1", 30 | " nseg = 1+2*int(L/40)", 31 | " all.append()", 32 | " axonal.append()", 33 | " }", 34 | " axon[1]{", 35 | " L= 30", 36 | " diam = 1", 37 | " nseg = 1+2*int(L/40)", 38 | " all.append()", 39 | " axonal.append()", 40 | " }", 41 | "", 42 | "nSecAxonal = 2", 43 | "connect axon(0), soma(0.5)", 44 | "connect axon[1](0), axon[0](1) ", 45 | "access soma" 46 | ], 47 | "setup_line": "create soma[1], dend[1], apic[1], axon[1]" 48 | } 49 | ], 50 | "fitting": [ 51 | { 52 | "junction_potential": -14.0, 53 | "sweeps": [ 54 | 55 55 | ] 56 | } 57 | ], 58 | "conditions": [ 59 | { 60 | "celsius": 34.0, 61 | "erev": [ 62 | { 63 | "ena": 53.0, 64 | "section": "soma", 65 | "ek": -107.0 66 | } 67 | ], 68 | "v_init": -95.53709411621094 69 | } 70 | ], 71 | "genome": [ 72 | { 73 | "value": 5.1162860430100002e-05, 74 | "section": "soma", 75 | "name": "gbar_Ih", 76 | "mechanism": "Ih" 77 | }, 78 | { 79 | "value": 0.058520185129300004, 80 | "section": "soma", 81 | "name": "gbar_NaV", 82 | "mechanism": "NaV" 83 | }, 84 | { 85 | "value": 0.00031192529327399998, 86 | "section": "soma", 87 | "name": "gbar_Kd", 88 | "mechanism": "Kd" 89 | }, 90 | { 91 | "value": 0.051060238264300006, 92 | "section": "soma", 93 | "name": "gbar_Kv2like", 94 | "mechanism": "Kv2like" 95 | }, 96 | { 97 | "value": 0.65076055389700005, 98 | "section": "soma", 99 | "name": "gbar_Kv3_1", 100 | "mechanism": "Kv3_1" 101 | }, 102 | { 103 | "value": 0.033385946416300001, 104 | "section": "soma", 105 | "name": "gbar_K_T", 106 | "mechanism": "K_T" 107 | }, 108 | { 109 | "value": 0.00775048605222, 110 | "section": "soma", 111 | "name": "gbar_Im_v2", 112 | "mechanism": "Im_v2" 113 | }, 114 | { 115 | "value": 0.0027340091995900003, 116 | "section": "soma", 117 | "name": "gbar_SK", 118 | "mechanism": "SK" 119 | }, 120 | { 121 | "value": 0.00056478972054199987, 122 | "section": "soma", 123 | "name": "gbar_Ca_HVA", 124 | "mechanism": "Ca_HVA" 125 | }, 126 | { 127 | "value": 0.0032114779487500003, 128 | "section": "soma", 129 | "name": "gbar_Ca_LVA", 130 | "mechanism": "Ca_LVA" 131 | }, 132 | { 133 | "value": 0.0077204433411699998, 134 | "section": "soma", 135 | "name": "gamma_CaDynamics", 136 | "mechanism": "CaDynamics" 137 | }, 138 | { 139 | "value": 20.300246788599999, 140 | "section": "soma", 141 | "name": "decay_CaDynamics", 142 | "mechanism": "CaDynamics" 143 | }, 144 | { 145 | "value": 0.00026705534351299998, 146 | "section": "soma", 147 | "name": "g_pas", 148 | "mechanism": "" 149 | }, 150 | { 151 | "value": 0.00066246357111199989, 152 | "section": "axon", 153 | "name": "g_pas", 154 | "mechanism": "" 155 | }, 156 | { 157 | "value": 9.8019833221899986e-06, 158 | "section": "dend", 159 | "name": "g_pas", 160 | "mechanism": "" 161 | } 162 | ] 163 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/biophysical/electrophysiology/473862421_fit.json: -------------------------------------------------------------------------------- 1 | { 2 | "passive": [ 3 | { 4 | "ra": 138.99, 5 | "cm": [ 6 | { 7 | "section": "soma", 8 | "cm": 1.94 9 | }, 10 | { 11 | "section": "axon", 12 | "cm": 1.94 13 | }, 14 | { 15 | "section": "dend", 16 | "cm": 1.94 17 | } 18 | ], 19 | "e_pas": -88.23363494873047 20 | } 21 | ], 22 | "axon_morph": [ 23 | { 24 | "delete_axon": [ 25 | "forsec axonal{delete_section()}", 26 | " create axon[2]", 27 | " axon[0]{", 28 | " L= 30", 29 | " diam = 1", 30 | " nseg = 1+2*int(L/40)", 31 | " all.append()", 32 | " axonal.append()", 33 | " }", 34 | " axon[1]{", 35 | " L= 30", 36 | " diam = 1", 37 | " nseg = 1+2*int(L/40)", 38 | " all.append()", 39 | " axonal.append()", 40 | " }", 41 | "", 42 | "nSecAxonal = 2", 43 | "connect axon(0), soma(0.5)", 44 | "connect axon[1](0), axon[0](1) ", 45 | "access soma" 46 | ], 47 | "setup_line": "create soma[1], dend[1], apic[1], axon[1]" 48 | } 49 | ], 50 | "fitting": [ 51 | { 52 | "junction_potential": -14.0, 53 | "sweeps": [ 54 | 58 55 | ] 56 | } 57 | ], 58 | "conditions": [ 59 | { 60 | "celsius": 34.0, 61 | "erev": [ 62 | { 63 | "ena": 53.0, 64 | "section": "soma", 65 | "ek": -107.0 66 | } 67 | ], 68 | "v_init": -88.23363494873047 69 | } 70 | ], 71 | "genome": [ 72 | { 73 | "value": 0.00030357031297000004, 74 | "section": "soma", 75 | "name": "gbar_Ih", 76 | "mechanism": "Ih" 77 | }, 78 | { 79 | "value": 0.052161472289300001, 80 | "section": "soma", 81 | "name": "gbar_NaV", 82 | "mechanism": "NaV" 83 | }, 84 | { 85 | "value": 0.0033126476739899998, 86 | "section": "soma", 87 | "name": "gbar_Kd", 88 | "mechanism": "Kd" 89 | }, 90 | { 91 | "value": 0.019206276717599998, 92 | "section": "soma", 93 | "name": "gbar_Kv2like", 94 | "mechanism": "Kv2like" 95 | }, 96 | { 97 | "value": 1.2128893375100001, 98 | "section": "soma", 99 | "name": "gbar_Kv3_1", 100 | "mechanism": "Kv3_1" 101 | }, 102 | { 103 | "value": 1.4016010650299999e-05, 104 | "section": "soma", 105 | "name": "gbar_K_T", 106 | "mechanism": "K_T" 107 | }, 108 | { 109 | "value": 0.0011153668151199999, 110 | "section": "soma", 111 | "name": "gbar_Im_v2", 112 | "mechanism": "Im_v2" 113 | }, 114 | { 115 | "value": 0.048152669735999999, 116 | "section": "soma", 117 | "name": "gbar_SK", 118 | "mechanism": "SK" 119 | }, 120 | { 121 | "value": 0.0, 122 | "section": "soma", 123 | "name": "gbar_Ca_HVA", 124 | "mechanism": "Ca_HVA" 125 | }, 126 | { 127 | "value": 0.0, 128 | "section": "soma", 129 | "name": "gbar_Ca_LVA", 130 | "mechanism": "Ca_LVA" 131 | }, 132 | { 133 | "value": 0.046090335451600004, 134 | "section": "soma", 135 | "name": "gamma_CaDynamics", 136 | "mechanism": "CaDynamics" 137 | }, 138 | { 139 | "value": 574.74935741900003, 140 | "section": "soma", 141 | "name": "decay_CaDynamics", 142 | "mechanism": "CaDynamics" 143 | }, 144 | { 145 | "value": 0.00058689407428699997, 146 | "section": "soma", 147 | "name": "g_pas", 148 | "mechanism": "" 149 | }, 150 | { 151 | "value": 0.0009617982321389999, 152 | "section": "axon", 153 | "name": "g_pas", 154 | "mechanism": "" 155 | }, 156 | { 157 | "value": 4.1690838408899998e-07, 158 | "section": "dend", 159 | "name": "g_pas", 160 | "mechanism": "" 161 | } 162 | ] 163 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/biophysical/electrophysiology/473863035_fit.json: -------------------------------------------------------------------------------- 1 | { 2 | "passive": [ 3 | { 4 | "ra": 122.88, 5 | "cm": [ 6 | { 7 | "section": "soma", 8 | "cm": 1.0 9 | }, 10 | { 11 | "section": "axon", 12 | "cm": 1.0 13 | }, 14 | { 15 | "section": "apic", 16 | "cm": 2.28 17 | }, 18 | { 19 | "section": "dend", 20 | "cm": 2.28 21 | } 22 | ], 23 | "e_pas": -89.4614028930664 24 | } 25 | ], 26 | "axon_morph": [ 27 | { 28 | "delete_axon": [ 29 | "forsec axonal{delete_section()}", 30 | " create axon[2]", 31 | " axon[0]{", 32 | " L= 30", 33 | " diam = 1", 34 | " nseg = 1+2*int(L/40)", 35 | " all.append()", 36 | " axonal.append()", 37 | " }", 38 | " axon[1]{", 39 | " L= 30", 40 | " diam = 1", 41 | " nseg = 1+2*int(L/40)", 42 | " all.append()", 43 | " axonal.append()", 44 | " }", 45 | "", 46 | "nSecAxonal = 2", 47 | "connect axon(0), soma(0.5)", 48 | "connect axon[1](0), axon[0](1) ", 49 | "access soma" 50 | ], 51 | "setup_line": "create soma[1], dend[1], apic[1], axon[1]" 52 | } 53 | ], 54 | "fitting": [ 55 | { 56 | "junction_potential": -14.0, 57 | "sweeps": [ 58 | 41 59 | ] 60 | } 61 | ], 62 | "conditions": [ 63 | { 64 | "celsius": 34.0, 65 | "erev": [ 66 | { 67 | "ena": 53.0, 68 | "section": "soma", 69 | "ek": -107.0 70 | } 71 | ], 72 | "v_init": -89.4614028930664 73 | } 74 | ], 75 | "genome": [ 76 | { 77 | "value": 0.00204889965055, 78 | "section": "soma", 79 | "name": "gbar_Im", 80 | "mechanism": "Im" 81 | }, 82 | { 83 | "value": 3.7269252291999993e-05, 84 | "section": "soma", 85 | "name": "gbar_Ih", 86 | "mechanism": "Ih" 87 | }, 88 | { 89 | "value": 0.60927080502300002, 90 | "section": "soma", 91 | "name": "gbar_NaTs", 92 | "mechanism": "NaTs" 93 | }, 94 | { 95 | "value": 6.2161868365100004e-05, 96 | "section": "soma", 97 | "name": "gbar_Nap", 98 | "mechanism": "Nap" 99 | }, 100 | { 101 | "value": 0.018147424450599997, 102 | "section": "soma", 103 | "name": "gbar_K_P", 104 | "mechanism": "K_P" 105 | }, 106 | { 107 | "value": 0.000555828337834, 108 | "section": "soma", 109 | "name": "gbar_K_T", 110 | "mechanism": "K_T" 111 | }, 112 | { 113 | "value": 0.00041743171143300003, 114 | "section": "soma", 115 | "name": "gbar_SK", 116 | "mechanism": "SK" 117 | }, 118 | { 119 | "value": 0.12468487969900001, 120 | "section": "soma", 121 | "name": "gbar_Kv3_1", 122 | "mechanism": "Kv3_1" 123 | }, 124 | { 125 | "value": 0.00097272189665800009, 126 | "section": "soma", 127 | "name": "gbar_Ca_HVA", 128 | "mechanism": "Ca_HVA" 129 | }, 130 | { 131 | "value": 0.0066296509568100001, 132 | "section": "soma", 133 | "name": "gbar_Ca_LVA", 134 | "mechanism": "Ca_LVA" 135 | }, 136 | { 137 | "value": 0.00071152004894800005, 138 | "section": "soma", 139 | "name": "gamma_CaDynamics", 140 | "mechanism": "CaDynamics" 141 | }, 142 | { 143 | "value": 798.67999240300003, 144 | "section": "soma", 145 | "name": "decay_CaDynamics", 146 | "mechanism": "CaDynamics" 147 | }, 148 | { 149 | "value": 0.00054589151280800012, 150 | "section": "soma", 151 | "name": "g_pas", 152 | "mechanism": "" 153 | }, 154 | { 155 | "value": 0.00021542161812900001, 156 | "section": "axon", 157 | "name": "g_pas", 158 | "mechanism": "" 159 | }, 160 | { 161 | "value": 6.2827249623699998e-06, 162 | "section": "dend", 163 | "name": "g_pas", 164 | "mechanism": "" 165 | }, 166 | { 167 | "value": 5.9318998497700001e-06, 168 | "section": "apic", 169 | "name": "g_pas", 170 | "mechanism": "" 171 | } 172 | ] 173 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/biophysical/electrophysiology/473863510_fit.json: -------------------------------------------------------------------------------- 1 | { 2 | "passive": [ 3 | { 4 | "ra": 35.64, 5 | "cm": [ 6 | { 7 | "section": "soma", 8 | "cm": 1.0 9 | }, 10 | { 11 | "section": "axon", 12 | "cm": 1.0 13 | }, 14 | { 15 | "section": "apic", 16 | "cm": 2.19 17 | }, 18 | { 19 | "section": "dend", 20 | "cm": 2.19 21 | } 22 | ], 23 | "e_pas": -85.07815551757812 24 | } 25 | ], 26 | "axon_morph": [ 27 | { 28 | "delete_axon": [ 29 | "forsec axonal{delete_section()}", 30 | " create axon[2]", 31 | " axon[0]{", 32 | " L= 30", 33 | " diam = 1", 34 | " nseg = 1+2*int(L/40)", 35 | " all.append()", 36 | " axonal.append()", 37 | " }", 38 | " axon[1]{", 39 | " L= 30", 40 | " diam = 1", 41 | " nseg = 1+2*int(L/40)", 42 | " all.append()", 43 | " axonal.append()", 44 | " }", 45 | "", 46 | "nSecAxonal = 2", 47 | "connect axon(0), soma(0.5)", 48 | "connect axon[1](0), axon[0](1) ", 49 | "access soma" 50 | ], 51 | "setup_line": "create soma[1], dend[1], apic[1], axon[1]" 52 | } 53 | ], 54 | "fitting": [ 55 | { 56 | "junction_potential": -14.0, 57 | "sweeps": [ 58 | 38 59 | ] 60 | } 61 | ], 62 | "conditions": [ 63 | { 64 | "celsius": 34.0, 65 | "erev": [ 66 | { 67 | "ena": 53.0, 68 | "section": "soma", 69 | "ek": -107.0 70 | } 71 | ], 72 | "v_init": -85.07815551757812 73 | } 74 | ], 75 | "genome": [ 76 | { 77 | "value": 0.00043788364247700001, 78 | "section": "soma", 79 | "name": "gbar_Im", 80 | "mechanism": "Im" 81 | }, 82 | { 83 | "value": 0.0019922075246600001, 84 | "section": "soma", 85 | "name": "gbar_Ih", 86 | "mechanism": "Ih" 87 | }, 88 | { 89 | "value": 0.71282189194800005, 90 | "section": "soma", 91 | "name": "gbar_NaTs", 92 | "mechanism": "NaTs" 93 | }, 94 | { 95 | "value": 0.0012493753876800001, 96 | "section": "soma", 97 | "name": "gbar_Nap", 98 | "mechanism": "Nap" 99 | }, 100 | { 101 | "value": 0.034836377263399998, 102 | "section": "soma", 103 | "name": "gbar_K_P", 104 | "mechanism": "K_P" 105 | }, 106 | { 107 | "value": 0.0166428509042, 108 | "section": "soma", 109 | "name": "gbar_K_T", 110 | "mechanism": "K_T" 111 | }, 112 | { 113 | "value": 0.00024972209054299998, 114 | "section": "soma", 115 | "name": "gbar_SK", 116 | "mechanism": "SK" 117 | }, 118 | { 119 | "value": 0.28059766435600003, 120 | "section": "soma", 121 | "name": "gbar_Kv3_1", 122 | "mechanism": "Kv3_1" 123 | }, 124 | { 125 | "value": 0.00015339031713199999, 126 | "section": "soma", 127 | "name": "gbar_Ca_HVA", 128 | "mechanism": "Ca_HVA" 129 | }, 130 | { 131 | "value": 0.0033469316039000004, 132 | "section": "soma", 133 | "name": "gbar_Ca_LVA", 134 | "mechanism": "Ca_LVA" 135 | }, 136 | { 137 | "value": 0.0040218816981199999, 138 | "section": "soma", 139 | "name": "gamma_CaDynamics", 140 | "mechanism": "CaDynamics" 141 | }, 142 | { 143 | "value": 991.140696832, 144 | "section": "soma", 145 | "name": "decay_CaDynamics", 146 | "mechanism": "CaDynamics" 147 | }, 148 | { 149 | "value": 0.00092865666454699993, 150 | "section": "soma", 151 | "name": "g_pas", 152 | "mechanism": "" 153 | }, 154 | { 155 | "value": 0.00091423093354899986, 156 | "section": "axon", 157 | "name": "g_pas", 158 | "mechanism": "" 159 | }, 160 | { 161 | "value": 3.8264043188599994e-06, 162 | "section": "dend", 163 | "name": "g_pas", 164 | "mechanism": "" 165 | }, 166 | { 167 | "value": 2.11145615996e-06, 168 | "section": "apic", 169 | "name": "g_pas", 170 | "mechanism": "" 171 | } 172 | ] 173 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/hoc_templates/BioAllen_old.hoc: -------------------------------------------------------------------------------- 1 | begintemplate BioAllenOld 2 | 3 | public init 4 | public soma, dend, apic, axon 5 | public all, somatic, basal, apical, axonal 6 | objref all, somatic, basal, apical, axonal 7 | 8 | objref this 9 | 10 | proc init() {localobj nl, import 11 | all = new SectionList() 12 | somatic = new SectionList() 13 | basal = new SectionList() 14 | apical = new SectionList() 15 | axonal = new SectionList() 16 | forall delete_section() 17 | } 18 | 19 | create soma[1], dend[1], apic[1], axon[1] 20 | 21 | endtemplate BioAllenOld 22 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/hoc_templates/BioAxonStub.hoc: -------------------------------------------------------------------------------- 1 | begintemplate BioAxonStub 2 | 3 | public init 4 | public soma, dend, apic, axon 5 | public all, somatic, basal, apical, axonal 6 | 7 | objref all, somatic, basal, apical, axonal 8 | objref this 9 | 10 | create soma[1] 11 | create dend[1] 12 | create apic[1] 13 | create axon[1] 14 | 15 | 16 | proc init() {localobj nl, import 17 | all = new SectionList() 18 | somatic = new SectionList() 19 | basal = new SectionList() 20 | apical = new SectionList() 21 | axonal = new SectionList() 22 | forall delete_section() 23 | 24 | // nl = new Import3d_Neurolucida3() 25 | nl = new Import3d_SWC_read() 26 | nl.quiet = 1 27 | nl.input($s1) 28 | import = new Import3d_GUI(nl, 0) 29 | // import.quite = 1 30 | import.instantiate(this) 31 | 32 | simplify_axon() 33 | } 34 | 35 | proc simplify_axon() { 36 | 37 | forsec axonal { delete_section() } 38 | create axon[2] 39 | 40 | axon[0] { 41 | L = 30 42 | diam = 1 43 | nseg = 1+2*int(L/40) 44 | all.append() 45 | axonal.append() 46 | } 47 | axon[1] { 48 | L = 30 49 | diam = 1 50 | nseg = 1+2*int(L/40) 51 | all.append() 52 | axonal.append() 53 | } 54 | connect axon(0), soma(0.5) 55 | connect axon[1](0), axon[0](1) 56 | define_shape() 57 | 58 | 59 | } 60 | 61 | endtemplate BioAxonStub -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/hoc_templates/Biophys1.hoc: -------------------------------------------------------------------------------- 1 | begintemplate Biophys1 2 | 3 | public init 4 | public soma, dend, apic, axon 5 | public all, somatic, basal, apical, axonal 6 | 7 | objref all, somatic, basal, apical, axonal 8 | objref this 9 | 10 | create soma[1] 11 | create dend[1] 12 | create apic[1] 13 | create axon[1] 14 | 15 | 16 | proc init() {localobj nl, import 17 | all = new SectionList() 18 | somatic = new SectionList() 19 | basal = new SectionList() 20 | apical = new SectionList() 21 | axonal = new SectionList() 22 | forall delete_section() 23 | 24 | // nl = new Import3d_Neurolucida3() 25 | nl = new Import3d_SWC_read() 26 | nl.quiet = 1 27 | nl.input($s1) 28 | import = new Import3d_GUI(nl, 0) 29 | // import.quite = 1 30 | import.instantiate(this) 31 | 32 | } 33 | 34 | endtemplate Biophys1 35 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/intfire/IntFire1_exc_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "tau": 0.024, 3 | "type": "NEURON_IntFire1", 4 | "refrac": 0.003 5 | } 6 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/intfire/IntFire1_inh_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "tau": 0.007, 3 | "type": "NEURON_IntFire1", 4 | "refrac": 0.003 5 | } 6 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/CaDynamics.mod: -------------------------------------------------------------------------------- 1 | : Dynamics that track inside calcium concentration 2 | : modified from Destexhe et al. 1994 3 | 4 | NEURON { 5 | SUFFIX CaDynamics 6 | USEION ca READ ica WRITE cai 7 | RANGE decay, gamma, minCai, depth 8 | } 9 | 10 | UNITS { 11 | (mV) = (millivolt) 12 | (mA) = (milliamp) 13 | FARADAY = (faraday) (coulombs) 14 | (molar) = (1/liter) 15 | (mM) = (millimolar) 16 | (um) = (micron) 17 | } 18 | 19 | PARAMETER { 20 | gamma = 0.05 : percent of free calcium (not buffered) 21 | decay = 80 (ms) : rate of removal of calcium 22 | depth = 0.1 (um) : depth of shell 23 | minCai = 1e-4 (mM) 24 | } 25 | 26 | ASSIGNED {ica (mA/cm2)} 27 | 28 | INITIAL { 29 | cai = minCai 30 | } 31 | 32 | STATE { 33 | cai (mM) 34 | } 35 | 36 | BREAKPOINT { SOLVE states METHOD cnexp } 37 | 38 | DERIVATIVE states { 39 | cai' = -(10000)*(ica*gamma/(2*FARADAY*depth)) - (cai - minCai)/decay 40 | } 41 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/Ca_HVA.mod: -------------------------------------------------------------------------------- 1 | : Reference: Reuveni, Friedman, Amitai, and Gutnick, J.Neurosci. 1993 2 | 3 | NEURON { 4 | SUFFIX Ca_HVA 5 | USEION ca READ eca WRITE ica 6 | RANGE gbar, g, ica 7 | } 8 | 9 | UNITS { 10 | (S) = (siemens) 11 | (mV) = (millivolt) 12 | (mA) = (milliamp) 13 | } 14 | 15 | PARAMETER { 16 | gbar = 0.00001 (S/cm2) 17 | } 18 | 19 | ASSIGNED { 20 | v (mV) 21 | eca (mV) 22 | ica (mA/cm2) 23 | g (S/cm2) 24 | mInf 25 | mTau 26 | mAlpha 27 | mBeta 28 | hInf 29 | hTau 30 | hAlpha 31 | hBeta 32 | } 33 | 34 | STATE { 35 | m 36 | h 37 | } 38 | 39 | BREAKPOINT { 40 | SOLVE states METHOD cnexp 41 | g = gbar*m*m*h 42 | ica = g*(v-eca) 43 | } 44 | 45 | DERIVATIVE states { 46 | rates() 47 | m' = (mInf-m)/mTau 48 | h' = (hInf-h)/hTau 49 | } 50 | 51 | INITIAL{ 52 | rates() 53 | m = mInf 54 | h = hInf 55 | } 56 | 57 | PROCEDURE rates(){ 58 | UNITSOFF 59 | : if((v == -27) ){ 60 | : v = v+0.0001 61 | : } 62 | :mAlpha = (0.055*(-27-v))/(exp((-27-v)/3.8) - 1) 63 | mAlpha = 0.055 * vtrap(-27 - v, 3.8) 64 | mBeta = (0.94*exp((-75-v)/17)) 65 | mInf = mAlpha/(mAlpha + mBeta) 66 | mTau = 1/(mAlpha + mBeta) 67 | hAlpha = (0.000457*exp((-13-v)/50)) 68 | hBeta = (0.0065/(exp((-v-15)/28)+1)) 69 | hInf = hAlpha/(hAlpha + hBeta) 70 | hTau = 1/(hAlpha + hBeta) 71 | UNITSON 72 | } 73 | 74 | FUNCTION vtrap(x, y) { : Traps for 0 in denominator of rate equations 75 | UNITSOFF 76 | if (fabs(x / y) < 1e-6) { 77 | vtrap = y * (1 - x / y / 2) 78 | } else { 79 | vtrap = x / (exp(x / y) - 1) 80 | } 81 | UNITSON 82 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/Ca_LVA.mod: -------------------------------------------------------------------------------- 1 | : Comment: LVA ca channel. Note: mtau is an approximation from the plots 2 | : Reference: Avery and Johnston 1996, tau from Randall 1997 3 | : Comment: shifted by -10 mv to correct for junction potential 4 | : Comment: corrected rates using q10 = 2.3, target temperature 34, orginal 21 5 | 6 | NEURON { 7 | SUFFIX Ca_LVA 8 | USEION ca READ eca WRITE ica 9 | RANGE gbar, g, ica 10 | } 11 | 12 | UNITS { 13 | (S) = (siemens) 14 | (mV) = (millivolt) 15 | (mA) = (milliamp) 16 | } 17 | 18 | PARAMETER { 19 | gbar = 0.00001 (S/cm2) 20 | } 21 | 22 | ASSIGNED { 23 | v (mV) 24 | eca (mV) 25 | ica (mA/cm2) 26 | g (S/cm2) 27 | celsius (degC) 28 | mInf 29 | mTau 30 | hInf 31 | hTau 32 | } 33 | 34 | STATE { 35 | m 36 | h 37 | } 38 | 39 | BREAKPOINT { 40 | SOLVE states METHOD cnexp 41 | g = gbar*m*m*h 42 | ica = g*(v-eca) 43 | } 44 | 45 | DERIVATIVE states { 46 | rates() 47 | m' = (mInf-m)/mTau 48 | h' = (hInf-h)/hTau 49 | } 50 | 51 | INITIAL{ 52 | rates() 53 | m = mInf 54 | h = hInf 55 | } 56 | 57 | PROCEDURE rates(){ 58 | LOCAL qt 59 | qt = 2.3^((celsius-21)/10) 60 | 61 | UNITSOFF 62 | v = v + 10 63 | mInf = 1.0000/(1+ exp((v - -30.000)/-6)) 64 | mTau = (5.0000 + 20.0000/(1+exp((v - -25.000)/5)))/qt 65 | hInf = 1.0000/(1+ exp((v - -80.000)/6.4)) 66 | hTau = (20.0000 + 50.0000/(1+exp((v - -40.000)/7)))/qt 67 | v = v - 10 68 | UNITSON 69 | } 70 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/Ih.mod: -------------------------------------------------------------------------------- 1 | : Reference: Kole,Hallermann,and Stuart, J. Neurosci. 2006 2 | 3 | NEURON { 4 | SUFFIX Ih 5 | NONSPECIFIC_CURRENT ihcn 6 | RANGE gbar, g, ihcn 7 | } 8 | 9 | UNITS { 10 | (S) = (siemens) 11 | (mV) = (millivolt) 12 | (mA) = (milliamp) 13 | } 14 | 15 | PARAMETER { 16 | gbar = 0.00001 (S/cm2) 17 | ehcn = -45.0 (mV) 18 | } 19 | 20 | ASSIGNED { 21 | v (mV) 22 | ihcn (mA/cm2) 23 | g (S/cm2) 24 | mInf 25 | mTau 26 | mAlpha 27 | mBeta 28 | } 29 | 30 | STATE { 31 | m 32 | } 33 | 34 | BREAKPOINT { 35 | SOLVE states METHOD cnexp 36 | g = gbar*m 37 | ihcn = g*(v-ehcn) 38 | } 39 | 40 | DERIVATIVE states { 41 | rates() 42 | m' = (mInf-m)/mTau 43 | } 44 | 45 | INITIAL{ 46 | rates() 47 | m = mInf 48 | } 49 | 50 | PROCEDURE rates(){ 51 | UNITSOFF 52 | : if(v == -154.9){ 53 | : v = v + 0.0001 54 | : } 55 | :mAlpha = 0.001*6.43*(v+154.9)/(exp((v+154.9)/11.9)-1) 56 | mAlpha = 0.001 * 6.43 * vtrap(v + 154.9, 11.9) 57 | mBeta = 0.001*193*exp(v/33.1) 58 | mInf = mAlpha/(mAlpha + mBeta) 59 | mTau = 1/(mAlpha + mBeta) 60 | UNITSON 61 | } 62 | 63 | FUNCTION vtrap(x, y) { : Traps for 0 in denominator of rate equations 64 | UNITSOFF 65 | if (fabs(x / y) < 1e-6) { 66 | vtrap = y * (1 - x / y / 2) 67 | } else { 68 | vtrap = x / (exp(x / y) - 1) 69 | } 70 | UNITSON 71 | } 72 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/Im.mod: -------------------------------------------------------------------------------- 1 | : Reference: Adams et al. 1982 - M-currents and other potassium currents in bullfrog sympathetic neurones 2 | : Comment: corrected rates using q10 = 2.3, target temperature 34, orginal 21 3 | 4 | NEURON { 5 | SUFFIX Im 6 | USEION k READ ek WRITE ik 7 | RANGE gbar, g, ik 8 | } 9 | 10 | UNITS { 11 | (S) = (siemens) 12 | (mV) = (millivolt) 13 | (mA) = (milliamp) 14 | } 15 | 16 | PARAMETER { 17 | gbar = 0.00001 (S/cm2) 18 | } 19 | 20 | ASSIGNED { 21 | v (mV) 22 | ek (mV) 23 | ik (mA/cm2) 24 | g (S/cm2) 25 | celsius (degC) 26 | mInf 27 | mTau 28 | mAlpha 29 | mBeta 30 | } 31 | 32 | STATE { 33 | m 34 | } 35 | 36 | BREAKPOINT { 37 | SOLVE states METHOD cnexp 38 | g = gbar*m 39 | ik = g*(v-ek) 40 | } 41 | 42 | DERIVATIVE states { 43 | rates() 44 | m' = (mInf-m)/mTau 45 | } 46 | 47 | INITIAL{ 48 | rates() 49 | m = mInf 50 | } 51 | 52 | PROCEDURE rates(){ 53 | LOCAL qt 54 | qt = 2.3^((celsius-21)/10) 55 | 56 | UNITSOFF 57 | mAlpha = 3.3e-3*exp(2.5*0.04*(v - -35)) 58 | mBeta = 3.3e-3*exp(-2.5*0.04*(v - -35)) 59 | mInf = mAlpha/(mAlpha + mBeta) 60 | mTau = (1/(mAlpha + mBeta))/qt 61 | UNITSON 62 | } 63 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/Im_v2.mod: -------------------------------------------------------------------------------- 1 | : Based on Im model of Vervaeke et al. (2006) 2 | 3 | NEURON { 4 | SUFFIX Im_v2 5 | USEION k READ ek WRITE ik 6 | RANGE gbar, g, ik 7 | } 8 | 9 | UNITS { 10 | (S) = (siemens) 11 | (mV) = (millivolt) 12 | (mA) = (milliamp) 13 | } 14 | 15 | PARAMETER { 16 | gbar = 0.00001 (S/cm2) 17 | } 18 | 19 | ASSIGNED { 20 | v (mV) 21 | ek (mV) 22 | ik (mA/cm2) 23 | g (S/cm2) 24 | celsius (degC) 25 | mInf 26 | mTau 27 | mAlpha 28 | mBeta 29 | } 30 | 31 | STATE { 32 | m 33 | } 34 | 35 | BREAKPOINT { 36 | SOLVE states METHOD cnexp 37 | g = gbar * m 38 | ik = g * (v - ek) 39 | } 40 | 41 | DERIVATIVE states { 42 | rates() 43 | m' = (mInf - m) / mTau 44 | } 45 | 46 | INITIAL{ 47 | rates() 48 | m = mInf 49 | } 50 | 51 | PROCEDURE rates() { 52 | LOCAL qt 53 | qt = 2.3^((celsius-30)/10) 54 | mAlpha = 0.007 * exp( (6 * 0.4 * (v - (-48))) / 26.12 ) 55 | mBeta = 0.007 * exp( (-6 * (1 - 0.4) * (v - (-48))) / 26.12 ) 56 | 57 | mInf = mAlpha / (mAlpha + mBeta) 58 | mTau = (15 + 1 / (mAlpha + mBeta)) / qt 59 | } 60 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/K_P.mod: -------------------------------------------------------------------------------- 1 | : Comment: The persistent component of the K current 2 | : Reference: Voltage-gated K+ channels in layer 5 neocortical pyramidal neurones from young rats:subtypes and gradients,Korngreen and Sakmann, J. Physiology, 2000 3 | 4 | 5 | NEURON { 6 | SUFFIX K_P 7 | USEION k READ ek WRITE ik 8 | RANGE gbar, g, ik 9 | } 10 | 11 | UNITS { 12 | (S) = (siemens) 13 | (mV) = (millivolt) 14 | (mA) = (milliamp) 15 | } 16 | 17 | PARAMETER { 18 | gbar = 0.00001 (S/cm2) 19 | vshift = 0 (mV) 20 | tauF = 1 21 | } 22 | 23 | ASSIGNED { 24 | v (mV) 25 | ek (mV) 26 | ik (mA/cm2) 27 | g (S/cm2) 28 | celsius (degC) 29 | mInf 30 | mTau 31 | hInf 32 | hTau 33 | } 34 | 35 | STATE { 36 | m 37 | h 38 | } 39 | 40 | BREAKPOINT { 41 | SOLVE states METHOD cnexp 42 | g = gbar*m*m*h 43 | ik = g*(v-ek) 44 | } 45 | 46 | DERIVATIVE states { 47 | rates() 48 | m' = (mInf-m)/mTau 49 | h' = (hInf-h)/hTau 50 | } 51 | 52 | INITIAL{ 53 | rates() 54 | m = mInf 55 | h = hInf 56 | } 57 | 58 | PROCEDURE rates() { 59 | LOCAL qt 60 | qt = 2.3^((celsius-21)/10) 61 | UNITSOFF 62 | mInf = 1 / (1 + exp(-(v - (-14.3 + vshift)) / 14.6)) 63 | if (v < -50 + vshift){ 64 | mTau = tauF * (1.25+175.03*exp(-(v - vshift) * -0.026))/qt 65 | } else { 66 | mTau = tauF * (1.25+13*exp(-(v - vshift) * 0.026))/qt 67 | } 68 | hInf = 1/(1 + exp(-(v - (-54 + vshift))/-11)) 69 | hTau = (360+(1010+24*(v - (-55 + vshift)))*exp(-((v - (-75 + vshift))/48)^2))/qt 70 | UNITSON 71 | } 72 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/K_T.mod: -------------------------------------------------------------------------------- 1 | : Comment: The transient component of the K current 2 | : Reference: Voltage-gated K+ channels in layer 5 neocortical pyramidal neurones from young rats:subtypes and gradients,Korngreen and Sakmann, J. Physiology, 2000 3 | 4 | NEURON { 5 | SUFFIX K_T 6 | USEION k READ ek WRITE ik 7 | RANGE gbar, g, ik 8 | } 9 | 10 | UNITS { 11 | (S) = (siemens) 12 | (mV) = (millivolt) 13 | (mA) = (milliamp) 14 | } 15 | 16 | PARAMETER { 17 | gbar = 0.00001 (S/cm2) 18 | vshift = 0 (mV) 19 | mTauF = 1.0 20 | hTauF = 1.0 21 | } 22 | 23 | ASSIGNED { 24 | v (mV) 25 | ek (mV) 26 | ik (mA/cm2) 27 | g (S/cm2) 28 | celsius (degC) 29 | mInf 30 | mTau 31 | hInf 32 | hTau 33 | } 34 | 35 | STATE { 36 | m 37 | h 38 | } 39 | 40 | BREAKPOINT { 41 | SOLVE states METHOD cnexp 42 | g = gbar*m*m*m*m*h 43 | ik = g*(v-ek) 44 | } 45 | 46 | DERIVATIVE states { 47 | rates() 48 | m' = (mInf-m)/mTau 49 | h' = (hInf-h)/hTau 50 | } 51 | 52 | INITIAL{ 53 | rates() 54 | m = mInf 55 | h = hInf 56 | } 57 | 58 | PROCEDURE rates(){ 59 | LOCAL qt 60 | qt = 2.3^((celsius-21)/10) 61 | 62 | UNITSOFF 63 | mInf = 1/(1 + exp(-(v - (-47 + vshift)) / 29)) 64 | mTau = (0.34 + mTauF * 0.92*exp(-((v+71-vshift)/59)^2))/qt 65 | hInf = 1/(1 + exp(-(v+66-vshift)/-10)) 66 | hTau = (8 + hTauF * 49*exp(-((v+73-vshift)/23)^2))/qt 67 | UNITSON 68 | } 69 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/Kd.mod: -------------------------------------------------------------------------------- 1 | : Based on Kd model of Foust et al. (2011) 2 | 3 | 4 | NEURON { 5 | SUFFIX Kd 6 | USEION k READ ek WRITE ik 7 | RANGE gbar, g, ik 8 | } 9 | 10 | UNITS { 11 | (S) = (siemens) 12 | (mV) = (millivolt) 13 | (mA) = (milliamp) 14 | } 15 | 16 | PARAMETER { 17 | gbar = 0.00001 (S/cm2) 18 | } 19 | 20 | ASSIGNED { 21 | v (mV) 22 | ek (mV) 23 | ik (mA/cm2) 24 | g (S/cm2) 25 | celsius (degC) 26 | mInf 27 | mTau 28 | hInf 29 | hTau 30 | } 31 | 32 | STATE { 33 | m 34 | h 35 | } 36 | 37 | BREAKPOINT { 38 | SOLVE states METHOD cnexp 39 | g = gbar * m * h 40 | ik = g * (v - ek) 41 | } 42 | 43 | DERIVATIVE states { 44 | rates() 45 | m' = (mInf - m) / mTau 46 | h' = (hInf - h) / hTau 47 | } 48 | 49 | INITIAL{ 50 | rates() 51 | m = mInf 52 | h = hInf 53 | } 54 | 55 | PROCEDURE rates() { 56 | LOCAL qt 57 | qt = 2.3^((celsius-23)/10) 58 | mInf = 1 - 1 / (1 + exp((v - (-43)) / 8)) 59 | mTau = 1 60 | hInf = 1 / (1 + exp((v - (-67)) / 7.3)) 61 | hTau = 1500 62 | } 63 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/Kv2like.mod: -------------------------------------------------------------------------------- 1 | : Kv2-like channel 2 | : Adapted from model implemented in Keren et al. 2005 3 | : Adjusted parameters to be similar to guangxitoxin-sensitive current in mouse CA1 pyramids from Liu and Bean 2014 4 | 5 | 6 | NEURON { 7 | SUFFIX Kv2like 8 | USEION k READ ek WRITE ik 9 | RANGE gbar, g, ik 10 | } 11 | 12 | UNITS { 13 | (S) = (siemens) 14 | (mV) = (millivolt) 15 | (mA) = (milliamp) 16 | } 17 | 18 | PARAMETER { 19 | gbar = 0.00001 (S/cm2) 20 | } 21 | 22 | ASSIGNED { 23 | v (mV) 24 | ek (mV) 25 | ik (mA/cm2) 26 | g (S/cm2) 27 | celsius (degC) 28 | mInf 29 | mAlpha 30 | mBeta 31 | mTau 32 | hInf 33 | h1Tau 34 | h2Tau 35 | } 36 | 37 | STATE { 38 | m 39 | h1 40 | h2 41 | } 42 | 43 | BREAKPOINT { 44 | SOLVE states METHOD cnexp 45 | g = gbar * m * m * (0.5 * h1 + 0.5 * h2) 46 | ik = g * (v - ek) 47 | } 48 | 49 | DERIVATIVE states { 50 | rates() 51 | m' = (mInf - m) / mTau 52 | h1' = (hInf - h1) / h1Tau 53 | h2' = (hInf - h2) / h2Tau 54 | } 55 | 56 | INITIAL{ 57 | rates() 58 | m = mInf 59 | h1 = hInf 60 | h2 = hInf 61 | } 62 | 63 | PROCEDURE rates() { 64 | LOCAL qt 65 | qt = 2.3^((celsius-21)/10) 66 | UNITSOFF 67 | mAlpha = 0.12 * vtrap( -(v - 43), 11.0) 68 | mBeta = 0.02 * exp(-(v + 1.27) / 120) 69 | mInf = mAlpha / (mAlpha + mBeta) 70 | mTau = 2.5 * (1 / (qt * (mAlpha + mBeta))) 71 | 72 | hInf = 1/(1 + exp((v + 58) / 11)) 73 | h1Tau = (360 + (1010 + 23.7 * (v + 54)) * exp(-((v + 75) / 48)^2)) / qt 74 | h2Tau = (2350 + 1380 * exp(-0.011 * v) - 210 * exp(-0.03 * v)) / qt 75 | UNITSON 76 | } 77 | 78 | FUNCTION vtrap(x, y) { : Traps for 0 in denominator of rate equations 79 | UNITSOFF 80 | if (fabs(x / y) < 1e-6) { 81 | vtrap = y * (1 - x / y / 2) 82 | } else { 83 | vtrap = x / (exp(x / y) - 1) 84 | } 85 | UNITSON 86 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/Kv3_1.mod: -------------------------------------------------------------------------------- 1 | : Comment: Kv3-like potassium current 2 | 3 | NEURON { 4 | SUFFIX Kv3_1 5 | USEION k READ ek WRITE ik 6 | RANGE gbar, g, ik 7 | } 8 | 9 | UNITS { 10 | (S) = (siemens) 11 | (mV) = (millivolt) 12 | (mA) = (milliamp) 13 | } 14 | 15 | PARAMETER { 16 | gbar = 0.00001 (S/cm2) 17 | vshift = 0 (mV) 18 | } 19 | 20 | ASSIGNED { 21 | v (mV) 22 | ek (mV) 23 | ik (mA/cm2) 24 | g (S/cm2) 25 | mInf 26 | mTau 27 | } 28 | 29 | STATE { 30 | m 31 | } 32 | 33 | BREAKPOINT { 34 | SOLVE states METHOD cnexp 35 | g = gbar*m 36 | ik = g*(v-ek) 37 | } 38 | 39 | DERIVATIVE states { 40 | rates() 41 | m' = (mInf-m)/mTau 42 | } 43 | 44 | INITIAL{ 45 | rates() 46 | m = mInf 47 | } 48 | 49 | PROCEDURE rates(){ 50 | UNITSOFF 51 | mInf = 1/(1+exp(((v -(18.700 + vshift))/(-9.700)))) 52 | mTau = 0.2*20.000/(1+exp(((v -(-46.560 + vshift))/(-44.140)))) 53 | UNITSON 54 | } 55 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/NaTa.mod: -------------------------------------------------------------------------------- 1 | : Reference: Colbert and Pan 2002 2 | 3 | NEURON { 4 | SUFFIX NaTa 5 | USEION na READ ena WRITE ina 6 | RANGE gbar, g, ina 7 | } 8 | 9 | UNITS { 10 | (S) = (siemens) 11 | (mV) = (millivolt) 12 | (mA) = (milliamp) 13 | } 14 | 15 | PARAMETER { 16 | gbar = 0.00001 (S/cm2) 17 | 18 | malphaF = 0.182 19 | mbetaF = 0.124 20 | mvhalf = -48 (mV) 21 | mk = 6 (mV) 22 | 23 | halphaF = 0.015 24 | hbetaF = 0.015 25 | hvhalf = -69 (mV) 26 | hk = 6 (mV) 27 | } 28 | 29 | ASSIGNED { 30 | v (mV) 31 | ena (mV) 32 | ina (mA/cm2) 33 | g (S/cm2) 34 | celsius (degC) 35 | mInf 36 | mTau 37 | mAlpha 38 | mBeta 39 | hInf 40 | hTau 41 | hAlpha 42 | hBeta 43 | } 44 | 45 | STATE { 46 | m 47 | h 48 | } 49 | 50 | BREAKPOINT { 51 | SOLVE states METHOD cnexp 52 | g = gbar*m*m*m*h 53 | ina = g*(v-ena) 54 | } 55 | 56 | DERIVATIVE states { 57 | rates() 58 | m' = (mInf-m)/mTau 59 | h' = (hInf-h)/hTau 60 | } 61 | 62 | INITIAL{ 63 | rates() 64 | m = mInf 65 | h = hInf 66 | } 67 | 68 | PROCEDURE rates(){ 69 | LOCAL qt 70 | qt = 2.3^((celsius-23)/10) 71 | 72 | UNITSOFF 73 | mAlpha = malphaF * vtrap(-(v - mvhalf), mk) 74 | mBeta = mbetaF * vtrap((v - mvhalf), mk) 75 | 76 | mInf = mAlpha/(mAlpha + mBeta) 77 | mTau = (1/(mAlpha + mBeta))/qt 78 | 79 | hAlpha = halphaF * vtrap(v - hvhalf, hk) : ng - adjusted this to match actual Colbert & Pan values for soma model 80 | hBeta = hbetaF * vtrap(-(v - hvhalf), hk) : ng - adjusted this to match actual Colbert & Pan values for soma model 81 | 82 | hInf = hAlpha/(hAlpha + hBeta) 83 | hTau = (1/(hAlpha + hBeta))/qt 84 | UNITSON 85 | } 86 | 87 | FUNCTION vtrap(x, y) { : Traps for 0 in denominator of rate equations 88 | UNITSOFF 89 | if (fabs(x / y) < 1e-6) { 90 | vtrap = y * (1 - x / y / 2) 91 | } else { 92 | vtrap = x / (exp(x / y) - 1) 93 | } 94 | UNITSON 95 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/NaTs.mod: -------------------------------------------------------------------------------- 1 | : Reference: Colbert and Pan 2002 2 | 3 | NEURON { 4 | SUFFIX NaTs 5 | USEION na READ ena WRITE ina 6 | RANGE gbar, g, ina 7 | } 8 | 9 | UNITS { 10 | (S) = (siemens) 11 | (mV) = (millivolt) 12 | (mA) = (milliamp) 13 | } 14 | 15 | PARAMETER { 16 | gbar = 0.00001 (S/cm2) 17 | 18 | malphaF = 0.182 19 | mbetaF = 0.124 20 | mvhalf = -40 (mV) 21 | mk = 6 (mV) 22 | 23 | halphaF = 0.015 24 | hbetaF = 0.015 25 | hvhalf = -66 (mV) 26 | hk = 6 (mV) 27 | } 28 | 29 | ASSIGNED { 30 | v (mV) 31 | ena (mV) 32 | ina (mA/cm2) 33 | g (S/cm2) 34 | celsius (degC) 35 | mInf 36 | mTau 37 | mAlpha 38 | mBeta 39 | hInf 40 | hTau 41 | hAlpha 42 | hBeta 43 | } 44 | 45 | STATE { 46 | m 47 | h 48 | } 49 | 50 | BREAKPOINT { 51 | SOLVE states METHOD cnexp 52 | g = gbar*m*m*m*h 53 | ina = g*(v-ena) 54 | } 55 | 56 | DERIVATIVE states { 57 | rates() 58 | m' = (mInf-m)/mTau 59 | h' = (hInf-h)/hTau 60 | } 61 | 62 | INITIAL{ 63 | rates() 64 | m = mInf 65 | h = hInf 66 | } 67 | 68 | PROCEDURE rates(){ 69 | LOCAL qt 70 | qt = 2.3^((celsius-23)/10) 71 | 72 | UNITSOFF 73 | mAlpha = malphaF * vtrap(-(v - mvhalf), mk) 74 | mBeta = mbetaF * vtrap((v - mvhalf), mk) 75 | 76 | mInf = mAlpha/(mAlpha + mBeta) 77 | mTau = (1/(mAlpha + mBeta))/qt 78 | 79 | hAlpha = halphaF * vtrap(v - hvhalf, hk) 80 | hBeta = hbetaF * vtrap(-(v - hvhalf), hk) 81 | 82 | hInf = hAlpha/(hAlpha + hBeta) 83 | hTau = (1/(hAlpha + hBeta))/qt 84 | UNITSON 85 | } 86 | 87 | FUNCTION vtrap(x, y) { : Traps for 0 in denominator of rate equations 88 | UNITSOFF 89 | if (fabs(x / y) < 1e-6) { 90 | vtrap = y * (1 - x / y / 2) 91 | } else { 92 | vtrap = x / (exp(x / y) - 1) 93 | } 94 | UNITSON 95 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/NaV.mod: -------------------------------------------------------------------------------- 1 | TITLE Mouse sodium current 2 | : Kinetics of Carter et al. (2012) 3 | : Based on 37 degC recordings from mouse hippocampal CA1 pyramids 4 | 5 | NEURON { 6 | SUFFIX NaV 7 | USEION na READ ena WRITE ina 8 | RANGE g, gbar 9 | } 10 | 11 | UNITS { 12 | (mV) = (millivolt) 13 | (S) = (siemens) 14 | } 15 | 16 | PARAMETER { 17 | gbar = .015 (S/cm2) 18 | 19 | : kinetic parameters 20 | Con = 0.01 (/ms) : closed -> inactivated transitions 21 | Coff = 40 (/ms) : inactivated -> closed transitions 22 | Oon = 8 (/ms) : open -> Ineg transition 23 | Ooff = 0.05 (/ms) : Ineg -> open transition 24 | alpha = 400 (/ms) 25 | beta = 12 (/ms) 26 | gamma = 250 (/ms) : opening 27 | delta = 60 (/ms) : closing 28 | 29 | alfac = 2.51 30 | btfac = 5.32 31 | 32 | : Vdep 33 | x1 = 24 (mV) : Vdep of activation (alpha) 34 | x2 = -24 (mV) : Vdep of deactivation (beta) 35 | } 36 | 37 | ASSIGNED { 38 | 39 | : rates 40 | f01 (/ms) 41 | f02 (/ms) 42 | f03 (/ms) 43 | f04 (/ms) 44 | f0O (/ms) 45 | f11 (/ms) 46 | f12 (/ms) 47 | f13 (/ms) 48 | f14 (/ms) 49 | f1n (/ms) 50 | fi1 (/ms) 51 | fi2 (/ms) 52 | fi3 (/ms) 53 | fi4 (/ms) 54 | fi5 (/ms) 55 | fin (/ms) 56 | 57 | b01 (/ms) 58 | b02 (/ms) 59 | b03 (/ms) 60 | b04 (/ms) 61 | b0O (/ms) 62 | b11 (/ms) 63 | b12 (/ms) 64 | b13 (/ms) 65 | b14 (/ms) 66 | b1n (/ms) 67 | bi1 (/ms) 68 | bi2 (/ms) 69 | bi3 (/ms) 70 | bi4 (/ms) 71 | bi5 (/ms) 72 | bin (/ms) 73 | 74 | v (mV) 75 | ena (mV) 76 | ina (milliamp/cm2) 77 | g (S/cm2) 78 | celsius (degC) 79 | } 80 | 81 | STATE { 82 | C1 FROM 0 TO 1 83 | C2 FROM 0 TO 1 84 | C3 FROM 0 TO 1 85 | C4 FROM 0 TO 1 86 | C5 FROM 0 TO 1 87 | I1 FROM 0 TO 1 88 | I2 FROM 0 TO 1 89 | I3 FROM 0 TO 1 90 | I4 FROM 0 TO 1 91 | I5 FROM 0 TO 1 92 | O FROM 0 TO 1 93 | I6 FROM 0 TO 1 94 | } 95 | 96 | BREAKPOINT { 97 | SOLVE activation METHOD sparse 98 | g = gbar * O 99 | ina = g * (v - ena) 100 | } 101 | 102 | INITIAL { 103 | rates(v) 104 | SOLVE seqinitial 105 | } 106 | 107 | KINETIC activation 108 | { 109 | rates(v) 110 | ~ C1 <-> C2 (f01,b01) 111 | ~ C2 <-> C3 (f02,b02) 112 | ~ C3 <-> C4 (f03,b03) 113 | ~ C4 <-> C5 (f04,b04) 114 | ~ C5 <-> O (f0O,b0O) 115 | ~ O <-> I6 (fin,bin) 116 | ~ I1 <-> I2 (f11,b11) 117 | ~ I2 <-> I3 (f12,b12) 118 | ~ I3 <-> I4 (f13,b13) 119 | ~ I4 <-> I5 (f14,b14) 120 | ~ I5 <-> I6 (f1n,b1n) 121 | ~ C1 <-> I1 (fi1,bi1) 122 | ~ C2 <-> I2 (fi2,bi2) 123 | ~ C3 <-> I3 (fi3,bi3) 124 | ~ C4 <-> I4 (fi4,bi4) 125 | ~ C5 <-> I5 (fi5,bi5) 126 | 127 | CONSERVE C1 + C2 + C3 + C4 + C5 + O + I1 + I2 + I3 + I4 + I5 + I6 = 1 128 | } 129 | 130 | LINEAR seqinitial { : sets initial equilibrium 131 | ~ I1*bi1 + C2*b01 - C1*( fi1+f01) = 0 132 | ~ C1*f01 + I2*bi2 + C3*b02 - C2*(b01+fi2+f02) = 0 133 | ~ C2*f02 + I3*bi3 + C4*b03 - C3*(b02+fi3+f03) = 0 134 | ~ C3*f03 + I4*bi4 + C5*b04 - C4*(b03+fi4+f04) = 0 135 | ~ C4*f04 + I5*bi5 + O*b0O - C5*(b04+fi5+f0O) = 0 136 | ~ C5*f0O + I6*bin - O*(b0O+fin) = 0 137 | 138 | ~ C1*fi1 + I2*b11 - I1*( bi1+f11) = 0 139 | ~ I1*f11 + C2*fi2 + I3*b12 - I2*(b11+bi2+f12) = 0 140 | ~ I2*f12 + C3*fi3 + I4*bi3 - I3*(b12+bi3+f13) = 0 141 | ~ I3*f13 + C4*fi4 + I5*b14 - I4*(b13+bi4+f14) = 0 142 | ~ I4*f14 + C5*fi5 + I6*b1n - I5*(b14+bi5+f1n) = 0 143 | 144 | ~ C1 + C2 + C3 + C4 + C5 + O + I1 + I2 + I3 + I4 + I5 + I6 = 1 145 | } 146 | 147 | PROCEDURE rates(v(mV) ) 148 | { 149 | LOCAL qt 150 | qt = 2.3^((celsius-37)/10) 151 | 152 | f01 = qt * 4 * alpha * exp(v/x1) 153 | f02 = qt * 3 * alpha * exp(v/x1) 154 | f03 = qt * 2 * alpha * exp(v/x1) 155 | f04 = qt * 1 * alpha * exp(v/x1) 156 | f0O = qt * gamma 157 | f11 = qt * 4 * alpha * alfac * exp(v/x1) 158 | f12 = qt * 3 * alpha * alfac * exp(v/x1) 159 | f13 = qt * 2 * alpha * alfac * exp(v/x1) 160 | f14 = qt * 1 * alpha * alfac * exp(v/x1) 161 | f1n = qt * gamma 162 | fi1 = qt * Con 163 | fi2 = qt * Con * alfac 164 | fi3 = qt * Con * alfac^2 165 | fi4 = qt * Con * alfac^3 166 | fi5 = qt * Con * alfac^4 167 | fin = qt * Oon 168 | 169 | b01 = qt * 1 * beta * exp(v/x2) 170 | b02 = qt * 2 * beta * exp(v/x2) 171 | b03 = qt * 3 * beta * exp(v/x2) 172 | b04 = qt * 4 * beta * exp(v/x2) 173 | b0O = qt * delta 174 | b11 = qt * 1 * beta * exp(v/x2) / btfac 175 | b12 = qt * 2 * beta * exp(v/x2) / btfac 176 | b13 = qt * 3 * beta * exp(v/x2) / btfac 177 | b14 = qt * 4 * beta * exp(v/x2) / btfac 178 | b1n = qt * delta 179 | bi1 = qt * Coff 180 | bi2 = qt * Coff / (btfac) 181 | bi3 = qt * Coff / (btfac^2) 182 | bi4 = qt * Coff / (btfac^3) 183 | bi5 = qt * Coff / (btfac^4) 184 | bin = qt * Ooff 185 | } 186 | 187 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/Nap.mod: -------------------------------------------------------------------------------- 1 | :Reference : Modeled according to kinetics derived from Magistretti & Alonso 1999 2 | :Comment: corrected rates using q10 = 2.3, target temperature 34, orginal 21 3 | 4 | NEURON { 5 | SUFFIX Nap 6 | USEION na READ ena WRITE ina 7 | RANGE gbar, g, ina 8 | } 9 | 10 | UNITS { 11 | (S) = (siemens) 12 | (mV) = (millivolt) 13 | (mA) = (milliamp) 14 | } 15 | 16 | PARAMETER { 17 | gbar = 0.00001 (S/cm2) 18 | } 19 | 20 | ASSIGNED { 21 | v (mV) 22 | ena (mV) 23 | ina (mA/cm2) 24 | g (S/cm2) 25 | celsius (degC) 26 | mInf 27 | hInf 28 | hTau 29 | hAlpha 30 | hBeta 31 | } 32 | 33 | STATE { 34 | h 35 | } 36 | 37 | BREAKPOINT { 38 | SOLVE states METHOD cnexp 39 | rates() 40 | g = gbar*mInf*h 41 | ina = g*(v-ena) 42 | } 43 | 44 | DERIVATIVE states { 45 | rates() 46 | h' = (hInf-h)/hTau 47 | } 48 | 49 | INITIAL{ 50 | rates() 51 | h = hInf 52 | } 53 | 54 | PROCEDURE rates(){ 55 | LOCAL qt 56 | qt = 2.3^((celsius-21)/10) 57 | 58 | UNITSOFF 59 | mInf = 1.0/(1+exp((v- -52.6)/-4.6)) : assuming instantaneous activation as modeled by Magistretti and Alonso 60 | 61 | hInf = 1.0/(1+exp((v- -48.8)/10)) 62 | hAlpha = 2.88e-6 * vtrap(v + 17, 4.63) 63 | hBeta = 6.94e-6 * vtrap(-(v + 64.4), 2.63) 64 | 65 | hTau = (1/(hAlpha + hBeta))/qt 66 | UNITSON 67 | } 68 | 69 | FUNCTION vtrap(x, y) { : Traps for 0 in denominator of rate equations 70 | UNITSOFF 71 | if (fabs(x / y) < 1e-6) { 72 | vtrap = y * (1 - x / y / 2) 73 | } else { 74 | vtrap = x / (exp(x / y) - 1) 75 | } 76 | UNITSON 77 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/SK.mod: -------------------------------------------------------------------------------- 1 | : SK-type calcium-activated potassium current 2 | : Reference : Kohler et al. 1996 3 | 4 | NEURON { 5 | SUFFIX SK 6 | USEION k READ ek WRITE ik 7 | USEION ca READ cai 8 | RANGE gbar, g, ik 9 | } 10 | 11 | UNITS { 12 | (mV) = (millivolt) 13 | (mA) = (milliamp) 14 | (mM) = (milli/liter) 15 | } 16 | 17 | PARAMETER { 18 | v (mV) 19 | gbar = .000001 (mho/cm2) 20 | zTau = 1 (ms) 21 | ek (mV) 22 | cai (mM) 23 | } 24 | 25 | ASSIGNED { 26 | zInf 27 | ik (mA/cm2) 28 | g (S/cm2) 29 | } 30 | 31 | STATE { 32 | z FROM 0 TO 1 33 | } 34 | 35 | BREAKPOINT { 36 | SOLVE states METHOD cnexp 37 | g = gbar * z 38 | ik = g * (v - ek) 39 | } 40 | 41 | DERIVATIVE states { 42 | rates(cai) 43 | z' = (zInf - z) / zTau 44 | } 45 | 46 | PROCEDURE rates(ca(mM)) { 47 | if(ca < 1e-7){ 48 | ca = ca + 1e-07 49 | } 50 | zInf = 1/(1 + (0.00043 / ca)^4.8) 51 | } 52 | 53 | INITIAL { 54 | rates(cai) 55 | z = zInf 56 | } 57 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/modfiles/vecevent.mod: -------------------------------------------------------------------------------- 1 | : Vector stream of events 2 | 3 | NEURON { 4 | ARTIFICIAL_CELL VecStim 5 | } 6 | 7 | ASSIGNED { 8 | index 9 | etime (ms) 10 | space 11 | } 12 | 13 | INITIAL { 14 | index = 0 15 | element() 16 | if (index > 0) { 17 | net_send(etime - t, 1) 18 | } 19 | } 20 | 21 | NET_RECEIVE (w) { 22 | if (flag == 1) { 23 | net_event(t) 24 | element() 25 | if (index > 0) { 26 | net_send(etime - t, 1) 27 | } 28 | } 29 | } 30 | 31 | VERBATIM 32 | extern double* vector_vec(); 33 | extern int vector_capacity(); 34 | extern void* vector_arg(); 35 | ENDVERBATIM 36 | 37 | PROCEDURE element() { 38 | VERBATIM 39 | { void* vv; int i, size; double* px; 40 | i = (int)index; 41 | if (i >= 0) { 42 | vv = *((void**)(&space)); 43 | if (vv) { 44 | size = vector_capacity(vv); 45 | px = vector_vec(vv); 46 | if (i < size) { 47 | etime = px[i]; 48 | index += 1.; 49 | }else{ 50 | index = -1.; 51 | } 52 | }else{ 53 | index = -1.; 54 | } 55 | } 56 | } 57 | ENDVERBATIM 58 | } 59 | 60 | PROCEDURE play() { 61 | VERBATIM 62 | void** vv; 63 | vv = (void**)(&space); 64 | *vv = (void*)0; 65 | if (ifarg(1)) { 66 | *vv = vector_arg(1); 67 | } 68 | ENDVERBATIM 69 | } 70 | 71 | 72 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/CaDynamics.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/CaDynamics.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Ca_HVA.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Ca_HVA.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Ca_LVA.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Ca_LVA.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Ih.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Ih.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Im.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Im.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Im_v2.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Im_v2.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/K_P.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/K_P.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/K_T.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/K_T.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Kd.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Kd.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Kv2like.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Kv2like.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Kv3_1.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Kv3_1.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/NaTa.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/NaTa.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/NaTs.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/NaTs.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/NaV.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/NaV.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Nap.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/Nap.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/SK.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/SK.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/libnrnmech.la: -------------------------------------------------------------------------------- 1 | ../libnrnmech.la -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/libnrnmech.lai: -------------------------------------------------------------------------------- 1 | # libnrnmech.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='libnrnmech.so.0' 9 | 10 | # Names of this library. 11 | library_names='libnrnmech.so.0.0.0 libnrnmech.so.0 libnrnmech.so' 12 | 13 | # The name of the static archive. 14 | old_library='' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags='' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs=' -L/opt/conda/envs/py27/x86_64/lib /opt/conda/envs/py27/x86_64/lib/libnrnoc.la /opt/conda/envs/py27/x86_64/lib/liboc.la -lX11 /opt/conda/envs/py27/x86_64/lib/libmemacs.la /opt/conda/envs/py27/x86_64/lib/libnrnmpi.la /opt/conda/envs/py27/x86_64/lib/libscopmath.la /opt/conda/envs/py27/x86_64/lib/libsparse13.la -lreadline -lncurses /opt/conda/envs/py27/x86_64/lib/libnrniv.la /opt/conda/envs/py27/x86_64/lib/libivoc.la /opt/conda/envs/py27/x86_64/lib/libneuron_gnu.la /opt/conda/envs/py27/x86_64/lib/libmeschach.la /opt/conda/envs/py27/x86_64/lib/libsundials.la /opt/conda/envs/py27/x86_64/lib/libivos.la /opt/conda/envs/py27/lib/libopa.la /opt/conda/envs/py27/lib/libmpl.la -lm -ldl' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libnrnmech. 26 | current=0 27 | age=0 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=yes 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/opt/conda/envs/py27/x86_64/lib' 42 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/libnrnmech.so: -------------------------------------------------------------------------------- 1 | libnrnmech.so.0.0.0 -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/libnrnmech.so.0: -------------------------------------------------------------------------------- 1 | libnrnmech.so.0.0.0 -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/libnrnmech.so.0.0.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/libnrnmech.so.0.0.0 -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/mod_func.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/mod_func.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/vecevent.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/vecevent.o -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/CaDynamics.c: -------------------------------------------------------------------------------- 1 | /* Created by Language version: 6.2.0 */ 2 | /* VECTORIZED */ 3 | #include 4 | #include 5 | #include 6 | #include "scoplib_ansi.h" 7 | #undef PI 8 | #define nil 0 9 | #include "md1redef.h" 10 | #include "section.h" 11 | #include "nrniv_mf.h" 12 | #include "md2redef.h" 13 | 14 | #if METHOD3 15 | extern int _method3; 16 | #endif 17 | 18 | #if !NRNGPU 19 | #undef exp 20 | #define exp hoc_Exp 21 | extern double hoc_Exp(double); 22 | #endif 23 | 24 | #define _threadargscomma_ _p, _ppvar, _thread, _nt, 25 | #define _threadargs_ _p, _ppvar, _thread, _nt 26 | 27 | #define _threadargsprotocomma_ double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt, 28 | #define _threadargsproto_ double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt 29 | /*SUPPRESS 761*/ 30 | /*SUPPRESS 762*/ 31 | /*SUPPRESS 763*/ 32 | /*SUPPRESS 765*/ 33 | extern double *getarg(); 34 | /* Thread safe. No static _p or _ppvar. */ 35 | 36 | #define t _nt->_t 37 | #define dt _nt->_dt 38 | #define gamma _p[0] 39 | #define decay _p[1] 40 | #define depth _p[2] 41 | #define minCai _p[3] 42 | #define ica _p[4] 43 | #define cai _p[5] 44 | #define Dcai _p[6] 45 | #define v _p[7] 46 | #define _g _p[8] 47 | #define _ion_ica *_ppvar[0]._pval 48 | #define _ion_cai *_ppvar[1]._pval 49 | #define _style_ca *((int*)_ppvar[2]._pvoid) 50 | 51 | #if MAC 52 | #if !defined(v) 53 | #define v _mlhv 54 | #endif 55 | #if !defined(h) 56 | #define h _mlhh 57 | #endif 58 | #endif 59 | 60 | #if defined(__cplusplus) 61 | extern "C" { 62 | #endif 63 | static int hoc_nrnpointerindex = -1; 64 | static Datum* _extcall_thread; 65 | static Prop* _extcall_prop; 66 | /* external NEURON variables */ 67 | /* declaration of user functions */ 68 | static int _mechtype; 69 | extern void _nrn_cacheloop_reg(int, int); 70 | extern void hoc_register_prop_size(int, int, int); 71 | extern void hoc_register_limits(int, HocParmLimits*); 72 | extern void hoc_register_units(int, HocParmUnits*); 73 | extern void nrn_promote(Prop*, int, int); 74 | extern Memb_func* memb_func; 75 | extern void _nrn_setdata_reg(int, void(*)(Prop*)); 76 | static void _setdata(Prop* _prop) { 77 | _extcall_prop = _prop; 78 | } 79 | static void _hoc_setdata() { 80 | Prop *_prop, *hoc_getdata_range(int); 81 | _prop = hoc_getdata_range(_mechtype); 82 | _setdata(_prop); 83 | hoc_retpushx(1.); 84 | } 85 | /* connect user functions to hoc names */ 86 | static VoidFunc hoc_intfunc[] = { 87 | "setdata_CaDynamics", _hoc_setdata, 88 | 0, 0 89 | }; 90 | /* declare global and static user variables */ 91 | /* some parameters have upper and lower limits */ 92 | static HocParmLimits _hoc_parm_limits[] = { 93 | 0,0,0 94 | }; 95 | static HocParmUnits _hoc_parm_units[] = { 96 | "decay_CaDynamics", "ms", 97 | "depth_CaDynamics", "um", 98 | "minCai_CaDynamics", "mM", 99 | 0,0 100 | }; 101 | static double cai0 = 0; 102 | static double delta_t = 0.01; 103 | /* connect global user variables to hoc */ 104 | static DoubScal hoc_scdoub[] = { 105 | 0,0 106 | }; 107 | static DoubVec hoc_vdoub[] = { 108 | 0,0,0 109 | }; 110 | static double _sav_indep; 111 | static void nrn_alloc(Prop*); 112 | static void nrn_init(_NrnThread*, _Memb_list*, int); 113 | static void nrn_state(_NrnThread*, _Memb_list*, int); 114 | static void nrn_cur(_NrnThread*, _Memb_list*, int); 115 | static void nrn_jacob(_NrnThread*, _Memb_list*, int); 116 | 117 | static int _ode_count(int); 118 | static void _ode_map(int, double**, double**, double*, Datum*, double*, int); 119 | static void _ode_spec(_NrnThread*, _Memb_list*, int); 120 | static void _ode_matsol(_NrnThread*, _Memb_list*, int); 121 | 122 | #define _cvode_ieq _ppvar[3]._i 123 | /* connect range variables in _p that hoc is supposed to know about */ 124 | static const char *_mechanism[] = { 125 | "6.2.0", 126 | "CaDynamics", 127 | "gamma_CaDynamics", 128 | "decay_CaDynamics", 129 | "depth_CaDynamics", 130 | "minCai_CaDynamics", 131 | 0, 132 | 0, 133 | 0, 134 | 0}; 135 | static Symbol* _ca_sym; 136 | 137 | extern Prop* need_memb(Symbol*); 138 | 139 | static void nrn_alloc(Prop* _prop) { 140 | Prop *prop_ion; 141 | double *_p; Datum *_ppvar; 142 | _p = nrn_prop_data_alloc(_mechtype, 9, _prop); 143 | /*initialize range parameters*/ 144 | gamma = 0.05; 145 | decay = 80; 146 | depth = 0.1; 147 | minCai = 0.0001; 148 | _prop->param = _p; 149 | _prop->param_size = 9; 150 | _ppvar = nrn_prop_datum_alloc(_mechtype, 4, _prop); 151 | _prop->dparam = _ppvar; 152 | /*connect ionic variables to this model*/ 153 | prop_ion = need_memb(_ca_sym); 154 | nrn_check_conc_write(_prop, prop_ion, 1); 155 | nrn_promote(prop_ion, 3, 0); 156 | _ppvar[0]._pval = &prop_ion->param[3]; /* ica */ 157 | _ppvar[1]._pval = &prop_ion->param[1]; /* cai */ 158 | _ppvar[2]._pvoid = (void*)(&(prop_ion->dparam[0]._i)); /* iontype for ca */ 159 | 160 | } 161 | static void _initlists(); 162 | /* some states have an absolute tolerance */ 163 | static Symbol** _atollist; 164 | static HocStateTolerance _hoc_state_tol[] = { 165 | 0,0 166 | }; 167 | static void _update_ion_pointer(Datum*); 168 | extern Symbol* hoc_lookup(const char*); 169 | extern void _nrn_thread_reg(int, int, void(*f)(Datum*)); 170 | extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); 171 | extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); 172 | extern void _cvode_abstol( Symbol**, double*, int); 173 | 174 | void _CaDynamics_reg() { 175 | int _vectorized = 1; 176 | _initlists(); 177 | ion_reg("ca", -10000.); 178 | _ca_sym = hoc_lookup("ca_ion"); 179 | register_mech(_mechanism, nrn_alloc,nrn_cur, nrn_jacob, nrn_state, nrn_init, hoc_nrnpointerindex, 1); 180 | _mechtype = nrn_get_mechtype(_mechanism[1]); 181 | _nrn_setdata_reg(_mechtype, _setdata); 182 | _nrn_thread_reg(_mechtype, 2, _update_ion_pointer); 183 | hoc_register_prop_size(_mechtype, 9, 4); 184 | nrn_writes_conc(_mechtype, 0); 185 | hoc_register_cvode(_mechtype, _ode_count, _ode_map, _ode_spec, _ode_matsol); 186 | hoc_register_tolerance(_mechtype, _hoc_state_tol, &_atollist); 187 | hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); 188 | ivoc_help("help ?1 CaDynamics /home/forrestc/SWDB_2017/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/CaDynamics.mod\n"); 189 | hoc_register_limits(_mechtype, _hoc_parm_limits); 190 | hoc_register_units(_mechtype, _hoc_parm_units); 191 | } 192 | static double FARADAY = 96485.3; 193 | static int _reset; 194 | static char *modelname = ""; 195 | 196 | static int error; 197 | static int _ninits = 0; 198 | static int _match_recurse=1; 199 | static void _modl_cleanup(){ _match_recurse=1;} 200 | 201 | static int _ode_spec1(_threadargsproto_); 202 | /*static int _ode_matsol1(_threadargsproto_);*/ 203 | static int _slist1[1], _dlist1[1]; 204 | static int states(_threadargsproto_); 205 | 206 | /*CVODE*/ 207 | static int _ode_spec1 (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) {int _reset = 0; { 208 | Dcai = - ( 10000.0 ) * ( ica * gamma / ( 2.0 * FARADAY * depth ) ) - ( cai - minCai ) / decay ; 209 | } 210 | return _reset; 211 | } 212 | static int _ode_matsol1 (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { 213 | Dcai = Dcai / (1. - dt*( ( - ( ( 1.0 ) ) / decay ) )) ; 214 | return 0; 215 | } 216 | /*END CVODE*/ 217 | static int states (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { { 218 | cai = cai + (1. - exp(dt*(( - ( ( 1.0 ) ) / decay ))))*(- ( (- ( 10000.0 ))*(( ( (ica)*(gamma) ) / ( 2.0 * FARADAY * depth ) )) - ( ( ( - minCai ) ) ) / decay ) / ( ( - ( ( 1.0 ) ) / decay) ) - cai) ; 219 | } 220 | return 0; 221 | } 222 | 223 | static int _ode_count(int _type){ return 1;} 224 | 225 | static void _ode_spec(_NrnThread* _nt, _Memb_list* _ml, int _type) { 226 | double* _p; Datum* _ppvar; Datum* _thread; 227 | Node* _nd; double _v; int _iml, _cntml; 228 | _cntml = _ml->_nodecount; 229 | _thread = _ml->_thread; 230 | for (_iml = 0; _iml < _cntml; ++_iml) { 231 | _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; 232 | _nd = _ml->_nodelist[_iml]; 233 | v = NODEV(_nd); 234 | ica = _ion_ica; 235 | cai = _ion_cai; 236 | _ode_spec1 (_p, _ppvar, _thread, _nt); 237 | _ion_cai = cai; 238 | }} 239 | 240 | static void _ode_map(int _ieq, double** _pv, double** _pvdot, double* _pp, Datum* _ppd, double* _atol, int _type) { 241 | double* _p; Datum* _ppvar; 242 | int _i; _p = _pp; _ppvar = _ppd; 243 | _cvode_ieq = _ieq; 244 | for (_i=0; _i < 1; ++_i) { 245 | _pv[_i] = _pp + _slist1[_i]; _pvdot[_i] = _pp + _dlist1[_i]; 246 | _cvode_abstol(_atollist, _atol, _i); 247 | } 248 | _pv[0] = &(_ion_cai); 249 | } 250 | 251 | static void _ode_matsol(_NrnThread* _nt, _Memb_list* _ml, int _type) { 252 | double* _p; Datum* _ppvar; Datum* _thread; 253 | Node* _nd; double _v; int _iml, _cntml; 254 | _cntml = _ml->_nodecount; 255 | _thread = _ml->_thread; 256 | for (_iml = 0; _iml < _cntml; ++_iml) { 257 | _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; 258 | _nd = _ml->_nodelist[_iml]; 259 | v = NODEV(_nd); 260 | ica = _ion_ica; 261 | cai = _ion_cai; 262 | _ode_matsol1 (_p, _ppvar, _thread, _nt); 263 | }} 264 | extern void nrn_update_ion_pointer(Symbol*, Datum*, int, int); 265 | static void _update_ion_pointer(Datum* _ppvar) { 266 | nrn_update_ion_pointer(_ca_sym, _ppvar, 0, 3); 267 | nrn_update_ion_pointer(_ca_sym, _ppvar, 1, 1); 268 | } 269 | 270 | static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { 271 | int _i; double _save;{ 272 | { 273 | cai = minCai ; 274 | } 275 | 276 | } 277 | } 278 | 279 | static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ 280 | double* _p; Datum* _ppvar; Datum* _thread; 281 | Node *_nd; double _v; int* _ni; int _iml, _cntml; 282 | #if CACHEVEC 283 | _ni = _ml->_nodeindices; 284 | #endif 285 | _cntml = _ml->_nodecount; 286 | _thread = _ml->_thread; 287 | for (_iml = 0; _iml < _cntml; ++_iml) { 288 | _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; 289 | #if CACHEVEC 290 | if (use_cachevec) { 291 | _v = VEC_V(_ni[_iml]); 292 | }else 293 | #endif 294 | { 295 | _nd = _ml->_nodelist[_iml]; 296 | _v = NODEV(_nd); 297 | } 298 | v = _v; 299 | ica = _ion_ica; 300 | cai = _ion_cai; 301 | initmodel(_p, _ppvar, _thread, _nt); 302 | _ion_cai = cai; 303 | nrn_wrote_conc(_ca_sym, (&(_ion_cai)) - 1, _style_ca); 304 | }} 305 | 306 | static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt, double _v){double _current=0.;v=_v;{ 307 | } return _current; 308 | } 309 | 310 | static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type) { 311 | double* _p; Datum* _ppvar; Datum* _thread; 312 | Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; 313 | #if CACHEVEC 314 | _ni = _ml->_nodeindices; 315 | #endif 316 | _cntml = _ml->_nodecount; 317 | _thread = _ml->_thread; 318 | for (_iml = 0; _iml < _cntml; ++_iml) { 319 | _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; 320 | #if CACHEVEC 321 | if (use_cachevec) { 322 | _v = VEC_V(_ni[_iml]); 323 | }else 324 | #endif 325 | { 326 | _nd = _ml->_nodelist[_iml]; 327 | _v = NODEV(_nd); 328 | } 329 | 330 | }} 331 | 332 | static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type) { 333 | double* _p; Datum* _ppvar; Datum* _thread; 334 | Node *_nd; int* _ni; int _iml, _cntml; 335 | #if CACHEVEC 336 | _ni = _ml->_nodeindices; 337 | #endif 338 | _cntml = _ml->_nodecount; 339 | _thread = _ml->_thread; 340 | for (_iml = 0; _iml < _cntml; ++_iml) { 341 | _p = _ml->_data[_iml]; 342 | #if CACHEVEC 343 | if (use_cachevec) { 344 | VEC_D(_ni[_iml]) += _g; 345 | }else 346 | #endif 347 | { 348 | _nd = _ml->_nodelist[_iml]; 349 | NODED(_nd) += _g; 350 | } 351 | 352 | }} 353 | 354 | static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type) { 355 | double _break, _save; 356 | double* _p; Datum* _ppvar; Datum* _thread; 357 | Node *_nd; double _v; int* _ni; int _iml, _cntml; 358 | #if CACHEVEC 359 | _ni = _ml->_nodeindices; 360 | #endif 361 | _cntml = _ml->_nodecount; 362 | _thread = _ml->_thread; 363 | for (_iml = 0; _iml < _cntml; ++_iml) { 364 | _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; 365 | _nd = _ml->_nodelist[_iml]; 366 | #if CACHEVEC 367 | if (use_cachevec) { 368 | _v = VEC_V(_ni[_iml]); 369 | }else 370 | #endif 371 | { 372 | _nd = _ml->_nodelist[_iml]; 373 | _v = NODEV(_nd); 374 | } 375 | _break = t + .5*dt; _save = t; 376 | v=_v; 377 | { 378 | ica = _ion_ica; 379 | cai = _ion_cai; 380 | { { 381 | for (; t < _break; t += dt) { 382 | states(_p, _ppvar, _thread, _nt); 383 | 384 | }} 385 | t = _save; 386 | } { 387 | } 388 | _ion_cai = cai; 389 | }} 390 | 391 | } 392 | 393 | static void terminal(){} 394 | 395 | static void _initlists(){ 396 | double _x; double* _p = &_x; 397 | int _i; static int _first = 1; 398 | if (!_first) return; 399 | _slist1[0] = &(cai) - _p; _dlist1[0] = &(Dcai) - _p; 400 | _first = 0; 401 | } 402 | 403 | #if defined(__cplusplus) 404 | } /* extern "C" */ 405 | #endif 406 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/CaDynamics.lo: -------------------------------------------------------------------------------- 1 | # CaDynamics.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/CaDynamics.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/CaDynamics.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/CaDynamics.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Ca_HVA.lo: -------------------------------------------------------------------------------- 1 | # Ca_HVA.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/Ca_HVA.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Ca_HVA.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/Ca_HVA.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Ca_LVA.lo: -------------------------------------------------------------------------------- 1 | # Ca_LVA.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/Ca_LVA.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Ca_LVA.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/Ca_LVA.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Ih.c: -------------------------------------------------------------------------------- 1 | /* Created by Language version: 6.2.0 */ 2 | /* VECTORIZED */ 3 | #include 4 | #include 5 | #include 6 | #include "scoplib_ansi.h" 7 | #undef PI 8 | #define nil 0 9 | #include "md1redef.h" 10 | #include "section.h" 11 | #include "nrniv_mf.h" 12 | #include "md2redef.h" 13 | 14 | #if METHOD3 15 | extern int _method3; 16 | #endif 17 | 18 | #if !NRNGPU 19 | #undef exp 20 | #define exp hoc_Exp 21 | extern double hoc_Exp(double); 22 | #endif 23 | 24 | #define _threadargscomma_ _p, _ppvar, _thread, _nt, 25 | #define _threadargs_ _p, _ppvar, _thread, _nt 26 | 27 | #define _threadargsprotocomma_ double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt, 28 | #define _threadargsproto_ double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt 29 | /*SUPPRESS 761*/ 30 | /*SUPPRESS 762*/ 31 | /*SUPPRESS 763*/ 32 | /*SUPPRESS 765*/ 33 | extern double *getarg(); 34 | /* Thread safe. No static _p or _ppvar. */ 35 | 36 | #define t _nt->_t 37 | #define dt _nt->_dt 38 | #define gbar _p[0] 39 | #define ihcn _p[1] 40 | #define g _p[2] 41 | #define m _p[3] 42 | #define mInf _p[4] 43 | #define mTau _p[5] 44 | #define mAlpha _p[6] 45 | #define mBeta _p[7] 46 | #define Dm _p[8] 47 | #define v _p[9] 48 | #define _g _p[10] 49 | 50 | #if MAC 51 | #if !defined(v) 52 | #define v _mlhv 53 | #endif 54 | #if !defined(h) 55 | #define h _mlhh 56 | #endif 57 | #endif 58 | 59 | #if defined(__cplusplus) 60 | extern "C" { 61 | #endif 62 | static int hoc_nrnpointerindex = -1; 63 | static Datum* _extcall_thread; 64 | static Prop* _extcall_prop; 65 | /* external NEURON variables */ 66 | /* declaration of user functions */ 67 | static void _hoc_rates(void); 68 | static void _hoc_vtrap(void); 69 | static int _mechtype; 70 | extern void _nrn_cacheloop_reg(int, int); 71 | extern void hoc_register_prop_size(int, int, int); 72 | extern void hoc_register_limits(int, HocParmLimits*); 73 | extern void hoc_register_units(int, HocParmUnits*); 74 | extern void nrn_promote(Prop*, int, int); 75 | extern Memb_func* memb_func; 76 | extern void _nrn_setdata_reg(int, void(*)(Prop*)); 77 | static void _setdata(Prop* _prop) { 78 | _extcall_prop = _prop; 79 | } 80 | static void _hoc_setdata() { 81 | Prop *_prop, *hoc_getdata_range(int); 82 | _prop = hoc_getdata_range(_mechtype); 83 | _setdata(_prop); 84 | hoc_retpushx(1.); 85 | } 86 | /* connect user functions to hoc names */ 87 | static VoidFunc hoc_intfunc[] = { 88 | "setdata_Ih", _hoc_setdata, 89 | "rates_Ih", _hoc_rates, 90 | "vtrap_Ih", _hoc_vtrap, 91 | 0, 0 92 | }; 93 | #define vtrap vtrap_Ih 94 | extern double vtrap( _threadargsprotocomma_ double , double ); 95 | /* declare global and static user variables */ 96 | #define ehcn ehcn_Ih 97 | double ehcn = -45; 98 | /* some parameters have upper and lower limits */ 99 | static HocParmLimits _hoc_parm_limits[] = { 100 | 0,0,0 101 | }; 102 | static HocParmUnits _hoc_parm_units[] = { 103 | "ehcn_Ih", "mV", 104 | "gbar_Ih", "S/cm2", 105 | "ihcn_Ih", "mA/cm2", 106 | "g_Ih", "S/cm2", 107 | 0,0 108 | }; 109 | static double delta_t = 0.01; 110 | static double m0 = 0; 111 | /* connect global user variables to hoc */ 112 | static DoubScal hoc_scdoub[] = { 113 | "ehcn_Ih", &ehcn_Ih, 114 | 0,0 115 | }; 116 | static DoubVec hoc_vdoub[] = { 117 | 0,0,0 118 | }; 119 | static double _sav_indep; 120 | static void nrn_alloc(Prop*); 121 | static void nrn_init(_NrnThread*, _Memb_list*, int); 122 | static void nrn_state(_NrnThread*, _Memb_list*, int); 123 | static void nrn_cur(_NrnThread*, _Memb_list*, int); 124 | static void nrn_jacob(_NrnThread*, _Memb_list*, int); 125 | 126 | static int _ode_count(int); 127 | static void _ode_map(int, double**, double**, double*, Datum*, double*, int); 128 | static void _ode_spec(_NrnThread*, _Memb_list*, int); 129 | static void _ode_matsol(_NrnThread*, _Memb_list*, int); 130 | 131 | #define _cvode_ieq _ppvar[0]._i 132 | /* connect range variables in _p that hoc is supposed to know about */ 133 | static const char *_mechanism[] = { 134 | "6.2.0", 135 | "Ih", 136 | "gbar_Ih", 137 | 0, 138 | "ihcn_Ih", 139 | "g_Ih", 140 | 0, 141 | "m_Ih", 142 | 0, 143 | 0}; 144 | 145 | extern Prop* need_memb(Symbol*); 146 | 147 | static void nrn_alloc(Prop* _prop) { 148 | Prop *prop_ion; 149 | double *_p; Datum *_ppvar; 150 | _p = nrn_prop_data_alloc(_mechtype, 11, _prop); 151 | /*initialize range parameters*/ 152 | gbar = 1e-05; 153 | _prop->param = _p; 154 | _prop->param_size = 11; 155 | _ppvar = nrn_prop_datum_alloc(_mechtype, 1, _prop); 156 | _prop->dparam = _ppvar; 157 | /*connect ionic variables to this model*/ 158 | 159 | } 160 | static void _initlists(); 161 | /* some states have an absolute tolerance */ 162 | static Symbol** _atollist; 163 | static HocStateTolerance _hoc_state_tol[] = { 164 | 0,0 165 | }; 166 | extern Symbol* hoc_lookup(const char*); 167 | extern void _nrn_thread_reg(int, int, void(*f)(Datum*)); 168 | extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); 169 | extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); 170 | extern void _cvode_abstol( Symbol**, double*, int); 171 | 172 | void _Ih_reg() { 173 | int _vectorized = 1; 174 | _initlists(); 175 | register_mech(_mechanism, nrn_alloc,nrn_cur, nrn_jacob, nrn_state, nrn_init, hoc_nrnpointerindex, 1); 176 | _mechtype = nrn_get_mechtype(_mechanism[1]); 177 | _nrn_setdata_reg(_mechtype, _setdata); 178 | hoc_register_prop_size(_mechtype, 11, 1); 179 | hoc_register_cvode(_mechtype, _ode_count, _ode_map, _ode_spec, _ode_matsol); 180 | hoc_register_tolerance(_mechtype, _hoc_state_tol, &_atollist); 181 | hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); 182 | ivoc_help("help ?1 Ih /home/forrestc/SWDB_2017/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Ih.mod\n"); 183 | hoc_register_limits(_mechtype, _hoc_parm_limits); 184 | hoc_register_units(_mechtype, _hoc_parm_units); 185 | } 186 | static int _reset; 187 | static char *modelname = ""; 188 | 189 | static int error; 190 | static int _ninits = 0; 191 | static int _match_recurse=1; 192 | static void _modl_cleanup(){ _match_recurse=1;} 193 | static int rates(_threadargsproto_); 194 | 195 | static int _ode_spec1(_threadargsproto_); 196 | /*static int _ode_matsol1(_threadargsproto_);*/ 197 | static int _slist1[1], _dlist1[1]; 198 | static int states(_threadargsproto_); 199 | 200 | /*CVODE*/ 201 | static int _ode_spec1 (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) {int _reset = 0; { 202 | rates ( _threadargs_ ) ; 203 | Dm = ( mInf - m ) / mTau ; 204 | } 205 | return _reset; 206 | } 207 | static int _ode_matsol1 (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { 208 | rates ( _threadargs_ ) ; 209 | Dm = Dm / (1. - dt*( ( ( ( - 1.0 ) ) ) / mTau )) ; 210 | return 0; 211 | } 212 | /*END CVODE*/ 213 | static int states (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { { 214 | rates ( _threadargs_ ) ; 215 | m = m + (1. - exp(dt*(( ( ( - 1.0 ) ) ) / mTau)))*(- ( ( ( mInf ) ) / mTau ) / ( ( ( ( - 1.0) ) ) / mTau ) - m) ; 216 | } 217 | return 0; 218 | } 219 | 220 | static int rates ( _threadargsproto_ ) { 221 | mAlpha = 0.001 * 6.43 * vtrap ( _threadargscomma_ v + 154.9 , 11.9 ) ; 222 | mBeta = 0.001 * 193.0 * exp ( v / 33.1 ) ; 223 | mInf = mAlpha / ( mAlpha + mBeta ) ; 224 | mTau = 1.0 / ( mAlpha + mBeta ) ; 225 | return 0; } 226 | 227 | static void _hoc_rates(void) { 228 | double _r; 229 | double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; 230 | if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } 231 | _thread = _extcall_thread; 232 | _nt = nrn_threads; 233 | _r = 1.; 234 | rates ( _p, _ppvar, _thread, _nt ); 235 | hoc_retpushx(_r); 236 | } 237 | 238 | double vtrap ( _threadargsprotocomma_ double _lx , double _ly ) { 239 | double _lvtrap; 240 | if ( fabs ( _lx / _ly ) < 1e-6 ) { 241 | _lvtrap = _ly * ( 1.0 - _lx / _ly / 2.0 ) ; 242 | } 243 | else { 244 | _lvtrap = _lx / ( exp ( _lx / _ly ) - 1.0 ) ; 245 | } 246 | 247 | return _lvtrap; 248 | } 249 | 250 | static void _hoc_vtrap(void) { 251 | double _r; 252 | double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; 253 | if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } 254 | _thread = _extcall_thread; 255 | _nt = nrn_threads; 256 | _r = vtrap ( _p, _ppvar, _thread, _nt, *getarg(1) , *getarg(2) ); 257 | hoc_retpushx(_r); 258 | } 259 | 260 | static int _ode_count(int _type){ return 1;} 261 | 262 | static void _ode_spec(_NrnThread* _nt, _Memb_list* _ml, int _type) { 263 | double* _p; Datum* _ppvar; Datum* _thread; 264 | Node* _nd; double _v; int _iml, _cntml; 265 | _cntml = _ml->_nodecount; 266 | _thread = _ml->_thread; 267 | for (_iml = 0; _iml < _cntml; ++_iml) { 268 | _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; 269 | _nd = _ml->_nodelist[_iml]; 270 | v = NODEV(_nd); 271 | _ode_spec1 (_p, _ppvar, _thread, _nt); 272 | }} 273 | 274 | static void _ode_map(int _ieq, double** _pv, double** _pvdot, double* _pp, Datum* _ppd, double* _atol, int _type) { 275 | double* _p; Datum* _ppvar; 276 | int _i; _p = _pp; _ppvar = _ppd; 277 | _cvode_ieq = _ieq; 278 | for (_i=0; _i < 1; ++_i) { 279 | _pv[_i] = _pp + _slist1[_i]; _pvdot[_i] = _pp + _dlist1[_i]; 280 | _cvode_abstol(_atollist, _atol, _i); 281 | } 282 | } 283 | 284 | static void _ode_matsol(_NrnThread* _nt, _Memb_list* _ml, int _type) { 285 | double* _p; Datum* _ppvar; Datum* _thread; 286 | Node* _nd; double _v; int _iml, _cntml; 287 | _cntml = _ml->_nodecount; 288 | _thread = _ml->_thread; 289 | for (_iml = 0; _iml < _cntml; ++_iml) { 290 | _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; 291 | _nd = _ml->_nodelist[_iml]; 292 | v = NODEV(_nd); 293 | _ode_matsol1 (_p, _ppvar, _thread, _nt); 294 | }} 295 | 296 | static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { 297 | int _i; double _save;{ 298 | m = m0; 299 | { 300 | rates ( _threadargs_ ) ; 301 | m = mInf ; 302 | } 303 | 304 | } 305 | } 306 | 307 | static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ 308 | double* _p; Datum* _ppvar; Datum* _thread; 309 | Node *_nd; double _v; int* _ni; int _iml, _cntml; 310 | #if CACHEVEC 311 | _ni = _ml->_nodeindices; 312 | #endif 313 | _cntml = _ml->_nodecount; 314 | _thread = _ml->_thread; 315 | for (_iml = 0; _iml < _cntml; ++_iml) { 316 | _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; 317 | #if CACHEVEC 318 | if (use_cachevec) { 319 | _v = VEC_V(_ni[_iml]); 320 | }else 321 | #endif 322 | { 323 | _nd = _ml->_nodelist[_iml]; 324 | _v = NODEV(_nd); 325 | } 326 | v = _v; 327 | initmodel(_p, _ppvar, _thread, _nt); 328 | }} 329 | 330 | static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt, double _v){double _current=0.;v=_v;{ { 331 | g = gbar * m ; 332 | ihcn = g * ( v - ehcn ) ; 333 | } 334 | _current += ihcn; 335 | 336 | } return _current; 337 | } 338 | 339 | static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type) { 340 | double* _p; Datum* _ppvar; Datum* _thread; 341 | Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; 342 | #if CACHEVEC 343 | _ni = _ml->_nodeindices; 344 | #endif 345 | _cntml = _ml->_nodecount; 346 | _thread = _ml->_thread; 347 | for (_iml = 0; _iml < _cntml; ++_iml) { 348 | _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; 349 | #if CACHEVEC 350 | if (use_cachevec) { 351 | _v = VEC_V(_ni[_iml]); 352 | }else 353 | #endif 354 | { 355 | _nd = _ml->_nodelist[_iml]; 356 | _v = NODEV(_nd); 357 | } 358 | _g = _nrn_current(_p, _ppvar, _thread, _nt, _v + .001); 359 | { _rhs = _nrn_current(_p, _ppvar, _thread, _nt, _v); 360 | } 361 | _g = (_g - _rhs)/.001; 362 | #if CACHEVEC 363 | if (use_cachevec) { 364 | VEC_RHS(_ni[_iml]) -= _rhs; 365 | }else 366 | #endif 367 | { 368 | NODERHS(_nd) -= _rhs; 369 | } 370 | 371 | }} 372 | 373 | static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type) { 374 | double* _p; Datum* _ppvar; Datum* _thread; 375 | Node *_nd; int* _ni; int _iml, _cntml; 376 | #if CACHEVEC 377 | _ni = _ml->_nodeindices; 378 | #endif 379 | _cntml = _ml->_nodecount; 380 | _thread = _ml->_thread; 381 | for (_iml = 0; _iml < _cntml; ++_iml) { 382 | _p = _ml->_data[_iml]; 383 | #if CACHEVEC 384 | if (use_cachevec) { 385 | VEC_D(_ni[_iml]) += _g; 386 | }else 387 | #endif 388 | { 389 | _nd = _ml->_nodelist[_iml]; 390 | NODED(_nd) += _g; 391 | } 392 | 393 | }} 394 | 395 | static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type) { 396 | double _break, _save; 397 | double* _p; Datum* _ppvar; Datum* _thread; 398 | Node *_nd; double _v; int* _ni; int _iml, _cntml; 399 | #if CACHEVEC 400 | _ni = _ml->_nodeindices; 401 | #endif 402 | _cntml = _ml->_nodecount; 403 | _thread = _ml->_thread; 404 | for (_iml = 0; _iml < _cntml; ++_iml) { 405 | _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; 406 | _nd = _ml->_nodelist[_iml]; 407 | #if CACHEVEC 408 | if (use_cachevec) { 409 | _v = VEC_V(_ni[_iml]); 410 | }else 411 | #endif 412 | { 413 | _nd = _ml->_nodelist[_iml]; 414 | _v = NODEV(_nd); 415 | } 416 | _break = t + .5*dt; _save = t; 417 | v=_v; 418 | { 419 | { { 420 | for (; t < _break; t += dt) { 421 | states(_p, _ppvar, _thread, _nt); 422 | 423 | }} 424 | t = _save; 425 | }}} 426 | 427 | } 428 | 429 | static void terminal(){} 430 | 431 | static void _initlists(){ 432 | double _x; double* _p = &_x; 433 | int _i; static int _first = 1; 434 | if (!_first) return; 435 | _slist1[0] = &(m) - _p; _dlist1[0] = &(Dm) - _p; 436 | _first = 0; 437 | } 438 | 439 | #if defined(__cplusplus) 440 | } /* extern "C" */ 441 | #endif 442 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Ih.lo: -------------------------------------------------------------------------------- 1 | # Ih.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/Ih.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Ih.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/Ih.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Im.lo: -------------------------------------------------------------------------------- 1 | # Im.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/Im.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Im.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/Im.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Im_v2.lo: -------------------------------------------------------------------------------- 1 | # Im_v2.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/Im_v2.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Im_v2.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/Im_v2.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/K_P.lo: -------------------------------------------------------------------------------- 1 | # K_P.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/K_P.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/K_P.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/K_P.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/K_T.lo: -------------------------------------------------------------------------------- 1 | # K_T.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/K_T.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/K_T.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/K_T.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Kd.lo: -------------------------------------------------------------------------------- 1 | # Kd.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/Kd.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Kd.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/Kd.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Kv2like.lo: -------------------------------------------------------------------------------- 1 | # Kv2like.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/Kv2like.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Kv2like.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/Kv2like.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Kv3_1.lo: -------------------------------------------------------------------------------- 1 | # Kv3_1.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/Kv3_1.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Kv3_1.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/Kv3_1.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/NaTa.lo: -------------------------------------------------------------------------------- 1 | # NaTa.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/NaTa.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/NaTa.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/NaTa.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/NaTs.lo: -------------------------------------------------------------------------------- 1 | # NaTs.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/NaTs.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/NaTs.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/NaTs.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/NaV.lo: -------------------------------------------------------------------------------- 1 | # NaV.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/NaV.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/NaV.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/NaV.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Nap.lo: -------------------------------------------------------------------------------- 1 | # Nap.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/Nap.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/Nap.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/Nap.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/SK.lo: -------------------------------------------------------------------------------- 1 | # SK.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/SK.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/SK.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/SK.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/libnrnmech.la: -------------------------------------------------------------------------------- 1 | # libnrnmech.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='libnrnmech.so.0' 9 | 10 | # Names of this library. 11 | library_names='libnrnmech.so.0.0.0 libnrnmech.so.0 libnrnmech.so' 12 | 13 | # The name of the static archive. 14 | old_library='' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags='' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs=' -L/opt/conda/envs/py27/x86_64/lib /opt/conda/envs/py27/x86_64/lib/libnrnoc.la /opt/conda/envs/py27/x86_64/lib/liboc.la -lX11 /opt/conda/envs/py27/x86_64/lib/libmemacs.la /opt/conda/envs/py27/x86_64/lib/libnrnmpi.la /opt/conda/envs/py27/x86_64/lib/libscopmath.la /opt/conda/envs/py27/x86_64/lib/libsparse13.la -lreadline -lncurses /opt/conda/envs/py27/x86_64/lib/libnrniv.la /opt/conda/envs/py27/x86_64/lib/libivoc.la /opt/conda/envs/py27/x86_64/lib/libneuron_gnu.la /opt/conda/envs/py27/x86_64/lib/libmeschach.la /opt/conda/envs/py27/x86_64/lib/libsundials.la /opt/conda/envs/py27/x86_64/lib/libivos.la /opt/conda/envs/py27/lib/libopa.la /opt/conda/envs/py27/lib/libmpl.la -lm -ldl' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libnrnmech. 26 | current=0 27 | age=0 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=no 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=yes 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/opt/conda/envs/py27/x86_64/lib' 42 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/mechanisms.mod: -------------------------------------------------------------------------------- 1 | ../mechanisms.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/mod_func.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "hocdec.h" 3 | extern int nrnmpi_myid; 4 | extern int nrn_nobanner_; 5 | 6 | extern void _CaDynamics_reg(void); 7 | extern void _Ca_HVA_reg(void); 8 | extern void _Ca_LVA_reg(void); 9 | extern void _Ih_reg(void); 10 | extern void _Im_reg(void); 11 | extern void _Im_v2_reg(void); 12 | extern void _K_P_reg(void); 13 | extern void _K_T_reg(void); 14 | extern void _Kd_reg(void); 15 | extern void _Kv2like_reg(void); 16 | extern void _Kv3_1_reg(void); 17 | extern void _NaTa_reg(void); 18 | extern void _NaTs_reg(void); 19 | extern void _NaV_reg(void); 20 | extern void _Nap_reg(void); 21 | extern void _SK_reg(void); 22 | extern void _vecevent_reg(void); 23 | 24 | void modl_reg(){ 25 | if (!nrn_nobanner_) if (nrnmpi_myid < 1) { 26 | fprintf(stderr, "Additional mechanisms from files\n"); 27 | 28 | fprintf(stderr," modfiles/CaDynamics.mod"); 29 | fprintf(stderr," modfiles/Ca_HVA.mod"); 30 | fprintf(stderr," modfiles/Ca_LVA.mod"); 31 | fprintf(stderr," modfiles/Ih.mod"); 32 | fprintf(stderr," modfiles/Im.mod"); 33 | fprintf(stderr," modfiles/Im_v2.mod"); 34 | fprintf(stderr," modfiles/K_P.mod"); 35 | fprintf(stderr," modfiles/K_T.mod"); 36 | fprintf(stderr," modfiles/Kd.mod"); 37 | fprintf(stderr," modfiles/Kv2like.mod"); 38 | fprintf(stderr," modfiles/Kv3_1.mod"); 39 | fprintf(stderr," modfiles/NaTa.mod"); 40 | fprintf(stderr," modfiles/NaTs.mod"); 41 | fprintf(stderr," modfiles/NaV.mod"); 42 | fprintf(stderr," modfiles/Nap.mod"); 43 | fprintf(stderr," modfiles/SK.mod"); 44 | fprintf(stderr," modfiles/vecevent.mod"); 45 | fprintf(stderr, "\n"); 46 | } 47 | _CaDynamics_reg(); 48 | _Ca_HVA_reg(); 49 | _Ca_LVA_reg(); 50 | _Ih_reg(); 51 | _Im_reg(); 52 | _Im_v2_reg(); 53 | _K_P_reg(); 54 | _K_T_reg(); 55 | _Kd_reg(); 56 | _Kv2like_reg(); 57 | _Kv3_1_reg(); 58 | _NaTa_reg(); 59 | _NaTs_reg(); 60 | _NaV_reg(); 61 | _Nap_reg(); 62 | _SK_reg(); 63 | _vecevent_reg(); 64 | } 65 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/mod_func.lo: -------------------------------------------------------------------------------- 1 | # mod_func.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/mod_func.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/special: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if test "x${NRNHOME}" = "x" ; then 3 | NRNHOME="/opt/conda/envs/py27" 4 | fi 5 | if test "x${NRNBIN}" = "x" ; then 6 | NRNBIN="/opt/conda/envs/py27/x86_64/bin/" 7 | fi 8 | if test "" = "yes" ; then 9 | NRNIV="${NRNBIN}nrniv.app/Contents/MacOS/nrniv" 10 | else 11 | NRNIV="${NRNBIN}nrniv" 12 | fi 13 | "${NRNIV}" -dll "/home/forrestc/SWDB_2017/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/.libs/libnrnmech.so" "$@" 14 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/vecevent.c: -------------------------------------------------------------------------------- 1 | /* Created by Language version: 6.2.0 */ 2 | /* NOT VECTORIZED */ 3 | #include 4 | #include 5 | #include 6 | #include "scoplib_ansi.h" 7 | #undef PI 8 | #define nil 0 9 | #include "md1redef.h" 10 | #include "section.h" 11 | #include "nrniv_mf.h" 12 | #include "md2redef.h" 13 | 14 | #if METHOD3 15 | extern int _method3; 16 | #endif 17 | 18 | #if !NRNGPU 19 | #undef exp 20 | #define exp hoc_Exp 21 | extern double hoc_Exp(double); 22 | #endif 23 | 24 | #define _threadargscomma_ /**/ 25 | #define _threadargs_ /**/ 26 | 27 | #define _threadargsprotocomma_ /**/ 28 | #define _threadargsproto_ /**/ 29 | /*SUPPRESS 761*/ 30 | /*SUPPRESS 762*/ 31 | /*SUPPRESS 763*/ 32 | /*SUPPRESS 765*/ 33 | extern double *getarg(); 34 | static double *_p; static Datum *_ppvar; 35 | 36 | #define t nrn_threads->_t 37 | #define dt nrn_threads->_dt 38 | #define index _p[0] 39 | #define etime _p[1] 40 | #define space _p[2] 41 | #define _tsav _p[3] 42 | #define _nd_area *_ppvar[0]._pval 43 | 44 | #if MAC 45 | #if !defined(v) 46 | #define v _mlhv 47 | #endif 48 | #if !defined(h) 49 | #define h _mlhh 50 | #endif 51 | #endif 52 | 53 | #if defined(__cplusplus) 54 | extern "C" { 55 | #endif 56 | static int hoc_nrnpointerindex = -1; 57 | /* external NEURON variables */ 58 | /* declaration of user functions */ 59 | static double _hoc_element(); 60 | static double _hoc_play(); 61 | static int _mechtype; 62 | extern void _nrn_cacheloop_reg(int, int); 63 | extern void hoc_register_prop_size(int, int, int); 64 | extern void hoc_register_limits(int, HocParmLimits*); 65 | extern void hoc_register_units(int, HocParmUnits*); 66 | extern void nrn_promote(Prop*, int, int); 67 | extern Memb_func* memb_func; 68 | extern Prop* nrn_point_prop_; 69 | static int _pointtype; 70 | static void* _hoc_create_pnt(_ho) Object* _ho; { void* create_point_process(); 71 | return create_point_process(_pointtype, _ho); 72 | } 73 | static void _hoc_destroy_pnt(); 74 | static double _hoc_loc_pnt(_vptr) void* _vptr; {double loc_point_process(); 75 | return loc_point_process(_pointtype, _vptr); 76 | } 77 | static double _hoc_has_loc(_vptr) void* _vptr; {double has_loc_point(); 78 | return has_loc_point(_vptr); 79 | } 80 | static double _hoc_get_loc_pnt(_vptr)void* _vptr; { 81 | double get_loc_point_process(); return (get_loc_point_process(_vptr)); 82 | } 83 | extern void _nrn_setdata_reg(int, void(*)(Prop*)); 84 | static void _setdata(Prop* _prop) { 85 | _p = _prop->param; _ppvar = _prop->dparam; 86 | } 87 | static void _hoc_setdata(void* _vptr) { Prop* _prop; 88 | _prop = ((Point_process*)_vptr)->_prop; 89 | _setdata(_prop); 90 | } 91 | /* connect user functions to hoc names */ 92 | static VoidFunc hoc_intfunc[] = { 93 | 0,0 94 | }; 95 | static Member_func _member_func[] = { 96 | "loc", _hoc_loc_pnt, 97 | "has_loc", _hoc_has_loc, 98 | "get_loc", _hoc_get_loc_pnt, 99 | "element", _hoc_element, 100 | "play", _hoc_play, 101 | 0, 0 102 | }; 103 | /* declare global and static user variables */ 104 | /* some parameters have upper and lower limits */ 105 | static HocParmLimits _hoc_parm_limits[] = { 106 | 0,0,0 107 | }; 108 | static HocParmUnits _hoc_parm_units[] = { 109 | 0,0 110 | }; 111 | static double v = 0; 112 | /* connect global user variables to hoc */ 113 | static DoubScal hoc_scdoub[] = { 114 | 0,0 115 | }; 116 | static DoubVec hoc_vdoub[] = { 117 | 0,0,0 118 | }; 119 | static double _sav_indep; 120 | static void nrn_alloc(Prop*); 121 | static void nrn_init(_NrnThread*, _Memb_list*, int); 122 | static void nrn_state(_NrnThread*, _Memb_list*, int); 123 | static void _hoc_destroy_pnt(_vptr) void* _vptr; { 124 | destroy_point_process(_vptr); 125 | } 126 | /* connect range variables in _p that hoc is supposed to know about */ 127 | static const char *_mechanism[] = { 128 | "6.2.0", 129 | "VecStim", 130 | 0, 131 | 0, 132 | 0, 133 | 0}; 134 | 135 | extern Prop* need_memb(Symbol*); 136 | 137 | static void nrn_alloc(Prop* _prop) { 138 | Prop *prop_ion; 139 | double *_p; Datum *_ppvar; 140 | if (nrn_point_prop_) { 141 | _prop->_alloc_seq = nrn_point_prop_->_alloc_seq; 142 | _p = nrn_point_prop_->param; 143 | _ppvar = nrn_point_prop_->dparam; 144 | }else{ 145 | _p = nrn_prop_data_alloc(_mechtype, 4, _prop); 146 | /*initialize range parameters*/ 147 | } 148 | _prop->param = _p; 149 | _prop->param_size = 4; 150 | if (!nrn_point_prop_) { 151 | _ppvar = nrn_prop_datum_alloc(_mechtype, 3, _prop); 152 | } 153 | _prop->dparam = _ppvar; 154 | /*connect ionic variables to this model*/ 155 | 156 | } 157 | static void _initlists(); 158 | 159 | #define _tqitem &(_ppvar[2]._pvoid) 160 | static void _net_receive(Point_process*, double*, double); 161 | extern Symbol* hoc_lookup(const char*); 162 | extern void _nrn_thread_reg(int, int, void(*f)(Datum*)); 163 | extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); 164 | extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); 165 | extern void _cvode_abstol( Symbol**, double*, int); 166 | 167 | void _vecevent_reg() { 168 | int _vectorized = 0; 169 | _initlists(); 170 | _pointtype = point_register_mech(_mechanism, 171 | nrn_alloc,(void*)0, (void*)0, (void*)0, nrn_init, 172 | hoc_nrnpointerindex, 0, 173 | _hoc_create_pnt, _hoc_destroy_pnt, _member_func); 174 | _mechtype = nrn_get_mechtype(_mechanism[1]); 175 | _nrn_setdata_reg(_mechtype, _setdata); 176 | hoc_register_prop_size(_mechtype, 4, 3); 177 | add_nrn_artcell(_mechtype, 2); 178 | add_nrn_has_net_event(_mechtype); 179 | pnt_receive[_mechtype] = _net_receive; 180 | pnt_receive_size[_mechtype] = 1; 181 | hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); 182 | ivoc_help("help ?1 VecStim /home/forrestc/SWDB_2017/DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/vecevent.mod\n"); 183 | hoc_register_limits(_mechtype, _hoc_parm_limits); 184 | hoc_register_units(_mechtype, _hoc_parm_units); 185 | } 186 | static int _reset; 187 | static char *modelname = ""; 188 | 189 | static int error; 190 | static int _ninits = 0; 191 | static int _match_recurse=1; 192 | static void _modl_cleanup(){ _match_recurse=1;} 193 | static int element(); 194 | static int play(); 195 | 196 | static void _net_receive (_pnt, _args, _lflag) Point_process* _pnt; double* _args; double _lflag; 197 | { _p = _pnt->_prop->param; _ppvar = _pnt->_prop->dparam; 198 | if (_tsav > t){ extern char* hoc_object_name(); hoc_execerror(hoc_object_name(_pnt->ob), ":Event arrived out of order. Must call ParallelContext.set_maxstep AFTER assigning minimum NetCon.delay");} 199 | _tsav = t; if (_lflag == 1. ) {*(_tqitem) = 0;} 200 | { 201 | if ( _lflag == 1.0 ) { 202 | net_event ( _pnt, t ) ; 203 | element ( _threadargs_ ) ; 204 | if ( index > 0.0 ) { 205 | artcell_net_send ( _tqitem, _args, _pnt, t + etime - t , 1.0 ) ; 206 | } 207 | } 208 | } } 209 | 210 | /*VERBATIM*/ 211 | extern double* vector_vec(); 212 | extern int vector_capacity(); 213 | extern void* vector_arg(); 214 | 215 | static int element ( ) { 216 | 217 | /*VERBATIM*/ 218 | 219 | { void* vv; int i, size; double* px; 220 | i = (int)index; 221 | if (i >= 0) { 222 | vv = *((void**)(&space)); 223 | if (vv) { 224 | size = vector_capacity(vv); 225 | px = vector_vec(vv); 226 | if (i < size) { 227 | etime = px[i]; 228 | index += 1.; 229 | }else{ 230 | index = -1.; 231 | } 232 | }else{ 233 | index = -1.; 234 | } 235 | } 236 | } 237 | return 0; } 238 | 239 | static double _hoc_element(void* _vptr) { 240 | double _r; 241 | _hoc_setdata(_vptr); 242 | _r = 1.; 243 | element ( ); 244 | return(_r); 245 | } 246 | 247 | static int play ( ) { 248 | 249 | /*VERBATIM*/ 250 | void** vv; 251 | vv = (void**)(&space); 252 | *vv = (void*)0; 253 | if (ifarg(1)) { 254 | *vv = vector_arg(1); 255 | } 256 | return 0; } 257 | 258 | static double _hoc_play(void* _vptr) { 259 | double _r; 260 | _hoc_setdata(_vptr); 261 | _r = 1.; 262 | play ( ); 263 | return(_r); 264 | } 265 | 266 | static void initmodel() { 267 | int _i; double _save;_ninits++; 268 | { 269 | { 270 | index = 0.0 ; 271 | element ( _threadargs_ ) ; 272 | if ( index > 0.0 ) { 273 | artcell_net_send ( _tqitem, (double*)0, _ppvar[1]._pvoid, t + etime - t , 1.0 ) ; 274 | } 275 | } 276 | 277 | } 278 | } 279 | 280 | static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ 281 | Node *_nd; double _v; int* _ni; int _iml, _cntml; 282 | #if CACHEVEC 283 | _ni = _ml->_nodeindices; 284 | #endif 285 | _cntml = _ml->_nodecount; 286 | for (_iml = 0; _iml < _cntml; ++_iml) { 287 | _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; 288 | _tsav = -1e20; 289 | initmodel(); 290 | }} 291 | 292 | static double _nrn_current(double _v){double _current=0.;v=_v;{ 293 | } return _current; 294 | } 295 | 296 | static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type){ 297 | double _break, _save; 298 | Node *_nd; double _v; int* _ni; int _iml, _cntml; 299 | #if CACHEVEC 300 | _ni = _ml->_nodeindices; 301 | #endif 302 | _cntml = _ml->_nodecount; 303 | for (_iml = 0; _iml < _cntml; ++_iml) { 304 | _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; 305 | _nd = _ml->_nodelist[_iml]; 306 | _break = t + .5*dt; _save = t; 307 | v=_v; 308 | { 309 | }} 310 | 311 | } 312 | 313 | static void terminal(){} 314 | 315 | static void _initlists() { 316 | int _i; static int _first = 1; 317 | if (!_first) return; 318 | _first = 0; 319 | } 320 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/vecevent.lo: -------------------------------------------------------------------------------- 1 | # vecevent.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/vecevent.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/mechanisms/x86_64/vecevent.mod: -------------------------------------------------------------------------------- 1 | ../modfiles/vecevent.mod -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/recXelectrodes/linear_electrode.csv: -------------------------------------------------------------------------------- 1 | channel x_pos y_pos z_pos 2 | 0 10.0 0 5.0 3 | 1 10.0 -10 5.0 4 | 2 10.0 -20 5.0 5 | 3 10.0 -30 5.0 6 | 4 10.0 -40 5.0 7 | 5 10.0 -50 5.0 8 | 6 10.0 -60 5.0 9 | 7 10.0 -70 5.0 10 | 8 10.0 -80 5.0 11 | 9 10.0 -90 5.0 12 | 10 10.0 -100 5.0 13 | 11 10.0 -110 5.0 14 | 12 10.0 -120 5.0 15 | 13 10.0 -130 5.0 16 | 14 10.0 -140 5.0 17 | 15 10.0 -150 5.0 18 | 16 10.0 -160 5.0 19 | 17 10.0 -170 5.0 20 | 18 10.0 -180 5.0 21 | 19 10.0 -190 5.0 22 | 20 10.0 -200 5.0 23 | 21 10.0 -210 5.0 24 | 22 10.0 -220 5.0 25 | 23 10.0 -230 5.0 26 | 24 10.0 -240 5.0 27 | 25 10.0 -250 5.0 28 | 26 10.0 -260 5.0 29 | 27 10.0 -270 5.0 30 | 28 10.0 -280 5.0 31 | 29 10.0 -290 5.0 32 | 30 10.0 -300 5.0 33 | 31 10.0 -310 5.0 34 | 32 10.0 -320 5.0 35 | 33 10.0 -330 5.0 36 | 34 10.0 -340 5.0 37 | 35 10.0 -350 5.0 38 | 36 10.0 -360 5.0 39 | 37 10.0 -370 5.0 40 | 38 10.0 -380 5.0 41 | 39 10.0 -390 5.0 42 | 40 10.0 -400 5.0 43 | 41 10.0 -410 5.0 44 | 42 10.0 -420 5.0 45 | 43 10.0 -430 5.0 46 | 44 10.0 -440 5.0 47 | 45 10.0 -450 5.0 48 | 46 10.0 -460 5.0 49 | 47 10.0 -470 5.0 50 | 48 10.0 -480 5.0 51 | 49 10.0 -490 5.0 52 | 50 10.0 -500 5.0 53 | 51 10.0 -510 5.0 54 | 52 10.0 -520 5.0 55 | 53 10.0 -530 5.0 56 | 54 10.0 -540 5.0 57 | 55 10.0 -550 5.0 58 | 56 10.0 -560 5.0 59 | 57 10.0 -570 5.0 60 | 58 10.0 -580 5.0 61 | 59 10.0 -590 5.0 62 | 60 10.0 -600 5.0 63 | 61 10.0 -610 5.0 64 | 62 10.0 -620 5.0 65 | 63 10.0 -630 5.0 66 | 64 10.0 -640 5.0 67 | 65 10.0 -650 5.0 68 | 66 10.0 -660 5.0 69 | 67 10.0 -670 5.0 70 | 68 10.0 -680 5.0 71 | 69 10.0 -690 5.0 72 | 70 10.0 -700 5.0 73 | 71 10.0 -710 5.0 74 | 72 10.0 -720 5.0 75 | 73 10.0 -730 5.0 76 | 74 10.0 -740 5.0 77 | 75 10.0 -750 5.0 78 | 76 10.0 -760 5.0 79 | 77 10.0 -770 5.0 80 | 78 10.0 -780 5.0 81 | 79 10.0 -790 5.0 82 | 80 10.0 -800 5.0 83 | 81 10.0 -810 5.0 84 | 82 10.0 -820 5.0 85 | 83 10.0 -830 5.0 86 | 84 10.0 -840 5.0 87 | 85 10.0 -850 5.0 88 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/recXelectrodes/mesh_electrode.csv: -------------------------------------------------------------------------------- 1 | channel x_pos y_pos z_pos 2 | 0 -80.0 0.0 10.0 3 | 1 -80.0 -20.0 10.0 4 | 2 -80.0 -40.0 10.0 5 | 3 -80.0 -60.0 10.0 6 | 4 -80.0 -80.0 10.0 7 | 5 -80.0 -100.0 10.0 8 | 6 -80.0 -120.0 10.0 9 | 7 -80.0 -140.0 10.0 10 | 8 -80.0 -160.0 10.0 11 | 9 -80.0 -180.0 10.0 12 | 10 -80.0 -200.0 10.0 13 | 11 -80.0 -220.0 10.0 14 | 12 -80.0 -240.0 10.0 15 | 13 -80.0 -260.0 10.0 16 | 14 -80.0 -280.0 10.0 17 | 15 -80.0 -300.0 10.0 18 | 16 -80.0 -320.0 10.0 19 | 17 -80.0 -340.0 10.0 20 | 18 -80.0 -360.0 10.0 21 | 19 -80.0 -380.0 10.0 22 | 20 -80.0 -400.0 10.0 23 | 21 -80.0 -420.0 10.0 24 | 22 -80.0 -440.0 10.0 25 | 23 -80.0 -460.0 10.0 26 | 24 -80.0 -480.0 10.0 27 | 25 -80.0 -500.0 10.0 28 | 26 -80.0 -520.0 10.0 29 | 27 -80.0 -540.0 10.0 30 | 28 -80.0 -560.0 10.0 31 | 29 -80.0 -580.0 10.0 32 | 30 -80.0 -600.0 10.0 33 | 31 -80.0 -620.0 10.0 34 | 32 -80.0 -640.0 10.0 35 | 33 -80.0 -660.0 10.0 36 | 34 -80.0 -680.0 10.0 37 | 35 -80.0 -700.0 10.0 38 | 36 -80.0 -720.0 10.0 39 | 37 -80.0 -740.0 10.0 40 | 38 -80.0 -760.0 10.0 41 | 39 -80.0 -780.0 10.0 42 | 40 -80.0 -800.0 10.0 43 | 41 -80.0 -820.0 10.0 44 | 42 -80.0 -840.0 10.0 45 | 43 -60.0 0.0 10.0 46 | 44 -60.0 -20.0 10.0 47 | 45 -60.0 -40.0 10.0 48 | 46 -60.0 -60.0 10.0 49 | 47 -60.0 -80.0 10.0 50 | 48 -60.0 -100.0 10.0 51 | 49 -60.0 -120.0 10.0 52 | 50 -60.0 -140.0 10.0 53 | 51 -60.0 -160.0 10.0 54 | 52 -60.0 -180.0 10.0 55 | 53 -60.0 -200.0 10.0 56 | 54 -60.0 -220.0 10.0 57 | 55 -60.0 -240.0 10.0 58 | 56 -60.0 -260.0 10.0 59 | 57 -60.0 -280.0 10.0 60 | 58 -60.0 -300.0 10.0 61 | 59 -60.0 -320.0 10.0 62 | 60 -60.0 -340.0 10.0 63 | 61 -60.0 -360.0 10.0 64 | 62 -60.0 -380.0 10.0 65 | 63 -60.0 -400.0 10.0 66 | 64 -60.0 -420.0 10.0 67 | 65 -60.0 -440.0 10.0 68 | 66 -60.0 -460.0 10.0 69 | 67 -60.0 -480.0 10.0 70 | 68 -60.0 -500.0 10.0 71 | 69 -60.0 -520.0 10.0 72 | 70 -60.0 -540.0 10.0 73 | 71 -60.0 -560.0 10.0 74 | 72 -60.0 -580.0 10.0 75 | 73 -60.0 -600.0 10.0 76 | 74 -60.0 -620.0 10.0 77 | 75 -60.0 -640.0 10.0 78 | 76 -60.0 -660.0 10.0 79 | 77 -60.0 -680.0 10.0 80 | 78 -60.0 -700.0 10.0 81 | 79 -60.0 -720.0 10.0 82 | 80 -60.0 -740.0 10.0 83 | 81 -60.0 -760.0 10.0 84 | 82 -60.0 -780.0 10.0 85 | 83 -60.0 -800.0 10.0 86 | 84 -60.0 -820.0 10.0 87 | 85 -60.0 -840.0 10.0 88 | 86 -40.0 0.0 10.0 89 | 87 -40.0 -20.0 10.0 90 | 88 -40.0 -40.0 10.0 91 | 89 -40.0 -60.0 10.0 92 | 90 -40.0 -80.0 10.0 93 | 91 -40.0 -100.0 10.0 94 | 92 -40.0 -120.0 10.0 95 | 93 -40.0 -140.0 10.0 96 | 94 -40.0 -160.0 10.0 97 | 95 -40.0 -180.0 10.0 98 | 96 -40.0 -200.0 10.0 99 | 97 -40.0 -220.0 10.0 100 | 98 -40.0 -240.0 10.0 101 | 99 -40.0 -260.0 10.0 102 | 100 -40.0 -280.0 10.0 103 | 101 -40.0 -300.0 10.0 104 | 102 -40.0 -320.0 10.0 105 | 103 -40.0 -340.0 10.0 106 | 104 -40.0 -360.0 10.0 107 | 105 -40.0 -380.0 10.0 108 | 106 -40.0 -400.0 10.0 109 | 107 -40.0 -420.0 10.0 110 | 108 -40.0 -440.0 10.0 111 | 109 -40.0 -460.0 10.0 112 | 110 -40.0 -480.0 10.0 113 | 111 -40.0 -500.0 10.0 114 | 112 -40.0 -520.0 10.0 115 | 113 -40.0 -540.0 10.0 116 | 114 -40.0 -560.0 10.0 117 | 115 -40.0 -580.0 10.0 118 | 116 -40.0 -600.0 10.0 119 | 117 -40.0 -620.0 10.0 120 | 118 -40.0 -640.0 10.0 121 | 119 -40.0 -660.0 10.0 122 | 120 -40.0 -680.0 10.0 123 | 121 -40.0 -700.0 10.0 124 | 122 -40.0 -720.0 10.0 125 | 123 -40.0 -740.0 10.0 126 | 124 -40.0 -760.0 10.0 127 | 125 -40.0 -780.0 10.0 128 | 126 -40.0 -800.0 10.0 129 | 127 -40.0 -820.0 10.0 130 | 128 -40.0 -840.0 10.0 131 | 129 -20.0 0.0 10.0 132 | 130 -20.0 -20.0 10.0 133 | 131 -20.0 -40.0 10.0 134 | 132 -20.0 -60.0 10.0 135 | 133 -20.0 -80.0 10.0 136 | 134 -20.0 -100.0 10.0 137 | 135 -20.0 -120.0 10.0 138 | 136 -20.0 -140.0 10.0 139 | 137 -20.0 -160.0 10.0 140 | 138 -20.0 -180.0 10.0 141 | 139 -20.0 -200.0 10.0 142 | 140 -20.0 -220.0 10.0 143 | 141 -20.0 -240.0 10.0 144 | 142 -20.0 -260.0 10.0 145 | 143 -20.0 -280.0 10.0 146 | 144 -20.0 -300.0 10.0 147 | 145 -20.0 -320.0 10.0 148 | 146 -20.0 -340.0 10.0 149 | 147 -20.0 -360.0 10.0 150 | 148 -20.0 -380.0 10.0 151 | 149 -20.0 -400.0 10.0 152 | 150 -20.0 -420.0 10.0 153 | 151 -20.0 -440.0 10.0 154 | 152 -20.0 -460.0 10.0 155 | 153 -20.0 -480.0 10.0 156 | 154 -20.0 -500.0 10.0 157 | 155 -20.0 -520.0 10.0 158 | 156 -20.0 -540.0 10.0 159 | 157 -20.0 -560.0 10.0 160 | 158 -20.0 -580.0 10.0 161 | 159 -20.0 -600.0 10.0 162 | 160 -20.0 -620.0 10.0 163 | 161 -20.0 -640.0 10.0 164 | 162 -20.0 -660.0 10.0 165 | 163 -20.0 -680.0 10.0 166 | 164 -20.0 -700.0 10.0 167 | 165 -20.0 -720.0 10.0 168 | 166 -20.0 -740.0 10.0 169 | 167 -20.0 -760.0 10.0 170 | 168 -20.0 -780.0 10.0 171 | 169 -20.0 -800.0 10.0 172 | 170 -20.0 -820.0 10.0 173 | 171 -20.0 -840.0 10.0 174 | 172 0.0 0.0 10.0 175 | 173 0.0 -20.0 10.0 176 | 174 0.0 -40.0 10.0 177 | 175 0.0 -60.0 10.0 178 | 176 0.0 -80.0 10.0 179 | 177 0.0 -100.0 10.0 180 | 178 0.0 -120.0 10.0 181 | 179 0.0 -140.0 10.0 182 | 180 0.0 -160.0 10.0 183 | 181 0.0 -180.0 10.0 184 | 182 0.0 -200.0 10.0 185 | 183 0.0 -220.0 10.0 186 | 184 0.0 -240.0 10.0 187 | 185 0.0 -260.0 10.0 188 | 186 0.0 -280.0 10.0 189 | 187 0.0 -300.0 10.0 190 | 188 0.0 -320.0 10.0 191 | 189 0.0 -340.0 10.0 192 | 190 0.0 -360.0 10.0 193 | 191 0.0 -380.0 10.0 194 | 192 0.0 -400.0 10.0 195 | 193 0.0 -420.0 10.0 196 | 194 0.0 -440.0 10.0 197 | 195 0.0 -460.0 10.0 198 | 196 0.0 -480.0 10.0 199 | 197 0.0 -500.0 10.0 200 | 198 0.0 -520.0 10.0 201 | 199 0.0 -540.0 10.0 202 | 200 0.0 -560.0 10.0 203 | 201 0.0 -580.0 10.0 204 | 202 0.0 -600.0 10.0 205 | 203 0.0 -620.0 10.0 206 | 204 0.0 -640.0 10.0 207 | 205 0.0 -660.0 10.0 208 | 206 0.0 -680.0 10.0 209 | 207 0.0 -700.0 10.0 210 | 208 0.0 -720.0 10.0 211 | 209 0.0 -740.0 10.0 212 | 210 0.0 -760.0 10.0 213 | 211 0.0 -780.0 10.0 214 | 212 0.0 -800.0 10.0 215 | 213 0.0 -820.0 10.0 216 | 214 0.0 -840.0 10.0 217 | 215 20.0 0.0 10.0 218 | 216 20.0 -20.0 10.0 219 | 217 20.0 -40.0 10.0 220 | 218 20.0 -60.0 10.0 221 | 219 20.0 -80.0 10.0 222 | 220 20.0 -100.0 10.0 223 | 221 20.0 -120.0 10.0 224 | 222 20.0 -140.0 10.0 225 | 223 20.0 -160.0 10.0 226 | 224 20.0 -180.0 10.0 227 | 225 20.0 -200.0 10.0 228 | 226 20.0 -220.0 10.0 229 | 227 20.0 -240.0 10.0 230 | 228 20.0 -260.0 10.0 231 | 229 20.0 -280.0 10.0 232 | 230 20.0 -300.0 10.0 233 | 231 20.0 -320.0 10.0 234 | 232 20.0 -340.0 10.0 235 | 233 20.0 -360.0 10.0 236 | 234 20.0 -380.0 10.0 237 | 235 20.0 -400.0 10.0 238 | 236 20.0 -420.0 10.0 239 | 237 20.0 -440.0 10.0 240 | 238 20.0 -460.0 10.0 241 | 239 20.0 -480.0 10.0 242 | 240 20.0 -500.0 10.0 243 | 241 20.0 -520.0 10.0 244 | 242 20.0 -540.0 10.0 245 | 243 20.0 -560.0 10.0 246 | 244 20.0 -580.0 10.0 247 | 245 20.0 -600.0 10.0 248 | 246 20.0 -620.0 10.0 249 | 247 20.0 -640.0 10.0 250 | 248 20.0 -660.0 10.0 251 | 249 20.0 -680.0 10.0 252 | 250 20.0 -700.0 10.0 253 | 251 20.0 -720.0 10.0 254 | 252 20.0 -740.0 10.0 255 | 253 20.0 -760.0 10.0 256 | 254 20.0 -780.0 10.0 257 | 255 20.0 -800.0 10.0 258 | 256 20.0 -820.0 10.0 259 | 257 20.0 -840.0 10.0 260 | 258 40.0 0.0 10.0 261 | 259 40.0 -20.0 10.0 262 | 260 40.0 -40.0 10.0 263 | 261 40.0 -60.0 10.0 264 | 262 40.0 -80.0 10.0 265 | 263 40.0 -100.0 10.0 266 | 264 40.0 -120.0 10.0 267 | 265 40.0 -140.0 10.0 268 | 266 40.0 -160.0 10.0 269 | 267 40.0 -180.0 10.0 270 | 268 40.0 -200.0 10.0 271 | 269 40.0 -220.0 10.0 272 | 270 40.0 -240.0 10.0 273 | 271 40.0 -260.0 10.0 274 | 272 40.0 -280.0 10.0 275 | 273 40.0 -300.0 10.0 276 | 274 40.0 -320.0 10.0 277 | 275 40.0 -340.0 10.0 278 | 276 40.0 -360.0 10.0 279 | 277 40.0 -380.0 10.0 280 | 278 40.0 -400.0 10.0 281 | 279 40.0 -420.0 10.0 282 | 280 40.0 -440.0 10.0 283 | 281 40.0 -460.0 10.0 284 | 282 40.0 -480.0 10.0 285 | 283 40.0 -500.0 10.0 286 | 284 40.0 -520.0 10.0 287 | 285 40.0 -540.0 10.0 288 | 286 40.0 -560.0 10.0 289 | 287 40.0 -580.0 10.0 290 | 288 40.0 -600.0 10.0 291 | 289 40.0 -620.0 10.0 292 | 290 40.0 -640.0 10.0 293 | 291 40.0 -660.0 10.0 294 | 292 40.0 -680.0 10.0 295 | 293 40.0 -700.0 10.0 296 | 294 40.0 -720.0 10.0 297 | 295 40.0 -740.0 10.0 298 | 296 40.0 -760.0 10.0 299 | 297 40.0 -780.0 10.0 300 | 298 40.0 -800.0 10.0 301 | 299 40.0 -820.0 10.0 302 | 300 40.0 -840.0 10.0 303 | 301 60.0 0.0 10.0 304 | 302 60.0 -20.0 10.0 305 | 303 60.0 -40.0 10.0 306 | 304 60.0 -60.0 10.0 307 | 305 60.0 -80.0 10.0 308 | 306 60.0 -100.0 10.0 309 | 307 60.0 -120.0 10.0 310 | 308 60.0 -140.0 10.0 311 | 309 60.0 -160.0 10.0 312 | 310 60.0 -180.0 10.0 313 | 311 60.0 -200.0 10.0 314 | 312 60.0 -220.0 10.0 315 | 313 60.0 -240.0 10.0 316 | 314 60.0 -260.0 10.0 317 | 315 60.0 -280.0 10.0 318 | 316 60.0 -300.0 10.0 319 | 317 60.0 -320.0 10.0 320 | 318 60.0 -340.0 10.0 321 | 319 60.0 -360.0 10.0 322 | 320 60.0 -380.0 10.0 323 | 321 60.0 -400.0 10.0 324 | 322 60.0 -420.0 10.0 325 | 323 60.0 -440.0 10.0 326 | 324 60.0 -460.0 10.0 327 | 325 60.0 -480.0 10.0 328 | 326 60.0 -500.0 10.0 329 | 327 60.0 -520.0 10.0 330 | 328 60.0 -540.0 10.0 331 | 329 60.0 -560.0 10.0 332 | 330 60.0 -580.0 10.0 333 | 331 60.0 -600.0 10.0 334 | 332 60.0 -620.0 10.0 335 | 333 60.0 -640.0 10.0 336 | 334 60.0 -660.0 10.0 337 | 335 60.0 -680.0 10.0 338 | 336 60.0 -700.0 10.0 339 | 337 60.0 -720.0 10.0 340 | 338 60.0 -740.0 10.0 341 | 339 60.0 -760.0 10.0 342 | 340 60.0 -780.0 10.0 343 | 341 60.0 -800.0 10.0 344 | 342 60.0 -820.0 10.0 345 | 343 60.0 -840.0 10.0 346 | 344 80.0 0.0 10.0 347 | 345 80.0 -20.0 10.0 348 | 346 80.0 -40.0 10.0 349 | 347 80.0 -60.0 10.0 350 | 348 80.0 -80.0 10.0 351 | 349 80.0 -100.0 10.0 352 | 350 80.0 -120.0 10.0 353 | 351 80.0 -140.0 10.0 354 | 352 80.0 -160.0 10.0 355 | 353 80.0 -180.0 10.0 356 | 354 80.0 -200.0 10.0 357 | 355 80.0 -220.0 10.0 358 | 356 80.0 -240.0 10.0 359 | 357 80.0 -260.0 10.0 360 | 358 80.0 -280.0 10.0 361 | 359 80.0 -300.0 10.0 362 | 360 80.0 -320.0 10.0 363 | 361 80.0 -340.0 10.0 364 | 362 80.0 -360.0 10.0 365 | 363 80.0 -380.0 10.0 366 | 364 80.0 -400.0 10.0 367 | 365 80.0 -420.0 10.0 368 | 366 80.0 -440.0 10.0 369 | 367 80.0 -460.0 10.0 370 | 368 80.0 -480.0 10.0 371 | 369 80.0 -500.0 10.0 372 | 370 80.0 -520.0 10.0 373 | 371 80.0 -540.0 10.0 374 | 372 80.0 -560.0 10.0 375 | 373 80.0 -580.0 10.0 376 | 374 80.0 -600.0 10.0 377 | 375 80.0 -620.0 10.0 378 | 376 80.0 -640.0 10.0 379 | 377 80.0 -660.0 10.0 380 | 378 80.0 -680.0 10.0 381 | 379 80.0 -700.0 10.0 382 | 380 80.0 -720.0 10.0 383 | 381 80.0 -740.0 10.0 384 | 382 80.0 -760.0 10.0 385 | 383 80.0 -780.0 10.0 386 | 384 80.0 -800.0 10.0 387 | 385 80.0 -820.0 10.0 388 | 386 80.0 -840.0 10.0 389 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/recXelectrodes/mesh_electrode_half.csv: -------------------------------------------------------------------------------- 1 | channel x_pos y_pos z_pos 2 | 0 -80.0 0.0 10.0 3 | 1 -80.0 -20.0 10.0 4 | 2 -80.0 -40.0 10.0 5 | 3 -80.0 -60.0 10.0 6 | 4 -80.0 -80.0 10.0 7 | 5 -80.0 -100.0 10.0 8 | 6 -80.0 -120.0 10.0 9 | 7 -80.0 -140.0 10.0 10 | 8 -80.0 -160.0 10.0 11 | 9 -80.0 -180.0 10.0 12 | 10 -80.0 -200.0 10.0 13 | 11 -80.0 -220.0 10.0 14 | 12 -80.0 -240.0 10.0 15 | 13 -80.0 -260.0 10.0 16 | 14 -80.0 -280.0 10.0 17 | 15 -80.0 -300.0 10.0 18 | 16 -80.0 -320.0 10.0 19 | 17 -80.0 -340.0 10.0 20 | 18 -80.0 -360.0 10.0 21 | 19 -80.0 -380.0 10.0 22 | 20 -80.0 -400.0 10.0 23 | 21 -80.0 -420.0 10.0 24 | 22 -80.0 -440.0 10.0 25 | 23 -80.0 -460.0 10.0 26 | 24 -80.0 -480.0 10.0 27 | 25 -80.0 -500.0 10.0 28 | 26 -80.0 -520.0 10.0 29 | 27 -80.0 -540.0 10.0 30 | 28 -80.0 -560.0 10.0 31 | 29 -80.0 -580.0 10.0 32 | 30 -80.0 -600.0 10.0 33 | 31 -80.0 -620.0 10.0 34 | 32 -80.0 -640.0 10.0 35 | 33 -80.0 -660.0 10.0 36 | 34 -80.0 -680.0 10.0 37 | 35 -80.0 -700.0 10.0 38 | 36 -80.0 -720.0 10.0 39 | 37 -80.0 -740.0 10.0 40 | 38 -80.0 -760.0 10.0 41 | 39 -80.0 -780.0 10.0 42 | 40 -80.0 -800.0 10.0 43 | 41 -80.0 -820.0 10.0 44 | 42 -80.0 -840.0 10.0 45 | 43 -60.0 0.0 10.0 46 | 44 -60.0 -20.0 10.0 47 | 45 -60.0 -40.0 10.0 48 | 46 -60.0 -60.0 10.0 49 | 47 -60.0 -80.0 10.0 50 | 48 -60.0 -100.0 10.0 51 | 49 -60.0 -120.0 10.0 52 | 50 -60.0 -140.0 10.0 53 | 51 -60.0 -160.0 10.0 54 | 52 -60.0 -180.0 10.0 55 | 53 -60.0 -200.0 10.0 56 | 54 -60.0 -220.0 10.0 57 | 55 -60.0 -240.0 10.0 58 | 56 -60.0 -260.0 10.0 59 | 57 -60.0 -280.0 10.0 60 | 58 -60.0 -300.0 10.0 61 | 59 -60.0 -320.0 10.0 62 | 60 -60.0 -340.0 10.0 63 | 61 -60.0 -360.0 10.0 64 | 62 -60.0 -380.0 10.0 65 | 63 -60.0 -400.0 10.0 66 | 64 -60.0 -420.0 10.0 67 | 65 -60.0 -440.0 10.0 68 | 66 -60.0 -460.0 10.0 69 | 67 -60.0 -480.0 10.0 70 | 68 -60.0 -500.0 10.0 71 | 69 -60.0 -520.0 10.0 72 | 70 -60.0 -540.0 10.0 73 | 71 -60.0 -560.0 10.0 74 | 72 -60.0 -580.0 10.0 75 | 73 -60.0 -600.0 10.0 76 | 74 -60.0 -620.0 10.0 77 | 75 -60.0 -640.0 10.0 78 | 76 -60.0 -660.0 10.0 79 | 77 -60.0 -680.0 10.0 80 | 78 -60.0 -700.0 10.0 81 | 79 -60.0 -720.0 10.0 82 | 80 -60.0 -740.0 10.0 83 | 81 -60.0 -760.0 10.0 84 | 82 -60.0 -780.0 10.0 85 | 83 -60.0 -800.0 10.0 86 | 84 -60.0 -820.0 10.0 87 | 85 -60.0 -840.0 10.0 88 | 86 -40.0 0.0 10.0 89 | 87 -40.0 -20.0 10.0 90 | 88 -40.0 -40.0 10.0 91 | 89 -40.0 -60.0 10.0 92 | 90 -40.0 -80.0 10.0 93 | 91 -40.0 -100.0 10.0 94 | 92 -40.0 -120.0 10.0 95 | 93 -40.0 -140.0 10.0 96 | 94 -40.0 -160.0 10.0 97 | 95 -40.0 -180.0 10.0 98 | 96 -40.0 -200.0 10.0 99 | 97 -40.0 -220.0 10.0 100 | 98 -40.0 -240.0 10.0 101 | 99 -40.0 -260.0 10.0 102 | 100 -40.0 -280.0 10.0 103 | 101 -40.0 -300.0 10.0 104 | 102 -40.0 -320.0 10.0 105 | 103 -40.0 -340.0 10.0 106 | 104 -40.0 -360.0 10.0 107 | 105 -40.0 -380.0 10.0 108 | 106 -40.0 -400.0 10.0 109 | 107 -40.0 -420.0 10.0 110 | 108 -40.0 -440.0 10.0 111 | 109 -40.0 -460.0 10.0 112 | 110 -40.0 -480.0 10.0 113 | 111 -40.0 -500.0 10.0 114 | 112 -40.0 -520.0 10.0 115 | 113 -40.0 -540.0 10.0 116 | 114 -40.0 -560.0 10.0 117 | 115 -40.0 -580.0 10.0 118 | 116 -40.0 -600.0 10.0 119 | 117 -40.0 -620.0 10.0 120 | 118 -40.0 -640.0 10.0 121 | 119 -40.0 -660.0 10.0 122 | 120 -40.0 -680.0 10.0 123 | 121 -40.0 -700.0 10.0 124 | 122 -40.0 -720.0 10.0 125 | 123 -40.0 -740.0 10.0 126 | 124 -40.0 -760.0 10.0 127 | 125 -40.0 -780.0 10.0 128 | 126 -40.0 -800.0 10.0 129 | 127 -40.0 -820.0 10.0 130 | 128 -40.0 -840.0 10.0 131 | 129 -20.0 0.0 10.0 132 | 130 -20.0 -20.0 10.0 133 | 131 -20.0 -40.0 10.0 134 | 132 -20.0 -60.0 10.0 135 | 133 -20.0 -80.0 10.0 136 | 134 -20.0 -100.0 10.0 137 | 135 -20.0 -120.0 10.0 138 | 136 -20.0 -140.0 10.0 139 | 137 -20.0 -160.0 10.0 140 | 138 -20.0 -180.0 10.0 141 | 139 -20.0 -200.0 10.0 142 | 140 -20.0 -220.0 10.0 143 | 141 -20.0 -240.0 10.0 144 | 142 -20.0 -260.0 10.0 145 | 143 -20.0 -280.0 10.0 146 | 144 -20.0 -300.0 10.0 147 | 145 -20.0 -320.0 10.0 148 | 146 -20.0 -340.0 10.0 149 | 147 -20.0 -360.0 10.0 150 | 148 -20.0 -380.0 10.0 151 | 149 -20.0 -400.0 10.0 152 | 150 -20.0 -420.0 10.0 153 | 151 -20.0 -440.0 10.0 154 | 152 -20.0 -460.0 10.0 155 | 153 -20.0 -480.0 10.0 156 | 154 -20.0 -500.0 10.0 157 | 155 -20.0 -520.0 10.0 158 | 156 -20.0 -540.0 10.0 159 | 157 -20.0 -560.0 10.0 160 | 158 -20.0 -580.0 10.0 161 | 159 -20.0 -600.0 10.0 162 | 160 -20.0 -620.0 10.0 163 | 161 -20.0 -640.0 10.0 164 | 162 -20.0 -660.0 10.0 165 | 163 -20.0 -680.0 10.0 166 | 164 -20.0 -700.0 10.0 167 | 165 -20.0 -720.0 10.0 168 | 166 -20.0 -740.0 10.0 169 | 167 -20.0 -760.0 10.0 170 | 168 -20.0 -780.0 10.0 171 | 169 -20.0 -800.0 10.0 172 | 170 -20.0 -820.0 10.0 173 | 171 -20.0 -840.0 10.0 174 | 172 0.0 0.0 10.0 175 | 173 0.0 -20.0 10.0 176 | 174 0.0 -40.0 10.0 177 | 175 0.0 -60.0 10.0 178 | 176 0.0 -80.0 10.0 179 | 177 0.0 -100.0 10.0 180 | 178 0.0 -120.0 10.0 181 | 179 0.0 -140.0 10.0 182 | 180 0.0 -160.0 10.0 183 | 181 0.0 -180.0 10.0 184 | 182 0.0 -200.0 10.0 185 | 183 0.0 -220.0 10.0 186 | 184 0.0 -240.0 10.0 187 | 185 0.0 -260.0 10.0 188 | 186 0.0 -280.0 10.0 189 | 187 0.0 -300.0 10.0 190 | 188 0.0 -320.0 10.0 191 | 189 0.0 -340.0 10.0 192 | 190 0.0 -360.0 10.0 193 | 191 0.0 -380.0 10.0 194 | 192 0.0 -400.0 10.0 195 | 193 0.0 -420.0 10.0 196 | 194 0.0 -440.0 10.0 197 | 195 0.0 -460.0 10.0 198 | 196 0.0 -480.0 10.0 199 | 197 0.0 -500.0 10.0 200 | 198 0.0 -520.0 10.0 201 | 199 0.0 -540.0 10.0 202 | 200 0.0 -560.0 10.0 203 | 201 0.0 -580.0 10.0 204 | 202 0.0 -600.0 10.0 205 | 203 0.0 -620.0 10.0 206 | 204 0.0 -640.0 10.0 207 | 205 0.0 -660.0 10.0 208 | 206 0.0 -680.0 10.0 209 | 207 0.0 -700.0 10.0 210 | 208 0.0 -720.0 10.0 211 | 209 0.0 -740.0 10.0 212 | 210 0.0 -760.0 10.0 213 | 211 0.0 -780.0 10.0 214 | 212 0.0 -800.0 10.0 215 | 213 0.0 -820.0 10.0 216 | 214 0.0 -840.0 10.0 217 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/synaptic_models/AMPA_ExcToExc.json: -------------------------------------------------------------------------------- 1 | { 2 | "level_of_detail": "exp2syn", 3 | "tau1": 1.0, 4 | "tau2": 3.0, 5 | "erev": 0.0 6 | } 7 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/synaptic_models/AMPA_ExcToInh.json: -------------------------------------------------------------------------------- 1 | { 2 | "level_of_detail": "exp2syn", 3 | "tau1": 0.1, 4 | "tau2": 0.5, 5 | "erev": 0.0 6 | } 7 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/synaptic_models/GABA_InhToExc.json: -------------------------------------------------------------------------------- 1 | { 2 | "level_of_detail": "exp2syn", 3 | "tau1": 2.7, 4 | "tau2": 15.0, 5 | "erev": -70.0 6 | } 7 | 8 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/synaptic_models/GABA_InhToInh.json: -------------------------------------------------------------------------------- 1 | { 2 | "level_of_detail": "exp2syn", 3 | "tau1": 0.2, 4 | "tau2": 8.0, 5 | "erev": -70.0 6 | } 7 | 8 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/synaptic_models/instanteneousExc.json: -------------------------------------------------------------------------------- 1 | { 2 | "level_of_detail": "instanteneous", 3 | "sign": 1 4 | } 5 | 6 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/components/synaptic_models/instanteneousInh.json: -------------------------------------------------------------------------------- 1 | { 2 | "level_of_detail": "instanteneous", 3 | "sign": -1 4 | } 5 | 6 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "run": { 3 | "tstop": 3000.0, 4 | "dt": 0.1, 5 | "dL": 20, 6 | "overwrite_output_dir": true, 7 | "spike_threshold": -15, 8 | "save_state":false, 9 | "start_from_state": false, 10 | "nsteps_block":5000, 11 | "save_cell_vars": ["v", "cai"], 12 | "calc_ecp": false, 13 | "connect_internal": true, 14 | "connect_external": {"filter": true} 15 | }, 16 | 17 | "external": { 18 | 19 | "filter": { 20 | "spike_trains": "$NETWORK_DIR/source_input/poisson_input_spk_train.nwb", 21 | "edges": "$NETWORK_DIR/source_input/input_edges.h5", 22 | "edge_types": "$NETWORK_DIR/source_input/input_edge_types.csv", 23 | "node_types": "$NETWORK_DIR/source_input/input_node_types.csv", 24 | "nodes": "$NETWORK_DIR/source_input/input_nodes.csv", 25 | "func_labels": [], 26 | "trial": "trial_1" 27 | } 28 | 29 | }, 30 | 31 | "internal": { 32 | "nodes": "$NETWORK_DIR/recurrent_network/nodes.csv", 33 | "node_types": "$NETWORK_DIR/recurrent_network/node_types.csv", 34 | "edge_types": "$NETWORK_DIR/recurrent_network/edge_types.csv", 35 | "edges": "$NETWORK_DIR/recurrent_network/edges.h5", 36 | "func_labels": ["pop_name"], 37 | "bio_morph_dir": "$MODELS_DIR/biophysical/morphology", 38 | "bio_ephys_dir": "$MODELS_DIR/biophysical/electrophysiology", 39 | "lif_ephys_dir": "$MODELS_DIR/intfire" 40 | 41 | }, 42 | 43 | "output": { 44 | "log": "$OUTPUT_DIR/log.txt", 45 | "spikes_ascii": "$OUTPUT_DIR/spikes.txt", 46 | "spikes_h5": "$OUTPUT_DIR/spikes.h5", 47 | "cell_vars_dir": "$OUTPUT_DIR/cellvars", 48 | "extra_cell_vars": "$OUTPUT_DIR/extra_cell_vars.h5", 49 | "ecp_file": "$OUTPUT_DIR/ecp.h5", 50 | "state_dir": "$OUTPUT_DIR/state", 51 | "output_dir": "$OUTPUT_DIR" 52 | }, 53 | 54 | "extracellular_electrode": { 55 | "positions": "$MODELS_DIR/recXelectrodes/linear_electrode.csv" 56 | }, 57 | 58 | "components": { 59 | "synapses_dir": "$MODELS_DIR/synaptic_models", 60 | "mechanisms_dir": "$MODELS_DIR/mechanisms", 61 | "bio_morphology_dir": "$MODELS_DIR/biophysical/morphology", 62 | "bio_params_dir": "$MODELS_DIR/biophysical/electrophysiology", 63 | "hoc_template_dir": "$MODELS_DIR/hoc_templates", 64 | "lif_params_dir": "$MODELS_DIR/intfire" 65 | }, 66 | 67 | 68 | "recXelectrode": { 69 | "positions": "$MODELS_DIR/recXelectrodes/linear_electrode.csv" 70 | }, 71 | 72 | "manifest": { 73 | 74 | "$BASE_DIR": "${configdir}", 75 | "$NETWORK_DIR": "$BASE_DIR/network", 76 | "$MODELS_DIR": "$BASE_DIR/components", 77 | "$OUTPUT_DIR": "$BASE_DIR/sim_results_001" 78 | }, 79 | 80 | 81 | "conditions": { 82 | "celsius": 34.0, 83 | "v_init": -80 84 | }, 85 | 86 | "groups": { 87 | "save_vars": [0, 1, 2, 3, 4, 5, 6, 7, 8] 88 | } 89 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/schematics_png/External_input_connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/schematics_png/External_input_connected.png -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/schematics_png/External_input_created.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/schematics_png/External_input_created.png -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/schematics_png/Full_figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/schematics_png/Full_figure.png -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/schematics_png/Neurons_created.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/schematics_png/Neurons_created.png -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/schematics_png/Neurons_created_figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/schematics_png/Neurons_created_figure.png -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/schematics_png/Recurrent_connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/schematics_png/Recurrent_connected.png -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/schematics_png/Recurrent_connected_figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/schematics_png/Recurrent_connected_figure.png -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/schematics_png/full_network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/biophysical_notebook/schematics_png/full_network.png -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/set_cell_params.py: -------------------------------------------------------------------------------- 1 | import json 2 | from neuron import h 3 | 4 | 5 | def IntFire1(cell_prop): 6 | """Set parameters for the IntFire1 cell models.""" 7 | params_file = cell_prop['params_file'] 8 | 9 | with open(params_file) as params_file: 10 | params = json.load(params_file) 11 | 12 | hobj = h.IntFire1() 13 | hobj.tau = params['tau'] * 1000.0 # Convert from seconds to ms. 14 | hobj.refrac = params['refrac'] * 1000.0 # Convert from seconds to ms. 15 | 16 | return hobj 17 | 18 | 19 | def Biophys1(cell_prop): 20 | """ 21 | Set parameters for cells from the Allen Cell Types database 22 | Prior to setting parameters will replace the axon with the stub 23 | """ 24 | morphology_file_name = str(cell_prop['morphology_file']) 25 | params_file_name = str(cell_prop['params_file']) 26 | 27 | hobj = h.Biophys1(morphology_file_name) 28 | fix_axon(hobj) 29 | set_params_peri(hobj, params_file_name) 30 | 31 | return hobj 32 | 33 | 34 | def set_params_peri(hobj, params_file_name): 35 | """Set biophysical parameters for the cell 36 | 37 | Parameters 38 | ---------- 39 | hobj: instance of a Biophysical template 40 | NEURON's cell object 41 | params_file_name: string 42 | name of json file containing biophysical parameters for cell's model which determine spiking behavior 43 | """ 44 | 45 | with open(params_file_name) as biophys_params_file: 46 | biophys_params = json.load(biophys_params_file) 47 | 48 | passive = biophys_params['passive'][0] 49 | conditions = biophys_params['conditions'][0] 50 | genome = biophys_params['genome'] 51 | 52 | # Set passive properties 53 | cm_dict = dict([(c['section'], c['cm']) for c in passive['cm']]) 54 | for sec in hobj.all: 55 | sec.Ra = passive['ra'] 56 | sec.cm = cm_dict[sec.name().split(".")[1][:4]] 57 | sec.insert('pas') 58 | 59 | for seg in sec: 60 | seg.pas.e = passive["e_pas"] 61 | 62 | # Insert channels and set parameters 63 | 64 | for p in genome: 65 | sections = [s for s in hobj.all if s.name().split(".")[1][:4] == p["section"]] 66 | 67 | for sec in sections: 68 | if p["mechanism"] != "": 69 | sec.insert(p["mechanism"]) 70 | setattr(sec, p["name"], p["value"]) 71 | 72 | # Set reversal potentials 73 | for erev in conditions['erev']: 74 | sections = [s for s in hobj.all if s.name().split(".")[1][:4] == erev["section"]] 75 | for sec in sections: 76 | sec.ena = erev["ena"] 77 | sec.ek = erev["ek"] 78 | 79 | 80 | def fix_axon(hobj): 81 | ''' 82 | Replace reconstructed axon with a stub 83 | 84 | Parameters 85 | ---------- 86 | hobj: instance of a Biophysical template 87 | NEURON's cell object 88 | ''' 89 | 90 | for sec in hobj.axon: 91 | h.delete_section(sec=sec) 92 | 93 | h.execute('create axon[2]', hobj) 94 | 95 | for sec in hobj.axon: 96 | sec.L = 30 97 | sec.diam = 1 98 | hobj.axonal.append(sec=sec) 99 | hobj.all.append(sec=sec) # need to remove this comment 100 | 101 | hobj.axon[0].connect(hobj.soma[0], 0.5, 0) 102 | hobj.axon[1].connect(hobj.axon[0], 1, 0) 103 | 104 | h.define_shape() 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/set_syn_params.py: -------------------------------------------------------------------------------- 1 | from neuron import h 2 | 3 | 4 | def exp2syn(syn_params, xs, secs): 5 | ''' 6 | Create a list of exp2syn synapses 7 | 8 | Parameters 9 | ---------- 10 | syn_params: dict 11 | parameters of a synapse 12 | xs: float 13 | normalized distance along the section 14 | 15 | secs: hoc object 16 | target section 17 | 18 | Returns 19 | ------- 20 | syns: synapse objects 21 | 22 | ''' 23 | syns = [] 24 | 25 | for x, sec in zip(xs, secs): 26 | syn = h.Exp2Syn(x, sec=sec) 27 | syn.e = syn_params['erev'] 28 | syn.tau1 = syn_params['tau1'] 29 | syn.tau2 = syn_params['tau2'] 30 | syns.append(syn) 31 | return syns -------------------------------------------------------------------------------- /DynamicBrain/Modeling/biophysical_notebook/set_weights.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | 4 | def gaussianLL(tar_prop,src_prop,con_prop): 5 | src_tuning = src_prop['tuning_angle'] 6 | tar_tuning = tar_prop['tuning_angle'] 7 | 8 | w0 = con_prop["weight_max"] 9 | sigma = con_prop["weight_sigma"] 10 | 11 | delta_tuning = abs(abs(abs(180.0 - abs(float(tar_tuning) - float(src_tuning)) % 360.0) - 90.0) - 90.0) 12 | weight = w0*math.exp(-(delta_tuning / sigma) ** 2) 13 | 14 | return weight 15 | 16 | 17 | 18 | def wmax(tar_prop,src_prop,con_prop): 19 | 20 | w0 = con_prop["weight_max"] 21 | return w0 22 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "run": { 3 | "duration": 3000.0, 4 | "dt": 0.1, 5 | "overwrite_output_dir": true, 6 | "save_state":false, 7 | "start_from_state": false, 8 | "block": false, 9 | "connect_internal": true, 10 | "connect_external": {"filter": true} 11 | }, 12 | 13 | "external": { 14 | 15 | "filter": { 16 | "spike_trains": "$NETWORK_DIR/source_input/poisson_input_spk_train.nwb", 17 | "connections": "$NETWORK_DIR/source_input/input_edges.h5", 18 | "edge_types": "$NETWORK_DIR/source_input/input_edge_types.csv", 19 | "cell_models": "$NETWORK_DIR/source_input/input_node_types.csv", 20 | "cells": "$NETWORK_DIR/source_input/input_nodes.csv", 21 | "func_labels": ["location"], 22 | "trial": "trial_1" 23 | } 24 | 25 | }, 26 | 27 | "internal": { 28 | "cells": "$NETWORK_DIR/recurrent_network/nodes.csv", 29 | "cell_models": "$NETWORK_DIR/recurrent_network/node_types.csv", 30 | "edge_types": "$NETWORK_DIR/recurrent_network/edge_types.csv", 31 | "connections": "$NETWORK_DIR/recurrent_network/edges.h5", 32 | "func_labels": ["pop_name"], 33 | "bio_morph_dir": "$MODELS_DIR/biophysical/morphology", 34 | "bio_ephys_dir": "$MODELS_DIR/biophysical/electrophysiology", 35 | "lif_ephys_dir": "$MODELS_DIR/intfire" 36 | 37 | }, 38 | 39 | "output": { 40 | "log": "$OUTPUT_DIR/log.txt", 41 | "spikes_ascii": "$OUTPUT_DIR/spikes.txt", 42 | "spikes_h5": "$OUTPUT_DIR/spikes.h5", 43 | "cell_vars_dir": "$OUTPUT_DIR/cellvars", 44 | "extra_cell_vars": "$OUTPUT_DIR/extra_cell_vars.h5", 45 | "ecp_file": "$OUTPUT_DIR/ecp.h5", 46 | "state_dir": "$OUTPUT_DIR/state", 47 | "output_dir": "$OUTPUT_DIR" 48 | }, 49 | 50 | "components": { 51 | "models_dir": "$MODELS_DIR/cell_models", 52 | "synapses_dir": "$MODELS_DIR/synaptic_models" 53 | }, 54 | 55 | 56 | "recXelectrode": { 57 | "positions": "$MODELS_DIR/recXelectrodes/linear_electrode.csv" 58 | }, 59 | 60 | "manifest": { 61 | 62 | "$BASE_DIR": "${configdir}", 63 | "$NETWORK_DIR": "$BASE_DIR/network", 64 | "$MODELS_DIR": "$BASE_DIR/models", 65 | "$OUTPUT_DIR": "$BASE_DIR/point_output_001" 66 | }, 67 | 68 | 69 | "conditions": { 70 | "celsius": 34.0, 71 | "v_init": -80 72 | }, 73 | 74 | "groups": { 75 | "save_vars": [0, 1, 2, 3, 4, 5, 6, 7] 76 | } 77 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/472363762_fit.json: -------------------------------------------------------------------------------- 1 | { 2 | "I_e": 0.0, 3 | "tau_m": 44.9, 4 | "C_m": 239.0, 5 | "t_ref": 3.0, 6 | "E_L": -78.0, 7 | "V_th": -43.0, 8 | "V_reset": -55.0 9 | } 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/472363762_point.json: -------------------------------------------------------------------------------- 1 | { 2 | "I_e": 0.0, 3 | "tau_m": 44.9, 4 | "C_m": 239.0, 5 | "t_ref": 3.0, 6 | "E_L": -78.0, 7 | "V_th": -43.0, 8 | "V_reset": -55.0 9 | } 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/472912177_fit.json: -------------------------------------------------------------------------------- 1 | { 2 | "I_e": 0.0, 3 | "tau_m": 22.2, 4 | "C_m": 180.0, 5 | "t_ref": 3.0, 6 | "E_L": -82.0, 7 | "V_th": -35.0, 8 | "V_reset": -50.0 9 | } 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/472912177_point.json: -------------------------------------------------------------------------------- 1 | { 2 | "I_e": 0.0, 3 | "tau_m": 22.2, 4 | "C_m": 180.0, 5 | "t_ref": 3.0, 6 | "E_L": -82.0, 7 | "V_th": -35.0, 8 | "V_reset": -50.0 9 | } 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/473862421_point.json: -------------------------------------------------------------------------------- 1 | { 2 | "I_e": 0.0, 3 | "tau_m": 12.5, 4 | "C_m": 78.0, 5 | "t_ref": 3.0, 6 | "E_L": -73.0, 7 | "V_th": -37.0, 8 | "V_reset": -55.0 9 | } 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/473863035_point.json: -------------------------------------------------------------------------------- 1 | { 2 | "I_e": 0.0, 3 | "tau_m": 22.1, 4 | "C_m": 117.0, 5 | "t_ref": 3.0, 6 | "E_L": -78.0, 7 | "V_th": -47.0, 8 | "V_reset": -50.0 9 | } 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/473863510_point.json: -------------------------------------------------------------------------------- 1 | { 2 | "I_e": 0.0, 3 | "tau_m": 11.5, 4 | "C_m": 53.0, 5 | "t_ref": 3.0, 6 | "E_L": -72.0, 7 | "V_th": -25.0, 8 | "V_reset": -50.0 9 | } 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/IntFire1_exc_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "I_e": 0.0, 3 | "tau_m": 24.0, 4 | "C_m": 120.0, 5 | "t_ref": 3.0, 6 | "E_L": -75.0, 7 | "V_th": -37.0, 8 | "V_reset": -53.0 9 | } 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/IntFire1_exc_fit.json: -------------------------------------------------------------------------------- 1 | { 2 | "I_e": 0.0, 3 | "tau_m": 24.0, 4 | "C_m": 120.0, 5 | "t_ref": 3.0, 6 | "E_L": -75.0, 7 | "V_th": -37.0, 8 | "V_reset": -53.0 9 | } 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/IntFire1_exc_point.json: -------------------------------------------------------------------------------- 1 | { 2 | "I_e": 0.0, 3 | "tau_m": 24.0, 4 | "C_m": 120.0, 5 | "t_ref": 3.0, 6 | "E_L": -75.0, 7 | "V_th": -37.0, 8 | "V_reset": -53.0 9 | } 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/IntFire1_inh_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "I_e": 0.0, 3 | "tau_m": 7.0, 4 | "C_m": 50.0, 5 | "t_ref": 3.0, 6 | "E_L": -77.0, 7 | "V_th": -36.0, 8 | "V_reset": -52.0 9 | } 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/IntFire1_inh_fit.json: -------------------------------------------------------------------------------- 1 | { 2 | "I_e": 0.0, 3 | "tau_m": 7.0, 4 | "C_m": 50.0, 5 | "t_ref": 3.0, 6 | "E_L": -77.0, 7 | "V_th": -36.0, 8 | "V_reset": -52.0 9 | } 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/IntFire1_inh_point.json: -------------------------------------------------------------------------------- 1 | { 2 | "I_e": 0.0, 3 | "tau_m": 7.0, 4 | "C_m": 50.0, 5 | "t_ref": 3.0, 6 | "E_L": -77.0, 7 | "V_th": -36.0, 8 | "V_reset": -52.0 9 | } 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/cell_models/filter_point.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/synaptic_models/AMPA_ExcToExc.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/synaptic_models/AMPA_ExcToInh.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/synaptic_models/ExcToExc.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/synaptic_models/ExcToInh.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/synaptic_models/GABA_InhToExc.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | 4 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/synaptic_models/GABA_InhToInh.json: -------------------------------------------------------------------------------- 1 | { 2 | "level_of_detail": "exp2syn", 3 | "tau1": 0.2, 4 | "tau2": 8.0, 5 | "erev": -70.0 6 | } 7 | 8 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/synaptic_models/InhToExc.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | 4 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/synaptic_models/InhToInh.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | 4 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/synaptic_models/instanteneousExc.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | 4 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/models/synaptic_models/instanteneousInh.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | 4 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/network/recurrent_network/edge_types.csv: -------------------------------------------------------------------------------- 1 | edge_type_id target_query source_query weight_max distance_range target_sections delay params_file set_params_function synapse_model weight_function 2 | 0 level_of_detail=='biophysical'&ei=='i' ei=='i' -10.0 "[0.0, 1e+20]" "['somatic', 'basal']" 2.0 GABA_InhToInh.json exp2syn static_synapse wmax 3 | 1 level_of_detail=='intfire'&ei=='i' ei=='i' -50.0 2.0 instanteneousInh.json static_synapse wmax 4 | 2 level_of_detail=='biophysical'&ei=='e' ei=='i' -50.0 "[0.0, 50.0]" "['somatic', 'basal', 'apical']" 2.0 GABA_InhToExc.json exp2syn static_synapse wmax 5 | 3 level_of_detail=='intfire'&ei=='e' ei=='i' -10.0 2.0 instanteneousInh.json static_synapse wmax 6 | 4 pop_name=='PV1' ei=='e' 100.0 "[0.0, 1e+20]" "['somatic', 'basal']" 2.0 AMPA_ExcToInh.json exp2syn static_synapse wmax 7 | 5 pop_name=='LIF_inh' ei=='e' 100.0 2.0 instanteneousExc.json static_synapse wmax 8 | 6 pop_name=='Scnn1a' ei=='e' 100.0 "[30.0, 150.0]" "['basal', 'apical']" 2.0 AMPA_ExcToExc.json exp2syn static_synapse wmax 9 | 7 pop_name=='LIF_exc' ei=='e' 100.0 2.0 instanteneousExc.json static_synapse wmax 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/network/recurrent_network/edges.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/pointnet_notebook/network/recurrent_network/edges.h5 -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/network/recurrent_network/node_types.csv: -------------------------------------------------------------------------------- 1 | node_type_id model_type params_file level_of_detail morphology_file rotation_angle_zaxis set_params_function 2 | 10002 iaf_psc_alpha 472912177_fit.json biophysical Pvalb-IRES-Cre_Ai14_IVSCC_-176847.04.02.01_470522102_m.swc -2.539551891 Biophys1 3 | 10001 iaf_psc_alpha 472363762_fit.json biophysical Scnn1a-Tg3-Cre_Ai14_IVSCC_-177300.01.02.01_473845048_m.swc -3.646878266 Biophys1 4 | 90002 iaf_psc_alpha IntFire1_inh_1.json intfire NA NA IntFire1 5 | 90001 iaf_psc_alpha IntFire1_exc_1.json intfire NA NA IntFire1 6 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/network/recurrent_network/nodes.csv: -------------------------------------------------------------------------------- 1 | node_id node_type_id x_soma y_soma z_soma rotation_angle_yaxis pop_name ei 2 | 0 10002 0.59970086791473476 0.7669456700222288 0.63342296667967057 2.8855805437712054 PV1 i 3 | 1 10002 0.64573574296980885 0.41286627582336111 0.89823631588142072 2.1657588793230116 PV1 i 4 | 2 10001 0.1675878347205868 0.30591729535179824 0.31342078710130283 5.1876700684739037 Scnn1a e 5 | 3 10001 0.71617645939637709 0.68016880563220883 0.70761584532823629 1.6431578525680703 Scnn1a e 6 | 4 90002 0.13093610138425726 0.48812555606917907 0.93341052317501738 2.258221401812377 LIF_inh i 7 | 5 90002 0.81237871087206437 0.64678320267548151 0.91214503640257605 1.5857854835635639 LIF_inh i 8 | 6 90001 0.9188885897309842 0.87509533743231505 0.74657421524993361 1.0660517798843969 LIF_exc e 9 | 7 90001 0.087999125302931192 0.6027056373291817 0.92473051991482436 6.2787411022712538 LIF_exc e 10 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/network/source_input/input_edge_types.csv: -------------------------------------------------------------------------------- 1 | edge_type_id target_query source_query weight_max distance_range target_sections delay params_file set_params_function synapse_model weight_function 2 | 7 pop_name=='Scnn1a' * 25.0 "[0.0, 150.0]" "['basal', 'apical']" 2.0 AMPA_ExcToExc.json exp2syn static_synapse wmax 3 | 8 pop_name=='LIF_exc' * 50.0 2.0 instanteneousExc.json static_synapse wmax 4 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/network/source_input/input_edges.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/pointnet_notebook/network/source_input/input_edges.h5 -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/network/source_input/input_node_types.csv: -------------------------------------------------------------------------------- 1 | node_type_id model_type params_file level_of_detail 2 | 1001 spike_generator filter_point.json filter 3 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/network/source_input/input_nodes.csv: -------------------------------------------------------------------------------- 1 | node_id node_type_id ei pop_name 2 | 0 1001 e input_filter 3 | 1 1001 e input_filter 4 | 2 1001 e input_filter 5 | 3 1001 e input_filter 6 | 4 1001 e input_filter 7 | 5 1001 e input_filter 8 | 6 1001 e input_filter 9 | 7 1001 e input_filter 10 | 8 1001 e input_filter 11 | 9 1001 e input_filter 12 | 10 1001 e input_filter 13 | 11 1001 e input_filter 14 | 12 1001 e input_filter 15 | 13 1001 e input_filter 16 | 14 1001 e input_filter 17 | 15 1001 e input_filter 18 | 16 1001 e input_filter 19 | 17 1001 e input_filter 20 | 18 1001 e input_filter 21 | 19 1001 e input_filter 22 | 20 1001 e input_filter 23 | 21 1001 e input_filter 24 | 22 1001 e input_filter 25 | 23 1001 e input_filter 26 | 24 1001 e input_filter 27 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/network/source_input/poisson_input_spk_train.nwb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/pointnet_notebook/network/source_input/poisson_input_spk_train.nwb -------------------------------------------------------------------------------- /DynamicBrain/Modeling/pointnet_notebook/set_weights.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | 4 | def gaussianLL(tar_prop,src_prop,con_prop): 5 | src_tuning = src_prop['tuning_angle'] 6 | tar_tuning = tar_prop['tuning_angle'] 7 | 8 | w0 = con_prop["weight_max"] 9 | sigma = con_prop["weight_sigma"] 10 | 11 | delta_tuning = abs(abs(abs(180.0 - abs(float(tar_tuning) - float(src_tuning)) % 360.0) - 90.0) - 90.0) 12 | weight = w0*math.exp(-(delta_tuning / sigma) ** 2) 13 | 14 | return weight 15 | 16 | 17 | 18 | def wmax(tar_prop, src_prop, con_prop, nsyn): 19 | return con_prop["weight_max"]*nsyn 20 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/components/pop_models/excitatory_pop.json: -------------------------------------------------------------------------------- 1 | { 2 | "tau_m": 0.0429, 3 | "record": true, 4 | "v_min": -0.05, 5 | "v_max": 0.02, 6 | "dv": 0.0001, 7 | "update_method": "gmres", 8 | "approx_order": null 9 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/components/pop_models/filter_pop.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/components/pop_models/inhibitory_pop.json: -------------------------------------------------------------------------------- 1 | { 2 | "tau_m": 0.0299, 3 | "record": true, 4 | "v_min": -0.05, 5 | "v_max": 0.02, 6 | "dv": 0.0001, 7 | "update_method": "gmres", 8 | "approx_order": null 9 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/config.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "run": { 4 | "duration": 3.0, 5 | "dt": 0.0002, 6 | "overwrite_output_dir": true, 7 | "connect_internal": true, 8 | "connect_external": {"filter": true}, 9 | "block": false, 10 | "blocksize": 1000.0 11 | }, 12 | 13 | "external": { 14 | "filter": { 15 | "spike_trains": "$NETWORK_DIR/source_input/poisson_input_spk_train.nwb", 16 | "edge_types": "$NETWORK_DIR/source_input/input_edge_types.csv", 17 | "node_types": "$NETWORK_DIR/source_input/input_node_types.csv", 18 | "trial": "trial_1" 19 | } 20 | }, 21 | 22 | "internal": { 23 | "node_types": "$NETWORK_DIR/recurrent_network/node_types.csv", 24 | "edge_types": "$NETWORK_DIR/recurrent_network/edge_types.csv", 25 | "edges": "$NETWORK_DIR/recurrent_network/edges.h5" 26 | }, 27 | 28 | "output": { 29 | "show_plots": false, 30 | "rates_file": "$OUTPUT_DIR/spike_rates.txt", 31 | "log_file": "$OUTPUT_DIR/logging.txt" 32 | }, 33 | 34 | "components": { 35 | "models_dir": "$MODELS_DIR/pop_models", 36 | "synapses_dir": "$MODELS_DIR/synaptic_models" 37 | }, 38 | 39 | "manifest": { 40 | "$BASE_DIR": "${configdir}", 41 | "$NETWORK_DIR": "$BASE_DIR/network", 42 | "$MODELS_DIR": "$BASE_DIR/components", 43 | "$OUTPUT_DIR": "$BASE_DIR/output" 44 | } 45 | } -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/network/recurrent_network/edge_types.csv: -------------------------------------------------------------------------------- 1 | edge_type_id target_query source_query weight delay nsyns params_file 2 | 1 pop_name=='inhibitory' pop_name=='excitatory' 0.005 0.002 20 ExcToInh.json 3 | 2 pop_name=='excitatory' pop_name=='inhibitory' -0.001 0.002 10 InhToExc.json 4 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/network/recurrent_network/node_types.csv: -------------------------------------------------------------------------------- 1 | node_type_id pop_name params_file 2 | 0 excitatory excitatory_pop.json 3 | 1 inhibitory inhibitory_pop.json 4 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/network/recurrent_network/nodes.csv: -------------------------------------------------------------------------------- 1 | pop_name 2 | inhibitory 3 | excitatory 4 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/network/recurrent_network_v2/edge_types.csv: -------------------------------------------------------------------------------- 1 | edge_type_id target_query source_query weight delay nsyns params_file 2 | 0 pop_name=='excitatory' pop_name=='input_filter' 0.0015 0.002 11 InpToExc.json 3 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/network/recurrent_network_v2/node_types.csv: -------------------------------------------------------------------------------- 1 | node_type_id pop_name params_file 2 | 0 excitatory components_v2/pop_models/excitatory_pop.json 3 | filter_001 input_filter NA 4 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/network/source_input/edge_types.csv: -------------------------------------------------------------------------------- 1 | edge_type_id target_query source_query weight delay nsyns params_file 2 | 0 pop_name=='excitatory' pop_name=='ext_excitatory' 0.0025 0.002 10 InpToExc.json 3 | 2 pop_name=='inhibitory' pop_name=='ext_excitatory' 0.005 0.002 20 ExcToInh.json 4 | 3 pop_name=='inhibitory' pop_name=='ext_excitatory' 0.005 0.002 20 ExcToInh.json 5 | 4 pop_name=='inhibitory' pop_name=='ext_excitatory' 0.005 0.002 20 ExcToInh.json 6 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/network/source_input/input_edge_types.csv: -------------------------------------------------------------------------------- 1 | edge_type_id target_query source_query weight delay nsyns params_file 2 | 0 pop_name=='excitatory' pop_name=='input_filter' 0.0025 0.002 10 InpToExc.json 3 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/network/source_input/input_node_types.csv: -------------------------------------------------------------------------------- 1 | node_type_id level_of_detail ei pop_name 2 | filter_001 filter e input_filter 3 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/network/source_input/input_nodes.csv: -------------------------------------------------------------------------------- 1 | node_id node_type_id ei 2 | 0 filter_001 e 3 | -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/network/source_input/poisson_input_spk_train.nwb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/popnet_notebook/network/source_input/poisson_input_spk_train.nwb -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/schematics_png/DiPDE_ei_net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/popnet_notebook/schematics_png/DiPDE_ei_net.png -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/schematics_png/ei_ext_pop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/popnet_notebook/schematics_png/ei_ext_pop.png -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/schematics_png/ei_ext_pop_conn1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/popnet_notebook/schematics_png/ei_ext_pop_conn1.png -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/schematics_png/ei_ext_pop_conn1and2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/popnet_notebook/schematics_png/ei_ext_pop_conn1and2.png -------------------------------------------------------------------------------- /DynamicBrain/Modeling/popnet_notebook/schematics_png/ei_pop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/DynamicBrain/Modeling/popnet_notebook/schematics_png/ei_pop.png -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Allen Institute Software License – This software license is the 2-clause BSD license 2 | plus clause a third clause that prohibits redistribution for commercial purposes without further permission. 3 | 4 | Copyright © 2017. Allen Institute. All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 7 | following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 10 | following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the 13 | following disclaimer in the documentation and/or other materials provided with the distribution. 14 | 15 | 3. Redistributions for commercial purposes are not permitted without the Allen Institute’s written permission. 16 | For purposes of this license, commercial purposes is the incorporation of the Allen Institute's software into 17 | anything for which you will charge fees or other compensation. Contact terms@alleninstitute.org for commercial 18 | licensing opportunities. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 21 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 26 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /PythonBootcamp/00_Introduction.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | " \n", 8 | "\n", 9 | "

Python Bootcamp

\n", 10 | "

August 19-20, 2016

" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "metadata": {}, 16 | "source": [ 17 | "
\n", 18 | "

Introduction: What is Python?

\n", 19 | "\n", 20 | "

How does Python compare to other programming languages? What are its strengths and weaknesses? Why have we chosen Python for this course?\n", 21 | "\n", 22 | "

" 23 | ] 24 | }, 25 | { 26 | "cell_type": "markdown", 27 | "metadata": {}, 28 | "source": [ 29 | "
\n", 30 | "

1. Python is a *general purpose* programming language.

\n", 31 | "\n", 32 | "

Most programming languages used by scientists were designed from the beginning to handle numerical and scientific tasks:\n", 33 | "\n", 34 | " R, MATLAB, Igor, Mathematica, IDL\n", 35 | "\n", 36 | "

Advantages of specialized languages:\n", 37 | "\n", 38 | "

    \n", 39 | "
  • Usually the first to support high-level functinoality needed in science\n", 40 | "
  • Language and programming environment are tailored to meet the needs of scientific developers\n", 41 | "
  • Lower learning curve\n", 42 | "
\n", 43 | "\n", 44 | "

**General-purpose languages such as Python are intended to be useful for any type of programming, regardless of the topic or functionality needed:**\n", 45 | "\n", 46 | " C, C++, Java, Python\n", 47 | "\n", 48 | "

Python is used in virtually every corner of the software development landscape--web sites, server infrastructure, user interfaces, device control, machine learning, etc. \n", 49 | "\n", 50 | "

Advantages of general-purpose languages:\n", 51 | "\n", 52 | "

    \n", 53 | "
  • More flexibility\n", 54 | "
  • Languages require a lot of effort to learn; general-purpose languages offer greater return on that investment\n", 55 | "
  • Much larger community of developers, greater longevity\n", 56 | "
  • Better language design\n", 57 | "
\n", 58 | "\n", 59 | "
" 60 | ] 61 | }, 62 | { 63 | "cell_type": "markdown", 64 | "metadata": {}, 65 | "source": [ 66 | "
\n", 67 | "

2. Python is an *interpreted* programming language.

\n", 68 | "\n", 69 | "

Programming languages can be compiled, interpreted, or a hybrid of the two. \n", 70 | "\n", 71 | "

**Compiled languages** like C, C++, Java, and Julia take the program you write and convert it into optimized, machine-executable code. Often, compiled languages are both *faster to execute* and *more difficult to use*. \n", 72 | "\n", 73 | "

**Interpreted languages** like Python, MATLAB, Igor, and PHP use a pre-compiled interpreter to read your program code and execute it, one step at a time. Often, interpreted languages are *slower to execute* and *easier to use*.\n", 74 | "\n", 75 | "

**Question:** Is Python a slow language?
\n", 76 | "**Answer:** It depends on how you use it.\n", 77 | "\n", 78 | "

Ideally, we would like to have a language that is both fast to execute and easy to use, and Python (like many other languages) uses many different techniques to reduce the overhead incurred by being an interpreted language. We will learn about many of these throughout the day.\n", 79 | "\n", 80 | "

" 81 | ] 82 | }, 83 | { 84 | "cell_type": "markdown", 85 | "metadata": {}, 86 | "source": [ 87 | "
\n", 88 | "

3. Python is a community of developers

\n", 89 | "\n", 90 | "

Commercial development environments like MATLAB or Igor benefit from a monolithic community structure:\n", 91 | "\n", 92 | "

    \n", 93 | "
  • One official source for core software packages\n", 94 | "
  • One default IDE used by everybody\n", 95 | "
  • One cohesive community of developers and staff for support\n", 96 | "
  • Usually excellent, comprehensive documentation\n", 97 | "
\n", 98 | "\n", 99 | "

Newcomers to Python are often overwhelmed by the vast and confusing landscape of communities, distributions, 3rd-party modules, and development tools. Never fear! The scientific Python community has organized around a central \"stack\" of tools that are well supported and maintained, and have become the de-facto standards in the field. We will guide you through these core tools before releasing you into the wild.\n", 100 | "\n", 101 | "

Scientific Python Stack ([scipy.org](scipy.org)):\n", 102 | "\n", 103 | " NumPy: N-dimensional array package\n", 104 | " SciPy: Fundamental library for scientific computing\n", 105 | " Matplotlib: Comprehensive 2D Plotting\n", 106 | " IPython/Jupyter: Enhanced Interactive Console\n", 107 | " Sympy: Symbolic mathematics\n", 108 | " pandas: Data structures & analysis\n", 109 | "\n", 110 | "

" 111 | ] 112 | }, 113 | { 114 | "cell_type": "markdown", 115 | "metadata": {}, 116 | "source": [ 117 | "
\n", 118 | "

4. A carefully designed, open-source programming language

\n", 119 | "\n", 120 | "

The older, commercial specialty languages come with baggage:\n", 121 | "\n", 122 | "

    \n", 123 | "
  • Evolved from simpler systems, retained idiosyncracies\n", 124 | "
  • Lack modern object-oriented language features, or these are tacked on to the original language\n", 125 | "
  • Expensive, unreliable, cumbersome licensing schemes\n", 126 | "
  • Closed source\n", 127 | "
\n", 128 | "\n", 129 | "

Python is widely regarded as one of the easiest, most intuitive, and most readable programming languages. Its language design combined with its open-source license are major factors in its widespread success.\n", 130 | "\n", 131 | "

" 132 | ] 133 | }, 134 | { 135 | "cell_type": "markdown", 136 | "metadata": {}, 137 | "source": [ 138 | "
\n", 139 | "

Where to get help

\n", 140 | "\n", 141 | "

Python documentation (https://www.python.org/doc/)\n", 142 | "

    \n", 143 | "
  • [Tutorial](https://docs.python.org/2/tutorial/index.html)\n", 144 | "
  • [Library Reference](https://docs.python.org/2/library/index.html)\n", 145 | "
\n", 146 | "\n", 147 | "

MATLAB-to-Python cheat sheets: \n", 148 | "

    \n", 149 | "
  • http://mathesaurus.sourceforge.net/matlab-numpy.html \n", 150 | "
  • http://mathesaurus.sourceforge.net/matlab-python-xref.pdf\n", 151 | "
\n", 152 | "\n", 153 | "\n", 154 | "[Scientific python stack documentation: numpy, scipy, matplotlib](http://scipy.org/docs.html)\n", 155 | "\n", 156 | "[Stack Overflow](http://stackoverflow.com)\n", 157 | " \n", 158 | "
" 159 | ] 160 | } 161 | ], 162 | "metadata": { 163 | "kernelspec": { 164 | "display_name": "Python 2", 165 | "language": "python", 166 | "name": "python2" 167 | }, 168 | "language_info": { 169 | "codemirror_mode": { 170 | "name": "ipython", 171 | "version": 2 172 | }, 173 | "file_extension": ".py", 174 | "mimetype": "text/x-python", 175 | "name": "python", 176 | "nbconvert_exporter": "python", 177 | "pygments_lexer": "ipython2", 178 | "version": "2.7.13" 179 | } 180 | }, 181 | "nbformat": 4, 182 | "nbformat_minor": 0 183 | } 184 | -------------------------------------------------------------------------------- /PythonBootcamp/08_Development_Tools.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | " \n", 8 | "\n", 9 | "

Python Bootcamp

\n", 10 | "

August 19-20, 2017

" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "metadata": {}, 16 | "source": [ 17 | "
\n", 18 | "

Python Development Tools

\n", 19 | "\n", 20 | "\n", 21 | "

Commercial tools like MATLAB and Igor come with a single standardized development environment. In contrast, Python is supported by a large and bewildering ecosystem of development tools. This offers us a great deal of flexibility In this section we will present a few of our favorite tools and discuss their relative strengths and weaknesses.\n", 22 | "

" 23 | ] 24 | }, 25 | { 26 | "cell_type": "markdown", 27 | "metadata": {}, 28 | "source": [ 29 | "
\n", 30 | "

What tools do you need? That depends on what you are trying to do. Some environments are designed to streamline certain types of development. The general features we are looking for are:\n", 31 | "\n", 32 | "

    \n", 33 | "
  • Text editor\n", 34 | "
  • Debugging tools\n", 35 | "
  • Variable explorers\n", 36 | "
  • Data visualization\n", 37 | "
  • Project management\n", 38 | "
\n", 39 | "\n", 40 | "
" 41 | ] 42 | }, 43 | { 44 | "cell_type": "markdown", 45 | "metadata": {}, 46 | "source": [ 47 | "
\n", 48 | "

A note about interactivity

\n", 49 | "\n", 50 | "

**Most general-purpose programming environments are non-interactive:**\n", 51 | "

    \n", 52 | "
  1. Write code\n", 53 | "
  2. Start program, execute code\n", 54 | "
  3. Stop program\n", 55 | "
  4. Repeat\n", 56 | "
\n", 57 | "\n", 58 | "

Important reasons for this:\n", 59 | "

    \n", 60 | "
  • Simplicity - interactivity requires complex infrastructure\n", 61 | "
  • Repeatability - program must run the same way every time\n", 62 | "
\n", 63 | "\n", 64 | "

**Most scientific programming environments (Igor, Matlab, Mathematica, ...) prefer an interactive experience.**
\n", 65 | "Why? Data analysis is incremental.\n", 66 | "\n", 67 | "

    \n", 68 | "
  • You want to see your data, test some code, check the results, tweak the code, check again, etc.\n", 69 | "
  • It would be a pain (and possibly very slow) to have to stop and restart the entire program for every change.\n", 70 | "
\n", 71 | "\n", 72 | "

Interactivity means:\n", 73 | "\n", 74 | "

    \n", 75 | "
  • The program that runs your code does not exit when it finishes running your code.\n", 76 | "
  • All of your data remains in memory for you to inspect\n", 77 | "
  • Code can be modified and executed in the running process.\n", 78 | "
  • Maybe nice GUI tools that let you visualize, save, load data without writing any code.\n", 79 | "
\n", 80 | "\n", 81 | "

**Python supports both types of environment.** The tools we will introduce fall into one category or the other, but all of them incorporate features from both categories.\n", 82 | "

" 83 | ] 84 | }, 85 | { 86 | "cell_type": "markdown", 87 | "metadata": {}, 88 | "source": [ 89 | "
\n", 90 | "

Editor + console

\n", 91 | "\n", 92 | "This is the simplest approach to code development. Use a nice text editor (sublime is a good one) that at least handles indentation. Save your code to a file, and run it from a command line like:\n", 93 | "\n", 94 | " > python myfile.py\n", 95 | " \n", 96 | "This approach falls into the \"non-interactive\" category, but there are many tools available to make it more interactive. For example, simply running python with the `-i` flag will cause it to begin an interactive session immediately after your script completes:\n", 97 | "\n", 98 | " > python -i myfile.py\n", 99 | " \n", 100 | "This allows you to inspect the variables generated by your program and experiment with new ideas.\n", 101 | "\n", 102 | "\n", 103 | "

**Pros:**\n", 104 | "

    \n", 105 | "
  • Simple, bare-metal approach. Nice if you want to use python without other user interfaces getting in your way. For example:\n", 106 | "
      \n", 107 | "
    • IDEs introduce useful features at the cost of added complexity. (How much time will you spend configuring your IDE instead of coding?) \n", 108 | "
    • Some IDEs have debuggers that slow down your code.\n", 109 | "
    • Some IDEs change the way your code runs \"under the hood\".\n", 110 | "
    \n", 111 | "
  • You decide exactly which tools you want to use.\n", 112 | "
\n", 113 | "\n", 114 | "

**Cons:**\n", 115 | "

    \n", 116 | "
  • May be more difficult if you're not familiar with DOS/Bash/other CLI\n", 117 | "
  • Non-integrated; you need to manually incorporate many other tools (eg for visualization, version control, debugging, etc.)\n", 118 | "
\n", 119 | "
" 120 | ] 121 | }, 122 | { 123 | "cell_type": "markdown", 124 | "metadata": {}, 125 | "source": [ 126 | "
\n", 127 | "

Jupyter (IPython) Notebook

\n", 128 | "\n", 129 | "

Jupyter Notebook provides an *interactive* programming environment similar to the Mathematica notebook.\n", 130 | "

    \n", 131 | "
  • Code is divided into chunks called \"cells\".\n", 132 | "
  • Cells can be executed in any order, independently of each other.\n", 133 | "
  • Results from cell execution are displayed below each cell.\n", 134 | "
\n", 135 | "\n", 136 | "A Python interpreter runs *continuously* in the background. Every time you execute a cell, the state of the interpreter is updated.\n", 137 | "\n", 138 | "\n", 139 | "

**Pros:**\n", 140 | "

    \n", 141 | "
  • Notebooks are excellent for storing and presenting the results of data analysis, simulations, etc. because code, results, and discussion are all combined in a single document.\n", 142 | "
  • Any user should be able to execute your notebook and reproduce your results.\n", 143 | " (this is true of all code, but not necessarily as easy)\n", 144 | "
  • Good for prototyping--easy to break up the script into multiple intermediate steps and iteratively develop a small chunk at a time.\n", 145 | "
\n", 146 | "\n", 147 | "

**Cons:**\n", 148 | "

    \n", 149 | "
  • Notebooks are not good for developing large applications or user interfaces.\n", 150 | "
  • Difficult to use if your project incorporates multiple Python files.\n", 151 | "
  • Possible to generate unreproducible results because cells can be executed out of order.\n", 152 | "
  • Awkward web browser interface, text editing is clumsy with limited configurability.\n", 153 | "
  • Difficult to integrate with debugging and version integration tools.\n", 154 | "
\n", 155 | "
" 156 | ] 157 | }, 158 | { 159 | "cell_type": "markdown", 160 | "metadata": {}, 161 | "source": [ 162 | "
\n", 163 | "

PyCharm (IDE)

\n", 164 | "\n", 165 | "

PyCharm is a popular integrated development environment. It includes a fully-featured text editor, excellent debugging tools, interactive data browsing, project management, and version control integration. It is easy to install but *not* included with Anaconda.\n", 166 | "\n", 167 | "

**Pros:**\n", 168 | "

    \n", 169 | "
  • Excellent, fully-featured text editor.\n", 170 | "
      \n", 171 | "
    • Syntax hilighting, indentation, autocomplete\n", 172 | "
    • Context-sensitive help (ctrl-q)\n", 173 | "
    • Can view Jupyter Notebook files.\n", 174 | "
    \n", 175 | "
  • Excellent debugging tools\n", 176 | "
      \n", 177 | "
    • Breakpoints / steppping\n", 178 | "
    • Stack inspection\n", 179 | "
    • Interactive object inspection (plotting with matplotlib!)\n", 180 | "
    • Array visualization\n", 181 | "
    \n", 182 | "
  • Project management, code versioning\n", 183 | "
      \n", 184 | "
    • Tracks files and execution environment\n", 185 | "
    • If you are working on a project with multiple files, this can be very helpful\n", 186 | "
    \n", 187 | "
\n", 188 | "\n", 189 | "

**Cons:**\n", 190 | "

    \n", 191 | "
  • **Lots** of features to wade through, overhead in learning new tools.\n", 192 | "
  • Project management can get in the way if you just want to work with a single file.\n", 193 | "
  • Interactivity is somewhat limited.\n", 194 | "
\n", 195 | "
" 196 | ] 197 | }, 198 | { 199 | "cell_type": "markdown", 200 | "metadata": {}, 201 | "source": [ 202 | "
\n", 203 | "

Spyder

\n", 204 | "\n", 205 | "Spyder is an integrated development environment with many similarities to MATLAB's default environment. It is included with Anaconda and provides a more interactive approach to development. \n", 206 | "\n", 207 | "Matlab + Notebook - like features:\n", 208 | "* Divide script into cells, execute in persistent process\n", 209 | "* Inline matplotlib results\n", 210 | "\n", 211 | "

**Pros:**\n", 212 | "

    \n", 213 | "
  • Decent text editor, debugger, and project management.\n", 214 | "
  • More interactive than pycharm--console, variable explorer, visualization tools.\n", 215 | "
  • List of set scripts, good for running already-written analysis tools. \n", 216 | "
  • Notebook-like features--divide a script into cells and execute in a background Python process.\n", 217 | "
\n", 218 | "\n", 219 | "

**Cons:**\n", 220 | "

    \n", 221 | "
  • Somewhat less mature and polished than pycharm.\n", 222 | "
  • Debugger can be difficult to use, no stack inspection.\n", 223 | "
\n", 224 | "
" 225 | ] 226 | } 227 | ], 228 | "metadata": { 229 | "kernelspec": { 230 | "display_name": "Python 2", 231 | "language": "python", 232 | "name": "python2" 233 | }, 234 | "language_info": { 235 | "codemirror_mode": { 236 | "name": "ipython", 237 | "version": 2 238 | }, 239 | "file_extension": ".py", 240 | "mimetype": "text/x-python", 241 | "name": "python", 242 | "nbconvert_exporter": "python", 243 | "pygments_lexer": "ipython2", 244 | "version": "2.7.13" 245 | } 246 | }, 247 | "nbformat": 4, 248 | "nbformat_minor": 0 249 | } 250 | -------------------------------------------------------------------------------- /PythonBootcamp/11_Image_data.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | " \n", 8 | "\n", 9 | "

Python Bootcamp

\n", 10 | "

August 19-20, 2017, Seattle, WA

" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "metadata": {}, 16 | "source": [ 17 | "
\n", 18 | "

Exercise: Numpy, Scipy, Matplotlib

\n", 19 | "\n", 20 | "

The following series of exercises are designed to give you more practice manipulating and plotting data using Numpy, Scipy, and Matplotlib\n", 21 | "

" 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": null, 27 | "metadata": { 28 | "collapsed": true 29 | }, 30 | "outputs": [], 31 | "source": [ 32 | "import numpy as np\n", 33 | "import matplotlib.pyplot as plt\n", 34 | "import scipy.misc\n", 35 | "import scipy.ndimage\n", 36 | "from __future__ import print_function\n", 37 | "\n", 38 | "%matplotlib notebook" 39 | ] 40 | }, 41 | { 42 | "cell_type": "markdown", 43 | "metadata": {}, 44 | "source": [ 45 | "\n", 46 | "
\n", 47 | "

Scipy has a built in image called 'face' that we can use to do some image processing

\n", 48 | "

The exercises below will walk you through various basic operations on this image\n", 49 | "

First, make a variabled called \"face\" that contains the image\n", 50 | "\n", 51 | "

" 52 | ] 53 | }, 54 | { 55 | "cell_type": "code", 56 | "execution_count": null, 57 | "metadata": { 58 | "collapsed": false 59 | }, 60 | "outputs": [], 61 | "source": [ 62 | "face = scipy.misc.face()" 63 | ] 64 | }, 65 | { 66 | "cell_type": "markdown", 67 | "metadata": {}, 68 | "source": [ 69 | "\n", 70 | "
\n", 71 | "

What is the image?

\n", 72 | "

Show the image using matplotlib\n", 73 | "

" 74 | ] 75 | }, 76 | { 77 | "cell_type": "code", 78 | "execution_count": null, 79 | "metadata": { 80 | "collapsed": false 81 | }, 82 | "outputs": [], 83 | "source": [ 84 | "# Use imshow" 85 | ] 86 | }, 87 | { 88 | "cell_type": "markdown", 89 | "metadata": {}, 90 | "source": [ 91 | "
-left: 3px solid #000; padding: 1px; padding-left: 10px; background: #F0FAFF; \">\n", 92 | "

What is the shape of the image?

\n", 93 | "

\n", 94 | "

" 95 | ] 96 | }, 97 | { 98 | "cell_type": "code", 99 | "execution_count": null, 100 | "metadata": { 101 | "collapsed": false 102 | }, 103 | "outputs": [], 104 | "source": [] 105 | }, 106 | { 107 | "cell_type": "markdown", 108 | "metadata": {}, 109 | "source": [ 110 | "\n", 111 | "
\n", 112 | "

Make note of the fact that the first two dimensions are ROWS x COLUMNS. When indexing into this array, you'll need to use this convention, as opposed to thinking of X and Y position (which would actually be column and row, respectively).\n", 113 | "

" 114 | ] 115 | }, 116 | { 117 | "cell_type": "markdown", 118 | "metadata": {}, 119 | "source": [ 120 | "
\n", 121 | "

What is the intensity range for the pixel values?

\n", 122 | "

hint: use the 'flatten' method to make a 1-D array, then make a histogram\n", 123 | "

" 124 | ] 125 | }, 126 | { 127 | "cell_type": "code", 128 | "execution_count": null, 129 | "metadata": { 130 | "collapsed": false, 131 | "scrolled": false 132 | }, 133 | "outputs": [], 134 | "source": [ 135 | "face_flat = face.flatten()\n", 136 | "#now make a histogram" 137 | ] 138 | }, 139 | { 140 | "cell_type": "markdown", 141 | "metadata": {}, 142 | "source": [ 143 | "
\n", 144 | "

The third image dimension refers to the number of color channels (R,G,B).

\n", 145 | "

Try making an array of equal size to the image, but that contains only the color at a given pixel (for example, find a pixel on a leaf, then display an array that contains only that color)\n", 146 | "

Below is an example of how the plot might look:\n", 147 | " \n", 148 | "

\n" 149 | ] 150 | }, 151 | { 152 | "cell_type": "code", 153 | "execution_count": null, 154 | "metadata": { 155 | "collapsed": false 156 | }, 157 | "outputs": [], 158 | "source": [] 159 | }, 160 | { 161 | "cell_type": "markdown", 162 | "metadata": {}, 163 | "source": [ 164 | "
\n", 165 | "

Convert the image to grayscale instead

\n", 166 | "

To start with, look at any (or all) of the color channels individually. Are they all the same?\n", 167 | "

Below is an example of what a plot of each individual color channel might look like. \n", 168 | "

Note that Matplotlib does not make it easy to put individual colorbars on subplots - scour the documentation or just check out the key to figure this out.\n", 169 | " \n", 170 | "

\n" 171 | ] 172 | }, 173 | { 174 | "cell_type": "code", 175 | "execution_count": null, 176 | "metadata": { 177 | "collapsed": false 178 | }, 179 | "outputs": [], 180 | "source": [] 181 | }, 182 | { 183 | "cell_type": "markdown", 184 | "metadata": { 185 | "collapsed": true 186 | }, 187 | "source": [ 188 | "\n", 189 | "
\n", 190 | "

To properly convert the color channels to gray (luminance), you need to account for our visual system's sensitivity to each individual color: https://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale. Try writing a function to do this, then applying it to the image.\n", 191 | "

" 192 | ] 193 | }, 194 | { 195 | "cell_type": "code", 196 | "execution_count": null, 197 | "metadata": { 198 | "collapsed": true 199 | }, 200 | "outputs": [], 201 | "source": [ 202 | "#try making a function that converts each pixel from RBG to gray" 203 | ] 204 | }, 205 | { 206 | "cell_type": "code", 207 | "execution_count": null, 208 | "metadata": { 209 | "collapsed": false 210 | }, 211 | "outputs": [], 212 | "source": [ 213 | "#apply the function, make a grayscale plot. Be sure to set the colormap appropriately." 214 | ] 215 | }, 216 | { 217 | "cell_type": "markdown", 218 | "metadata": {}, 219 | "source": [ 220 | "
\n", 221 | "

Try using scipy's gaussian filter method to smooth (blur) the grayscaled face image

\n", 222 | "

Hint: Look up documentation for scipy.ndimage.filters.gaussian_filter\n", 223 | "

Here's what a blurred image might look like:\n", 224 | " \n", 225 | "

\n" 226 | ] 227 | }, 228 | { 229 | "cell_type": "code", 230 | "execution_count": null, 231 | "metadata": { 232 | "collapsed": true 233 | }, 234 | "outputs": [], 235 | "source": [] 236 | }, 237 | { 238 | "cell_type": "markdown", 239 | "metadata": {}, 240 | "source": [ 241 | "
\n", 242 | "

In the grayscale image, find the pixel with the highest intensity

\n", 243 | "

plot an X over it in the image\n", 244 | "

Here's what it should look like:\n", 245 | "\n", 246 | " \n", 247 | "

" 248 | ] 249 | }, 250 | { 251 | "cell_type": "code", 252 | "execution_count": null, 253 | "metadata": { 254 | "collapsed": false 255 | }, 256 | "outputs": [], 257 | "source": [] 258 | }, 259 | { 260 | "cell_type": "markdown", 261 | "metadata": {}, 262 | "source": [ 263 | "
\n", 264 | "

In the grayscale image, choose a threshold, then make all values above that threshold white and all values below that threshold black

\n", 265 | "

**Bonus exercise: Use a sliderbar widget to make the threshold dynamically adjustable:**\n", 266 | "

see: http://ipywidgets.readthedocs.io/en/latest/examples/Using%20Interact.html\n", 267 | "

Here's what it should look like:\n", 268 | " \n", 269 | "

\n" 270 | ] 271 | }, 272 | { 273 | "cell_type": "code", 274 | "execution_count": null, 275 | "metadata": { 276 | "collapsed": false 277 | }, 278 | "outputs": [], 279 | "source": [ 280 | "# basic answer\n", 281 | "gray_face_thresholded = gray_face.copy() #make a copy of the data so you don't affect the original image\n", 282 | "\n", 283 | "threshold = 150\n", 284 | "gray_face_thresholded[gray_face_thresholded<=threshold] = 0\n", 285 | "gray_face_thresholded[gray_face_thresholded>threshold] = 1\n", 286 | "\n", 287 | "fig,ax=plt.subplots()\n", 288 | "\n", 289 | "ax.imshow(gray_face_thresholded,cmap='gray')" 290 | ] 291 | }, 292 | { 293 | "cell_type": "code", 294 | "execution_count": null, 295 | "metadata": { 296 | "collapsed": false 297 | }, 298 | "outputs": [], 299 | "source": [ 300 | "# Answer with slider bar\n", 301 | "# have to run 'pip install ipywidgets' from the command line first\n", 302 | "from ipywidgets import interact\n", 303 | "@interact\n", 304 | "def show_thresholded(threshold=(0,255,1)):\n", 305 | " gray_face_thresholded = gray_face.copy() #make a copy of the data so you don't affect the original image\n", 306 | "\n", 307 | " gray_face_thresholded[gray_face_thresholded<=threshold] = 0\n", 308 | " gray_face_thresholded[gray_face_thresholded>threshold] = 1\n", 309 | "\n", 310 | " fig,ax=plt.subplots()\n", 311 | "\n", 312 | " ax.imshow(gray_face_thresholded,cmap='gray')" 313 | ] 314 | }, 315 | { 316 | "cell_type": "markdown", 317 | "metadata": {}, 318 | "source": [ 319 | "\n", 320 | "
\n", 321 | "

Try making plots of intensity values for an x,y cross section through the image

\n", 322 | "

For example, a plot might look like this:\n", 323 | " \n", 324 | "

" 325 | ] 326 | }, 327 | { 328 | "cell_type": "code", 329 | "execution_count": null, 330 | "metadata": { 331 | "collapsed": false 332 | }, 333 | "outputs": [], 334 | "source": [ 335 | "#hint: Use gridspec to define the size and locations of the three plots" 336 | ] 337 | } 338 | ], 339 | "metadata": { 340 | "kernelspec": { 341 | "display_name": "Python 2", 342 | "language": "python", 343 | "name": "python2" 344 | }, 345 | "language_info": { 346 | "codemirror_mode": { 347 | "name": "ipython", 348 | "version": 2 349 | }, 350 | "file_extension": ".py", 351 | "mimetype": "text/x-python", 352 | "name": "python", 353 | "nbconvert_exporter": "python", 354 | "pygments_lexer": "ipython2", 355 | "version": "2.7.13" 356 | } 357 | }, 358 | "nbformat": 4, 359 | "nbformat_minor": 0 360 | } 361 | -------------------------------------------------------------------------------- /PythonBootcamp/support_files/CrossingDailyBarPlot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/PythonBootcamp/support_files/CrossingDailyBarPlot.png -------------------------------------------------------------------------------- /PythonBootcamp/support_files/CrossingMonthlyBarPlot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/PythonBootcamp/support_files/CrossingMonthlyBarPlot.png -------------------------------------------------------------------------------- /PythonBootcamp/support_files/SampleWorkbook.csv: -------------------------------------------------------------------------------- 1 | Column 1,Column 2 2 | one,1 3 | two,2 4 | three,3 -------------------------------------------------------------------------------- /PythonBootcamp/support_files/blurred.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/PythonBootcamp/support_files/blurred.png -------------------------------------------------------------------------------- /PythonBootcamp/support_files/cropped-SummerWorkshop_Header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/PythonBootcamp/support_files/cropped-SummerWorkshop_Header.png -------------------------------------------------------------------------------- /PythonBootcamp/support_files/cross_sections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/PythonBootcamp/support_files/cross_sections.png -------------------------------------------------------------------------------- /PythonBootcamp/support_files/grayscales.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/PythonBootcamp/support_files/grayscales.png -------------------------------------------------------------------------------- /PythonBootcamp/support_files/leafplot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/PythonBootcamp/support_files/leafplot.png -------------------------------------------------------------------------------- /PythonBootcamp/support_files/maxpixel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/PythonBootcamp/support_files/maxpixel.png -------------------------------------------------------------------------------- /PythonBootcamp/support_files/neuron.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/PythonBootcamp/support_files/neuron.jpg -------------------------------------------------------------------------------- /PythonBootcamp/support_files/stinkbug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/PythonBootcamp/support_files/stinkbug.png -------------------------------------------------------------------------------- /PythonBootcamp/support_files/thresholdedimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/PythonBootcamp/support_files/thresholdedimage.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SWDB_2017 2 | ![SWDB_2017](/resources/cropped-SummerWorkshop_Header.png) 3 | 4 | This is the repository for the course materials for the 2017 Summer Workshop on the Dynamic Brain. 5 | 6 | # Support Policy 7 | 8 | We are releasing this code as part of the 2017 Summer Workshop on the Dynamic Brain and will only be supporting and developing it for the context of this workshop. The community is welcome to submit issues, but you should not expect an active response outside of the context of the course. 9 | 10 | Copyright 2017 Allen Institute -------------------------------------------------------------------------------- /resources/Neocortical Interneurons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/resources/Neocortical Interneurons.png -------------------------------------------------------------------------------- /resources/cropped-SummerWorkshop_Header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AllenInstitute/SWDB_2017/5bdf9151d803c8bef544fd85ac7a58fc6350268c/resources/cropped-SummerWorkshop_Header.png --------------------------------------------------------------------------------