Skip to content

Commit

Permalink
notebook for plotting modulation parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
wthun committed Jul 25, 2024
1 parent 2d7e4ce commit ffb102d
Showing 1 changed file with 281 additions and 0 deletions.
281 changes: 281 additions & 0 deletions examples/notebooks/neuromodulation/plot_hh_modulation_parameters.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "6416efc6-6a3c-4763-9c5d-4ba602910efd",
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "44b6c7e1-fc41-4335-9292-da06344bc7a2",
"metadata": {},
"outputs": [],
"source": [
"import plotly.graph_objects as go\n",
"import plotly.io as pio\n",
"pio.templates.default = 'plotly_dark'\n",
"pio.renderers.default = 'iframe'\n",
"\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "298c8b70-4724-4d5b-8e2e-5b729256c9d8",
"metadata": {},
"outputs": [],
"source": [
"def make_sigmoid(val, half, slope, maximum, minimum):\n",
" sigmoid = (maximum-minimum)*1/(1 + np.exp(-(val - half) / slope)) + minimum\n",
" return sigmoid\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "dddb5dcb-6563-456a-9f63-3081ac170fc4",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[{'param_name': 'mod_pka_g_min_kir_ms',\n",
" 'type': 'range',\n",
" 'sectionlist': 'all',\n",
" 'dist_type': 'uniform',\n",
" 'value': 1},\n",
" {'param_name': 'mod_pka_g_max_kir_ms',\n",
" 'type': 'range',\n",
" 'sectionlist': 'all',\n",
" 'dist_type': 'uniform',\n",
" 'value': 1.25},\n",
" {'param_name': 'mod_pka_g_half_kir_ms',\n",
" 'type': 'range',\n",
" 'sectionlist': 'all',\n",
" 'dist_type': 'uniform',\n",
" 'value': 12.5},\n",
" {'param_name': 'mod_pka_g_slope_kir_ms',\n",
" 'type': 'range',\n",
" 'sectionlist': 'all',\n",
" 'dist_type': 'uniform',\n",
" 'value': 1},\n",
" {'param_name': 'mod_pka_g_min_cal12_ms',\n",
" 'type': 'range',\n",
" 'sectionlist': 'all',\n",
" 'dist_type': 'uniform',\n",
" 'value': 1},\n",
" {'param_name': 'mod_pka_g_max_cal12_ms',\n",
" 'type': 'range',\n",
" 'sectionlist': 'all',\n",
" 'dist_type': 'uniform',\n",
" 'value': 1.25},\n",
" {'param_name': 'mod_pka_g_half_cal12_ms',\n",
" 'type': 'range',\n",
" 'sectionlist': 'all',\n",
" 'dist_type': 'uniform',\n",
" 'value': 12.5},\n",
" {'param_name': 'mod_pka_g_slope_cal12_ms',\n",
" 'type': 'range',\n",
" 'sectionlist': 'all',\n",
" 'dist_type': 'uniform',\n",
" 'value': 1},\n",
" {'param_name': 'mod_pka_g_min_cal13_ms',\n",
" 'type': 'range',\n",
" 'sectionlist': 'all',\n",
" 'dist_type': 'uniform',\n",
" 'value': 1},\n",
" {'param_name': 'mod_pka_g_max_cal13_ms',\n",
" 'type': 'range',\n",
" 'sectionlist': 'all',\n",
" 'dist_type': 'uniform',\n",
" 'value': 1.25},\n",
" {'param_name': 'mod_pka_g_half_cal13_ms',\n",
" 'type': 'range',\n",
" 'sectionlist': 'all',\n",
" 'dist_type': 'uniform',\n",
" 'value': 12.5},\n",
" {'param_name': 'mod_pka_g_slope_cal13_ms',\n",
" 'type': 'range',\n",
" 'sectionlist': 'all',\n",
" 'dist_type': 'uniform',\n",
" 'value': 1}]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# mod_pka_g_min, mod_pka_g_max, mod_pka_g_half, mod_pka_g_slope \n",
"{\n",
" \"MYMODULATIONKEY-kir\" : {\n",
" \"kir\": {\n",
" \"mod_pka_g_min\": 1,\n",
" \"mod_pka_g_max\": 1.25,\n",
" \"mod_pka_g_half\": 12.5,\n",
" \"mod_pka_g_slope\": 1\n",
" }\n",
" },\n",
" \n",
"}\n",
"\n",
"[\n",
" {\n",
" \"param_name\": \"mod_pka_g_min_kir_ms\",\n",
" \"type\": \"range\",\n",
" \"sectionlist\": \"all\",\n",
" \"dist_type\": \"uniform\",\n",
" \"value\": 1\n",
" },\n",
" {\n",
" \"param_name\": \"mod_pka_g_max_kir_ms\",\n",
" \"type\": \"range\",\n",
" \"sectionlist\": \"all\",\n",
" \"dist_type\": \"uniform\",\n",
" \"value\": 1.25\n",
" },\n",
" {\n",
" \"param_name\": \"mod_pka_g_half_kir_ms\",\n",
" \"type\": \"range\",\n",
" \"sectionlist\": \"all\",\n",
" \"dist_type\": \"uniform\",\n",
" \"value\": 12.5\n",
" },\n",
" {\n",
" \"param_name\": \"mod_pka_g_slope_kir_ms\",\n",
" \"type\": \"range\",\n",
" \"sectionlist\": \"all\",\n",
" \"dist_type\": \"uniform\",\n",
" \"value\": 1\n",
" },\n",
"\n",
" {\n",
" \"param_name\": \"mod_pka_g_min_cal12_ms\",\n",
" \"type\": \"range\",\n",
" \"sectionlist\": \"all\",\n",
" \"dist_type\": \"uniform\",\n",
" \"value\": 1\n",
" },\n",
" {\n",
" \"param_name\": \"mod_pka_g_max_cal12_ms\",\n",
" \"type\": \"range\",\n",
" \"sectionlist\": \"all\",\n",
" \"dist_type\": \"uniform\",\n",
" \"value\": 1.25\n",
" },\n",
" {\n",
" \"param_name\": \"mod_pka_g_half_cal12_ms\",\n",
" \"type\": \"range\",\n",
" \"sectionlist\": \"all\",\n",
" \"dist_type\": \"uniform\",\n",
" \"value\": 12.5\n",
" },\n",
" {\n",
" \"param_name\": \"mod_pka_g_slope_cal12_ms\",\n",
" \"type\": \"range\",\n",
" \"sectionlist\": \"all\",\n",
" \"dist_type\": \"uniform\",\n",
" \"value\": 1\n",
" },\n",
" \n",
" {\n",
" \"param_name\": \"mod_pka_g_min_cal13_ms\",\n",
" \"type\": \"range\",\n",
" \"sectionlist\": \"all\",\n",
" \"dist_type\": \"uniform\",\n",
" \"value\": 1\n",
" },\n",
" {\n",
" \"param_name\": \"mod_pka_g_max_cal13_ms\",\n",
" \"type\": \"range\",\n",
" \"sectionlist\": \"all\",\n",
" \"dist_type\": \"uniform\",\n",
" \"value\": 1.25\n",
" },\n",
" {\n",
" \"param_name\": \"mod_pka_g_half_cal13_ms\",\n",
" \"type\": \"range\",\n",
" \"sectionlist\": \"all\",\n",
" \"dist_type\": \"uniform\",\n",
" \"value\": 12.5\n",
" },\n",
" {\n",
" \"param_name\": \"mod_pka_g_slope_cal13_ms\",\n",
" \"type\": \"range\",\n",
" \"sectionlist\": \"all\",\n",
" \"dist_type\": \"uniform\",\n",
" \"value\": 1\n",
" }\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
" \n",
"]"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "13880088-3b08-414d-842a-a26c3631e684",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<iframe\n",
" scrolling=\"no\"\n",
" width=\"100%\"\n",
" height=\"545px\"\n",
" src=\"iframe_figures/figure_5.html\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
"></iframe>\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"values = np.arange(0, 150, 0.1)\n",
"ss = make_sigmoid(values, half=3.6, slope=1, maximum=1.25, minimum=0.75)\n",
"\n",
"go.Figure(go.Scatter(x=values, y=ss))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "nrn",
"language": "python",
"name": "nrn"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit ffb102d

Please sign in to comment.