{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "09:05:14 [I] klustakwik KlustaKwik2 version 0.2.6\n", "/home/mikkel/.virtualenvs/expipe/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject\n", " return f(*args, **kwds)\n", "/home/mikkel/.virtualenvs/expipe/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject\n", " return f(*args, **kwds)\n" ] } ], "source": [ "import os\n", "import pathlib\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib import colors\n", "import seaborn as sns\n", "import re\n", "import shutil\n", "import pandas as pd\n", "import scipy.stats\n", "\n", "import exdir\n", "import expipe\n", "from distutils.dir_util import copy_tree\n", "import septum_mec\n", "import spatial_maps as sp\n", "import head_direction.head as head\n", "import septum_mec.analysis.data_processing as dp\n", "import septum_mec.analysis.registration\n", "from septum_mec.analysis.plotting import violinplot\n", "\n", "from spike_statistics.core import permutation_resampling\n", "\n", "from tqdm import tqdm_notebook as tqdm\n", "from tqdm._tqdm_notebook import tqdm_notebook\n", "tqdm_notebook.pandas()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "project_path = dp.project_path()\n", "project = expipe.get_project(project_path)\n", "actions = project.actions\n", "\n", "output_path = pathlib.Path(\"output\") / \"longitudinal-comparisons-gridcells\"\n", "(output_path / \"statistics\").mkdir(exist_ok=True, parents=True)\n", "(output_path / \"figures\").mkdir(exist_ok=True, parents=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Load cell statistics and shuffling quantiles" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | action | \n", "baseline | \n", "entity | \n", "frequency | \n", "i | \n", "ii | \n", "session | \n", "stim_location | \n", "stimulated | \n", "tag | \n", "... | \n", "burst_event_ratio | \n", "bursty_spike_ratio | \n", "gridness | \n", "border_score | \n", "information_rate | \n", "information_specificity | \n", "head_mean_ang | \n", "head_mean_vec_len | \n", "spacing | \n", "orientation | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1849-060319-3 | \n", "True | \n", "1849 | \n", "NaN | \n", "False | \n", "True | \n", "3 | \n", "NaN | \n", "False | \n", "baseline ii | \n", "... | \n", "0.397921 | \n", "0.676486 | \n", "-0.459487 | \n", "0.078474 | \n", "0.965845 | \n", "0.309723 | \n", "5.788704 | \n", "0.043321 | \n", "0.624971 | \n", "22.067900 | \n", "
1 | \n", "1849-060319-3 | \n", "True | \n", "1849 | \n", "NaN | \n", "False | \n", "True | \n", "3 | \n", "NaN | \n", "False | \n", "baseline ii | \n", "... | \n", "0.146481 | \n", "0.277121 | \n", "-0.615405 | \n", "0.311180 | \n", "0.191375 | \n", "0.032266 | \n", "1.821598 | \n", "0.014624 | \n", "0.753333 | \n", "0.000000 | \n", "
2 | \n", "1849-060319-3 | \n", "True | \n", "1849 | \n", "NaN | \n", "False | \n", "True | \n", "3 | \n", "NaN | \n", "False | \n", "baseline ii | \n", "... | \n", "0.373466 | \n", "0.658748 | \n", "-0.527711 | \n", "0.131660 | \n", "3.833587 | \n", "0.336590 | \n", "4.407614 | \n", "0.121115 | \n", "0.542877 | \n", "27.758541 | \n", "
3 | \n", "1849-060319-3 | \n", "True | \n", "1849 | \n", "NaN | \n", "False | \n", "True | \n", "3 | \n", "NaN | \n", "False | \n", "baseline ii | \n", "... | \n", "0.097464 | \n", "0.196189 | \n", "-0.641543 | \n", "0.274989 | \n", "0.153740 | \n", "0.068626 | \n", "6.128601 | \n", "0.099223 | \n", "0.484916 | \n", "11.309932 | \n", "
4 | \n", "1849-060319-3 | \n", "True | \n", "1849 | \n", "NaN | \n", "False | \n", "True | \n", "3 | \n", "NaN | \n", "False | \n", "baseline ii | \n", "... | \n", "0.248036 | \n", "0.461250 | \n", "-0.085292 | \n", "0.198676 | \n", "0.526720 | \n", "0.033667 | \n", "1.602362 | \n", "0.051825 | \n", "0.646571 | \n", "0.000000 | \n", "
5 rows × 34 columns
\n", "\n", " | border_score | \n", "gridness | \n", "head_mean_ang | \n", "head_mean_vec_len | \n", "information_rate | \n", "speed_score | \n", "action | \n", "channel_group | \n", "unit_name | \n", "
---|---|---|---|---|---|---|---|---|---|
0 | \n", "0.348023 | \n", "0.275109 | \n", "3.012689 | \n", "0.086792 | \n", "0.707197 | \n", "0.149071 | \n", "1833-010719-1 | \n", "0.0 | \n", "127.0 | \n", "
1 | \n", "0.362380 | \n", "0.166475 | \n", "3.133138 | \n", "0.037271 | \n", "0.482486 | \n", "0.132212 | \n", "1833-010719-1 | \n", "0.0 | \n", "161.0 | \n", "
2 | \n", "0.367498 | \n", "0.266865 | \n", "5.586395 | \n", "0.182843 | \n", "0.271188 | \n", "0.062821 | \n", "1833-010719-1 | \n", "0.0 | \n", "191.0 | \n", "
3 | \n", "0.331942 | \n", "0.312155 | \n", "5.955767 | \n", "0.090786 | \n", "0.354018 | \n", "0.052009 | \n", "1833-010719-1 | \n", "0.0 | \n", "223.0 | \n", "
4 | \n", "0.325842 | \n", "0.180495 | \n", "5.262721 | \n", "0.103584 | \n", "0.210427 | \n", "0.094041 | \n", "1833-010719-1 | \n", "0.0 | \n", "225.0 | \n", "
\n", " | action | \n", "baseline | \n", "entity | \n", "frequency | \n", "i | \n", "ii | \n", "session | \n", "stim_location | \n", "stimulated | \n", "tag | \n", "... | \n", "p_e_peak | \n", "t_i_peak | \n", "p_i_peak | \n", "border_score_threshold | \n", "gridness_threshold | \n", "head_mean_ang_threshold | \n", "head_mean_vec_len_threshold | \n", "information_rate_threshold | \n", "speed_score_threshold | \n", "specificity | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1849-060319-3 | \n", "True | \n", "1849 | \n", "NaN | \n", "False | \n", "True | \n", "3 | \n", "NaN | \n", "False | \n", "baseline ii | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "0.332548 | \n", "0.229073 | \n", "6.029431 | \n", "0.205362 | \n", "1.115825 | \n", "0.066736 | \n", "0.445206 | \n", "
1 | \n", "1849-060319-3 | \n", "True | \n", "1849 | \n", "NaN | \n", "False | \n", "True | \n", "3 | \n", "NaN | \n", "False | \n", "baseline ii | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "0.354830 | \n", "0.089333 | \n", "6.120055 | \n", "0.073566 | \n", "0.223237 | \n", "0.052594 | \n", "0.097485 | \n", "
2 | \n", "1849-060319-3 | \n", "True | \n", "1849 | \n", "NaN | \n", "False | \n", "True | \n", "3 | \n", "NaN | \n", "False | \n", "baseline ii | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "0.264610 | \n", "-0.121081 | \n", "5.759406 | \n", "0.150827 | \n", "4.964984 | \n", "0.027120 | \n", "0.393687 | \n", "
3 | \n", "1849-060319-3 | \n", "True | \n", "1849 | \n", "NaN | \n", "False | \n", "True | \n", "3 | \n", "NaN | \n", "False | \n", "baseline ii | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "0.344280 | \n", "0.215829 | \n", "6.033364 | \n", "0.110495 | \n", "0.239996 | \n", "0.054074 | \n", "0.262612 | \n", "
4 | \n", "1849-060319-3 | \n", "True | \n", "1849 | \n", "NaN | \n", "False | \n", "True | \n", "3 | \n", "NaN | \n", "False | \n", "baseline ii | \n", "... | \n", "NaN | \n", "NaN | \n", "NaN | \n", "0.342799 | \n", "0.218967 | \n", "5.768170 | \n", "0.054762 | \n", "0.524990 | \n", "0.144702 | \n", "0.133677 | \n", "
5 rows × 45 columns
\n", "