diff --git a/doc/gui/tutorial_erp.ipynb b/doc/gui/tutorial_erp.ipynb index ab1e67b0d0..c11f584aa1 100644 --- a/doc/gui/tutorial_erp.ipynb +++ b/doc/gui/tutorial_erp.ipynb @@ -439,11 +439,11 @@ ], "metadata": { "finalized": { - "timestamp": 1659128328299, - "trusted": true + "timestamp": 1659922241581, + "trusted": false }, "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -457,7 +457,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.12" + "version": "3.7.4" }, "require": { "paths": { diff --git a/doc/gui/tutorial_gamma.ipynb b/doc/gui/tutorial_gamma.ipynb new file mode 100644 index 0000000000..726fe206b8 --- /dev/null +++ b/doc/gui/tutorial_gamma.ipynb @@ -0,0 +1,234 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "e12a66a7", + "metadata": {}, + "outputs": [], + "source": [ + "%load_ext autoreload\n", + "%autoreload 2" + ] + }, + { + "cell_type": "markdown", + "id": "2b8ad740", + "metadata": {}, + "source": [ + "# Gamma rhythms (30-80 Hz)" + ] + }, + { + "cell_type": "markdown", + "id": "7369753b", + "metadata": {}, + "source": [ + "## Getting Started\n", + "\n", + "In order to understand the workflow and initial parameter sets provided with this tutorial, we must first briefly describe prior studies on the mechanistic origin of gamma rhythms, including our prior modeling work that led to the creation of the parameter sets you will work with [1].\n", + "\n", + "Gamma rhythms can encompass a wide band of frequencies from 30-150 Hz. Here, we will focus on the generation of so called low gamma rhythms in the 30-80 Hz range. It has been well established through experiments and computational modeling that these rhythms can emerge in local spiking networks through interactions of excitatory cell and inhibitory cell interactions, with the period of the oscillation set by the time constant of decay of GABAA-mediated inhibitory currents [2–4], a mechanism that has been referred to as pyramidal-interneuronal gamma (PING). In normal regimes, the decay time constant of GABAA-mediated synapses (around 25 ms) bounds oscillations to the low gamma frequency band (around 40 Hz).\n", + "\n", + "In general, PING rhythms are initiated by “excitation” to the excitatory (E) cells that causes spiking, which in turn synaptically activates a spiking population of inhibitory (I) cells. In turn, these I cells inhibit the E cells, preventing further E cell activity until the E cells can overcome the effects of the inhibition (~25 ms later). The pattern is repeated, creating a gamma frequency oscillation (around 40 Hz, 40 spikes/second). This general principle is schematically described in Figure 1 below. The frequency of the rhythm is paced by this time constant of decay of inhibition, which is mediated by strong GABA-A currents, as well as the excitability of the E cells (if the E cells are very excitable, they can fire before the inhibition has completely worn off, and the oscillation will be faster).\n", + "\n", + "\n", + "![](https://raw.githubusercontent.com/jonescompneurolab/hnn-tutorials/master/gamma/images/image19.png)\n", + "
Schematic illustration of the circuit mechanisms underlying PING rhythms.
\n", + "\n", + "In this tutorial, we will explore the generation of PING rhythms in the HNN model. We will provide example parameter files and walk through simulations that generate low-frequency gamma activity in both Layers 2/3 and Layer 5, as in [1]. This tutorial relies on a different type of exogenous drive to “activate” the local network than the other tutorials. Here, the necessary excitation to generate spiking in the pyramidal neurons (E cells) that initiates the rhythm (see PING description above) is provided by a continuous train of action potentials with a Poisson distribution (Poisson Input) that activate post-synaptic excitatory AMPA synapses on the pyramidal neurons. This Poisson drive causes the pyramidal neurons to fire, dependent on the chosen conductance of the AMPA currents. The inhibition in the network is strong enough to overcome the Poisson drive and entrain the network spiking into a gamma frequency rhythm.\n", + "\n", + "Of note, gamma rhythms can be generated by circuit mechanisms other than PING, including subthreshold rhythmic exogenous drive. Lee and Jones (2013) examined various mechanisms of generation of gamma activity and described ways to distinguish the mechanisms of generation based on features of current dipole signal [1]. After completing this tutorial, we encourage you to explore alternate mechanisms of gamma generation and to compare to your own gamma data." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "2eba55b1-2ab7-4f07-a76c-34f5a184da4d", + "metadata": {}, + "outputs": [], + "source": [ + "import time\n", + "from hnn_core.gui.gui import HNNGUI\n", + "from ipywidgets import Output\n", + "from IPython.display import Javascript\n", + "\n", + "# do not mix this with GUI operations\n", + "gui = HNNGUI()" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "norwegian-angola", + "metadata": { + "require": [ + "html2canvas" + ], + "scrolled": true + }, + "outputs": [], + "source": [ + "# In practice, set return_layout to false to show the dashboard\n", + "# gui.compose()\n", + "gui.compose(return_layout=False)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "612eb831", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + " \n", + " " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "gui.capture()" + ] + }, + { + "cell_type": "markdown", + "id": "b2f48fa3", + "metadata": {}, + "source": [ + "\n", + "\n", + "## Load/view parameters to define network structure & to “activate” the network\n", + "\n", + "An initial parameter set that will simulate PING rhythms as described in the Getting Started section above can be downloaded via the following hyperlink: [gamma_L5weak_L2weak.param](https://github.com/jonescompneurolab/hnn/blob/master/param/gamma_L5weak_L2weak.param). This file can also be found in the HNN param subfolder.\n", + "\n", + "The template cortical column networks structure for this simulation is described in the Overview and What’s Under the Hood sections of the HNN webpage. Several of the network parameter (i.e., local excitatory and inhibitory connection strengths) will be adjusted in this tutorial, but we will begin by describing the inputs the “activate” the network.\n", + "\n", + "To load the initial parameter set, navigate to the HNN GUI and click::\n", + "\n", + " Load network" + ] + }, + { + "cell_type": "markdown", + "id": "061faff2", + "metadata": {}, + "source": [ + "Once you have this param file downloaded and existing drive deleted, upload the file to the GUI through the `Load network` button." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "9e078bf6", + "metadata": {}, + "outputs": [], + "source": [ + "gui._simulate_upload_file(\"https://raw.githubusercontent.com/jonescompneurolab/hnn/master/param/ERPYes100Trials.param\")" + ] + }, + { + "cell_type": "markdown", + "id": "0039c446", + "metadata": {}, + "source": [ + "In this simulation, the network will be “activated” with excitatory AMPA synaptic input, distributed in time as a Poisson process and given to somas of the pyramidal neurons in Layer 2/3 and Layer 5. This noisy input will generate spiking activity in the pyramidal neurons that can initiate the PING rhythm.\n", + "\n", + "To view the parameters that “activate” the network and initiate a gamma rhythm, return to the main GUI window and click:\n", + "\n", + " Drives" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "27f3897d", + "metadata": {}, + "outputs": [], + "source": [ + "gui._simulate_left_tab_click(\"Drives\")" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "95462496", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + " \n", + " " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "gui.capture()" + ] + } + ], + "metadata": { + "finalized": { + "timestamp": 1659922242465, + "trusted": true + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "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.7.4" + }, + "require": { + "paths": { + "html2canvas": "https://html2canvas.hertzen.com/dist/html2canvas" + }, + "shim": {} + }, + "vscode": { + "interpreter": { + "hash": "43b52e66020a3206304124443c3dbfb478b19fdebbaacdf952e81bd31b11f0ba" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}