diff --git a/docs/tutorials/01_morph_neurons.ipynb b/docs/tutorials/01_morph_neurons.ipynb index de3f6ca7..6abe65b1 100644 --- a/docs/tutorials/01_morph_neurons.ipynb +++ b/docs/tutorials/01_morph_neurons.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c5a8b4e8", + "id": "3cb59f08", "metadata": {}, "source": [ "# Basics of Jaxley" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "124c89a9", + "id": "9cab6953", "metadata": {}, "source": [ "In this tutorial, you will learn how to:\n", @@ -61,7 +61,7 @@ }, { "cell_type": "markdown", - "id": "cf319317", + "id": "031ce290", "metadata": {}, "source": [ "First, we import the relevant libraries:" @@ -70,7 +70,7 @@ { "cell_type": "code", "execution_count": 1, - "id": "0090733c", + "id": "e1f3cf24", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +91,7 @@ }, { "cell_type": "markdown", - "id": "8abaf64e", + "id": "010e823e", "metadata": {}, "source": [ "We will now build our first cell in `Jaxley`. You have two options to do this: you can either build a cell bottom-up by defining the morphology yourselve, or you can [load cells from SWC files](https://jaxley.readthedocs.io/en/latest/tutorials/08_importing_morphologies.html).\n" @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "ea6c8516", + "id": "22c43455", "metadata": {}, "source": [ "### Define the cell from scratch\n", @@ -110,7 +110,7 @@ { "cell_type": "code", "execution_count": 2, - "id": "90a58c9a", + "id": "145ff540", "metadata": {}, "outputs": [], "source": [ @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "2e42f0e2", + "id": "bb109c89", "metadata": {}, "source": [ "Next, we can assemble branches into a cell. To do so, we have to define for each branch what its parent branch is. A `-1` entry means that this branch does not have a parent." @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": 3, - "id": "7da58262", + "id": "a069d64b", "metadata": {}, "outputs": [], "source": [ @@ -139,15 +139,15 @@ }, { "cell_type": "markdown", - "id": "c859a157", + "id": "f621d887", "metadata": {}, "source": [ - "To learn more about `Compartment`s, `Branch`es, and `Cell`s, see [this tutorial](http://localhost:8000/tutorials/00_jaxley_api.html)." + "To learn more about `Compartment`s, `Branch`es, and `Cell`s, see [this tutorial](https://jaxley.readthedocs.io/en/latest/tutorials/00_jaxley_api.html)." ] }, { "cell_type": "markdown", - "id": "dcaa571b", + "id": "21af5a58", "metadata": {}, "source": [ "### Read the cell from an SWC file\n", @@ -161,7 +161,7 @@ }, { "cell_type": "markdown", - "id": "56bf5d58", + "id": "6f23848c", "metadata": {}, "source": [ "### Visualize the cells" @@ -169,7 +169,7 @@ }, { "cell_type": "markdown", - "id": "cda1cfea", + "id": "533c3adb", "metadata": {}, "source": [ "Cells can be visualized as follows:" @@ -178,7 +178,7 @@ { "cell_type": "code", "execution_count": 4, - "id": "39778ba0", + "id": "eeb15b15", "metadata": {}, "outputs": [ { @@ -201,7 +201,7 @@ }, { "cell_type": "markdown", - "id": "830f7d89", + "id": "13f7151d", "metadata": {}, "source": [ "### Insert mechanisms\n", @@ -212,7 +212,7 @@ { "cell_type": "code", "execution_count": 5, - "id": "c3bd6bd2", + "id": "802b59c4", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "69bad83d", + "id": "ffbeb0a8", "metadata": {}, "source": [ "Once the cell is created, we can inspect its `.nodes` attribute which lists all properties of the cell:" @@ -232,7 +232,7 @@ { "cell_type": "code", "execution_count": 6, - "id": "808760af", + "id": "255e0e70", "metadata": {}, "outputs": [ { @@ -588,16 +588,18 @@ }, { "cell_type": "markdown", - "id": "becd1888", + "id": "650a2692", "metadata": {}, "source": [ - "Note that `Jaxley` uses the same units as the `NEURON` simulator, which are listed [here](https://www.neuron.yale.edu/neuron/static/docs/units/unitchart.html). You can also inspect just parts of the `cell`, for example its 1st branch:" + "_Note that `Jaxley` uses the same units as the `NEURON` simulator, which are listed [here](https://www.neuron.yale.edu/neuron/static/docs/units/unitchart.html)._\n", + "\n", + "You can also inspect just parts of the `cell`, for example its 1st branch:" ] }, { "cell_type": "code", "execution_count": 7, - "id": "96d1b565", + "id": "e2ef065e", "metadata": {}, "outputs": [ { @@ -729,7 +731,7 @@ }, { "cell_type": "markdown", - "id": "f83f6562", + "id": "825fb9ce", "metadata": {}, "source": [ "The easiest way to know which branch is the 1st branch (or, e.g., the zero-eth compartment of the 1st branch) is to plot it in a different color:" @@ -738,7 +740,7 @@ { "cell_type": "code", "execution_count": 8, - "id": "3e7865e7", + "id": "e6d9f62b", "metadata": {}, "outputs": [ { @@ -761,15 +763,15 @@ }, { "cell_type": "markdown", - "id": "9429e72d", + "id": "415a0534", "metadata": {}, "source": [ - "More background and features on indexing as `cell.branch(0)` is in [this tutorial](https://jaxleyverse.github.io/jaxley/latest/tutorial/00_jaxley_api.ipynb/)." + "More background and features on indexing as `cell.branch(0)` is in [this tutorial](https://jaxley.readthedocs.io/en/latest/tutorials/00_jaxley_api.html)." ] }, { "cell_type": "markdown", - "id": "632289d7", + "id": "d2c05ca5", "metadata": {}, "source": [ "### Change parameters of the cell\n", @@ -780,7 +782,7 @@ { "cell_type": "code", "execution_count": 9, - "id": "e5758559", + "id": "1b2df394", "metadata": {}, "outputs": [], "source": [ @@ -789,7 +791,7 @@ }, { "cell_type": "markdown", - "id": "93c59527", + "id": "17104361", "metadata": {}, "source": [ "And we can again inspect the `.nodes` to make sure that the axial resistivity indeed changed:" @@ -798,7 +800,7 @@ { "cell_type": "code", "execution_count": 10, - "id": "ef59e1d4", + "id": "130c13e5", "metadata": {}, "outputs": [ { @@ -930,7 +932,7 @@ }, { "cell_type": "markdown", - "id": "385cf323", + "id": "9967ca4c", "metadata": {}, "source": [ "In a similar way, you can modify channel properties or initial states (all units are the same as for the `NEURON` simulator, which are listed [here](https://www.neuron.yale.edu/neuron/static/docs/units/unitchart.html)):" @@ -939,7 +941,7 @@ { "cell_type": "code", "execution_count": 11, - "id": "30cc73a4", + "id": "b4da8cba", "metadata": {}, "outputs": [], "source": [ @@ -949,7 +951,7 @@ }, { "cell_type": "markdown", - "id": "5fbaff44", + "id": "d559f3e9", "metadata": {}, "source": [ "### Stimulate the cell\n", @@ -960,7 +962,7 @@ { "cell_type": "code", "execution_count": 12, - "id": "26863ae7", + "id": "7655a254", "metadata": {}, "outputs": [ { @@ -986,7 +988,7 @@ }, { "cell_type": "markdown", - "id": "152f039f", + "id": "e367d928", "metadata": {}, "source": [ "We then stimulate one of the compartments of the cell with this step current:" @@ -995,7 +997,7 @@ { "cell_type": "code", "execution_count": 13, - "id": "a75b3fed", + "id": "9c7ec374", "metadata": {}, "outputs": [ { @@ -1013,7 +1015,7 @@ }, { "cell_type": "markdown", - "id": "be1dae52", + "id": "fd0fbd52", "metadata": {}, "source": [ "### Define recordings" @@ -1021,7 +1023,7 @@ }, { "cell_type": "markdown", - "id": "fc898d53", + "id": "a3a04360", "metadata": {}, "source": [ "Next, you have to define where to record the voltage. In this case, we will record the voltage at two locations:" @@ -1030,7 +1032,7 @@ { "cell_type": "code", "execution_count": 14, - "id": "0e033d77", + "id": "790ab537", "metadata": {}, "outputs": [ { @@ -1050,7 +1052,7 @@ }, { "cell_type": "markdown", - "id": "eb9c8392", + "id": "362531bc", "metadata": {}, "source": [ "We can again visualize these locations to understand where we inserted recordings:" @@ -1059,7 +1061,7 @@ { "cell_type": "code", "execution_count": 15, - "id": "1214e040", + "id": "97b38d8e", "metadata": {}, "outputs": [ { @@ -1082,7 +1084,7 @@ }, { "cell_type": "markdown", - "id": "8778ac12", + "id": "61bbea8a", "metadata": {}, "source": [ "### Simulate the cell response\n", @@ -1093,7 +1095,7 @@ { "cell_type": "code", "execution_count": 16, - "id": "b971b666", + "id": "6c08054b", "metadata": {}, "outputs": [ { @@ -1111,7 +1113,7 @@ }, { "cell_type": "markdown", - "id": "a25d7505", + "id": "36a05bb6", "metadata": {}, "source": [ "The `jx.integrate` function returns an array of shape `(num_recordings, num_timepoints)`. In our case, we inserted `2` recordings and we simulated for 10ms at a 0.025 time step, which leads to 402 time steps.\n", @@ -1122,7 +1124,7 @@ { "cell_type": "code", "execution_count": 17, - "id": "97e20214", + "id": "7c605c24", "metadata": {}, "outputs": [ { @@ -1144,7 +1146,7 @@ }, { "cell_type": "markdown", - "id": "0bcc7b02", + "id": "507752b4", "metadata": {}, "source": [ "At the location of the first recording (in blue) the cell spiked, whereas at the second recording, it did not. This makes sense because we only inserted sodium and potassium channels into the first branch, but not in the entire cell." @@ -1152,7 +1154,7 @@ }, { "cell_type": "markdown", - "id": "3db2e713", + "id": "558fdda4", "metadata": {}, "source": [ "Congrats! You have just run your first morphologically detailed neuron simulation in `Jaxley`. We suggest to continue by learning how to [build networks](https://jaxley.readthedocs.io/en/latest/tutorials/02_small_network.html). If you are only interested in single cell simulations, you can directly jump to learning how to [speed up simulations](https://jaxley.readthedocs.io/en/latest/tutorials/04_jit_and_vmap.html). If you want to simulate detailed morphologies from SWC files, checkout our tutorial on [working with detailed morphologies](https://jaxley.readthedocs.io/en/latest/tutorials/08_importing_morphologies.html)."