1508 lines
204 KiB
Plaintext
1508 lines
204 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 1,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"%load_ext autoreload\n",
|
||
|
"%autoreload 2"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 91,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import os\n",
|
||
|
"import expipe\n",
|
||
|
"import pathlib\n",
|
||
|
"import numpy as np\n",
|
||
|
"import spatial_maps.stats as stats\n",
|
||
|
"import septum_mec\n",
|
||
|
"import septum_mec.analysis.data_processing as dp\n",
|
||
|
"import septum_mec.analysis.registration\n",
|
||
|
"import head_direction.head as head\n",
|
||
|
"import spatial_maps as sp\n",
|
||
|
"import speed_cells.speed as spd\n",
|
||
|
"import re\n",
|
||
|
"import joblib\n",
|
||
|
"import multiprocessing\n",
|
||
|
"import shutil\n",
|
||
|
"import psutil\n",
|
||
|
"import pandas as pd\n",
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"from distutils.dir_util import copy_tree\n",
|
||
|
"from neo import SpikeTrain\n",
|
||
|
"import scipy\n",
|
||
|
"\n",
|
||
|
"from tqdm import tqdm_notebook as tqdm\n",
|
||
|
"from tqdm._tqdm_notebook import tqdm_notebook\n",
|
||
|
"tqdm_notebook.pandas()\n",
|
||
|
"\n",
|
||
|
"from spike_statistics.core import permutation_resampling\n",
|
||
|
"\n",
|
||
|
"from spikewaveform.core import calculate_waveform_features_from_template, cluster_waveform_features\n",
|
||
|
"\n",
|
||
|
"from septum_mec.analysis.plotting import violinplot"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 40,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"%matplotlib inline\n",
|
||
|
"color_control = '#4393c3'\n",
|
||
|
"color_stimulated = '#d6604d'\n",
|
||
|
"\n",
|
||
|
"color_bs = '#5aae61'\n",
|
||
|
"color_ns = '#9970ab'\n",
|
||
|
"\n",
|
||
|
"figsize_violin = (1.7, 3)\n",
|
||
|
"figsize_gen = (4, 3)\n",
|
||
|
"\n",
|
||
|
"output_path = pathlib.Path(\"output\") / \"waveform-analysis\"\n",
|
||
|
"(output_path / \"statistics\").mkdir(exist_ok=True, parents=True)\n",
|
||
|
"(output_path / \"figures\").mkdir(exist_ok=True, parents=True)\n",
|
||
|
"output_path.mkdir(exist_ok=True)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 4,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"data_loader = dp.Data()\n",
|
||
|
"actions = data_loader.actions\n",
|
||
|
"project = data_loader.project"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 5,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"N cells: 1281\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"identify_neurons = actions['identify-neurons']\n",
|
||
|
"sessions = pd.read_csv(identify_neurons.data_path('sessions'))\n",
|
||
|
"units = pd.read_csv(identify_neurons.data_path('units'))\n",
|
||
|
"session_units = pd.merge(sessions, units, on='action')\n",
|
||
|
"#########################3\n",
|
||
|
"# session_units = session_units.drop_duplicates('unit_id')\n",
|
||
|
"#################################\n",
|
||
|
"print('N cells:',session_units.shape[0])"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 6,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<div>\n",
|
||
|
"<style scoped>\n",
|
||
|
" .dataframe tbody tr th:only-of-type {\n",
|
||
|
" vertical-align: middle;\n",
|
||
|
" }\n",
|
||
|
"\n",
|
||
|
" .dataframe tbody tr th {\n",
|
||
|
" vertical-align: top;\n",
|
||
|
" }\n",
|
||
|
"\n",
|
||
|
" .dataframe thead th {\n",
|
||
|
" text-align: right;\n",
|
||
|
" }\n",
|
||
|
"</style>\n",
|
||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
||
|
" <thead>\n",
|
||
|
" <tr style=\"text-align: right;\">\n",
|
||
|
" <th></th>\n",
|
||
|
" <th>action</th>\n",
|
||
|
" <th>control</th>\n",
|
||
|
" <th>entity</th>\n",
|
||
|
" <th>frequency</th>\n",
|
||
|
" <th>session</th>\n",
|
||
|
" <th>stim_location</th>\n",
|
||
|
" <th>stimulated</th>\n",
|
||
|
" <th>tag</th>\n",
|
||
|
" <th>channel_group</th>\n",
|
||
|
" <th>unit_name</th>\n",
|
||
|
" </tr>\n",
|
||
|
" </thead>\n",
|
||
|
" <tbody>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>0</th>\n",
|
||
|
" <td>1849-060319-3</td>\n",
|
||
|
" <td>True</td>\n",
|
||
|
" <td>1849</td>\n",
|
||
|
" <td>NaN</td>\n",
|
||
|
" <td>3</td>\n",
|
||
|
" <td>NaN</td>\n",
|
||
|
" <td>False</td>\n",
|
||
|
" <td>baseline ii</td>\n",
|
||
|
" <td>1</td>\n",
|
||
|
" <td>104</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>1</th>\n",
|
||
|
" <td>1849-060319-3</td>\n",
|
||
|
" <td>True</td>\n",
|
||
|
" <td>1849</td>\n",
|
||
|
" <td>NaN</td>\n",
|
||
|
" <td>3</td>\n",
|
||
|
" <td>NaN</td>\n",
|
||
|
" <td>False</td>\n",
|
||
|
" <td>baseline ii</td>\n",
|
||
|
" <td>1</td>\n",
|
||
|
" <td>108</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>2</th>\n",
|
||
|
" <td>1849-060319-3</td>\n",
|
||
|
" <td>True</td>\n",
|
||
|
" <td>1849</td>\n",
|
||
|
" <td>NaN</td>\n",
|
||
|
" <td>3</td>\n",
|
||
|
" <td>NaN</td>\n",
|
||
|
" <td>False</td>\n",
|
||
|
" <td>baseline ii</td>\n",
|
||
|
" <td>1</td>\n",
|
||
|
" <td>85</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>3</th>\n",
|
||
|
" <td>1849-060319-3</td>\n",
|
||
|
" <td>True</td>\n",
|
||
|
" <td>1849</td>\n",
|
||
|
" <td>NaN</td>\n",
|
||
|
" <td>3</td>\n",
|
||
|
" <td>NaN</td>\n",
|
||
|
" <td>False</td>\n",
|
||
|
" <td>baseline ii</td>\n",
|
||
|
" <td>1</td>\n",
|
||
|
" <td>94</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>4</th>\n",
|
||
|
" <td>1849-060319-3</td>\n",
|
||
|
" <td>True</td>\n",
|
||
|
" <td>1849</td>\n",
|
||
|
" <td>NaN</td>\n",
|
||
|
" <td>3</td>\n",
|
||
|
" <td>NaN</td>\n",
|
||
|
" <td>False</td>\n",
|
||
|
" <td>baseline ii</td>\n",
|
||
|
" <td>1</td>\n",
|
||
|
" <td>98</td>\n",
|
||
|
" </tr>\n",
|
||
|
" </tbody>\n",
|
||
|
"</table>\n",
|
||
|
"</div>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
" action control entity frequency session stim_location \\\n",
|
||
|
"0 1849-060319-3 True 1849 NaN 3 NaN \n",
|
||
|
"1 1849-060319-3 True 1849 NaN 3 NaN \n",
|
||
|
"2 1849-060319-3 True 1849 NaN 3 NaN \n",
|
||
|
"3 1849-060319-3 True 1849 NaN 3 NaN \n",
|
||
|
"4 1849-060319-3 True 1849 NaN 3 NaN \n",
|
||
|
"\n",
|
||
|
" stimulated tag channel_group unit_name \n",
|
||
|
"0 False baseline ii 1 104 \n",
|
||
|
"1 False baseline ii 1 108 \n",
|
||
|
"2 False baseline ii 1 85 \n",
|
||
|
"3 False baseline ii 1 94 \n",
|
||
|
"4 False baseline ii 1 98 "
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 6,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"session_units.head()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 7,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"<matplotlib.axes._subplots.AxesSubplot at 0x7f06055511d0>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 7,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD7CAYAAAB37B+tAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAADc9JREFUeJzt3W/InfV9x/H3reYYW1JnoUgb1CDdvtyPRDKMwzkDWjYnxU3GHgxDqRRp8YHSdmptglAs6NAU6tCBmqZsFURNClMy82Cb2o22NFqY9vDV2qb1QYVNCI2605PUew/uEzyz9/l7n39f7/cLhOtc58/18cflx19+ua5zllZWVpAk1XXavANIktbHIpek4ixySSrOIpek4ixySSrOIpek4ixySSrOIpek4ixySSrujFkcZMeOHStbt26dxaHWrd1u02g05h1jZOaevarZzT1b68n98ssv/09mfmzQ62ZS5Fu3buXAgQOzONS6NZtNlpeX5x1jZOaevarZzT1b68kdEb8Y5nUurUhScRa5JBVnkUtScRa5JBVnkUtScRa5JBU38PLDiDgdeAgIYAX4PNAC9ncevwTclJn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Z0PT6tV4kDDBNEkjSecZdW/gP4c4CIuBT4r4klkiSNZNwZ+UHgUxHxn8AS8NnJRZIkjWKsNXJJ0uLwhiBJKs4il6Ti/M3OLhHxAqtX5AD8PDMXeu0/InYA92Tmzoj4JLAfWAFeAm7KzHfnma+X9+W+GHgKeLXz9IOZ+dj80v2uiNgE7AO2AWc
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"session_units.groupby('action').count().unit_name.hist()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Process all data"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 8,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def features(row):\n",
|
||
|
" action_id = row['action']\n",
|
||
|
" channel_id = row['channel_group']\n",
|
||
|
" unit = row['unit_name']\n",
|
||
|
" template = data_loader.template(action_id, channel_id, unit)\n",
|
||
|
" spike_times = data_loader.spike_train(action_id, channel_id, unit)\n",
|
||
|
" half_widths, peak_to_troughs = calculate_waveform_features_from_template(\n",
|
||
|
" template.data, template.sampling_rate)\n",
|
||
|
" peak_amps = template.data.min(axis=1)\n",
|
||
|
" half_widths = half_widths * 1000 # to ms\n",
|
||
|
" peak_to_troughs = peak_to_troughs * 1000 # to ms\n",
|
||
|
" idxs = np.argsort(peak_amps)\n",
|
||
|
" peak_to_trough = np.nan\n",
|
||
|
" for p2t in peak_to_troughs[idxs]:\n",
|
||
|
" if np.isfinite(p2t) and p2t > .1:\n",
|
||
|
" peak_to_trough = p2t\n",
|
||
|
" break\n",
|
||
|
" half_width = np.nan\n",
|
||
|
" for hw in half_widths[idxs]:\n",
|
||
|
" if np.isfinite(hw):\n",
|
||
|
" half_width = hw\n",
|
||
|
" break\n",
|
||
|
" \n",
|
||
|
" return pd.Series({\n",
|
||
|
" 'half_width': half_width,\n",
|
||
|
" 'peak_to_trough': peak_to_trough,\n",
|
||
|
" 'average_firing_rate': float(len(spike_times) / spike_times.t_stop),\n",
|
||
|
" 'template': template.data[idxs[0]]\n",
|
||
|
" })"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 9,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/vnd.jupyter.widget-view+json": {
|
||
|
"model_id": "4e27da53954b492ba7a0ab4933847df2",
|
||
|
"version_major": 2,
|
||
|
"version_minor": 0
|
||
|
},
|
||
|
"text/plain": [
|
||
|
"HBox(children=(IntProgress(value=0, max=1281), HTML(value='')))"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"results = session_units.merge(\n",
|
||
|
" session_units.progress_apply(features, axis=1), \n",
|
||
|
" left_index=True, right_index=True)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 10,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"df = results.loc[:, ['half_width', 'peak_to_trough']].dropna()\n",
|
||
|
"\n",
|
||
|
"idxs_df = cluster_waveform_features(df.half_width, df.peak_to_trough)\n",
|
||
|
"\n",
|
||
|
"results.loc[df.index, 'bs'] = idxs_df"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 86,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVB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x7YZKUCyE5mp2JiT/ZukE24Epr+IjAMI/+0nIqfjDP03ujnJTmSmYmPuyG+SigKZSNwIzG040yd8jBMW3Q78A/BvXhpmpAZedQm7bXjJFriW6MhvkooCmUjaHWinquuBSc0Wv+mNOUamEGl484rvaLMnJpE9NV4MnEtFgUwk7QqMiHyIMx4mwkFVLfLOJCMTSMWGFxG9uZNvw+/zx0VoMr0r282vNw4YDxQA/wd41UuDMpHWwoXuHL+n4ixvEdEDMjqsiSft/ndV9UT4dVxVVwPnJMCujKK1OD1R8Xu6CJnXdkZEb8LQwpTzrtIVNyHSj/gsRBoBpPZVmIa0Fi4kKoxwmw9JNomyM9PDmnji5mnqypj3m4CVHtmSsbR2QSfqQvdCyCxhaoC7HMxTOGNezgOGAcfc7FhEJovIqy0snyEib4jIWhG5KbzsVBFZLCKvi8gKEcl2fwqZSTzDBS/yIV6Ed6mYtzHaxs1/6jFgDE55kVE4BdXapI3Caz2BhcDFwAXAzSIyFLgFeEdVvwD8Hvi++1NIL+IlDB1twInOsyTS20iXHFIm4kZgxqrqPFUtVdW5wFkutmmt8Np4YKuqfqKqnwKrgPOBaXwWev0F+LKLY6Qk7V3s8bqzd7QBd+a4XWm4ifQ2Mn0wWyrj5r/fW0ROg2jp16z2Nmit8BpOOZIDMZ8P4ZSPjV0eWZaWtHexx+vO3tEG3JnjpkvDTZXcjHlSJ+Pm6vwZsElElgIbcUKcznKQprPj9QP2N1seWZaWFGSPY7ZcSUH
|
||
|
"text/plain": [
|
||
|
"<Figure size 288x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure(figsize=figsize_gen)\n",
|
||
|
"size = 5\n",
|
||
|
"mew = .5\n",
|
||
|
"marker_bs = '.'\n",
|
||
|
"marker_ns = '+'\n",
|
||
|
"\n",
|
||
|
"plt.scatter(\n",
|
||
|
" results.query('bs==0')['half_width'], \n",
|
||
|
" results.query('bs==0')['peak_to_trough'], \n",
|
||
|
" c=color_ns, s=size, marker=marker_ns, linewidth=mew, label='NS')\n",
|
||
|
"\n",
|
||
|
"plt.scatter(\n",
|
||
|
" results.query('bs==1')['half_width'], \n",
|
||
|
" results.query('bs==1')['peak_to_trough'], \n",
|
||
|
" c=color_bs, s=size, marker=marker_bs, linewidth=mew, label='BS')\n",
|
||
|
"\n",
|
||
|
"plt.xlabel('half width')\n",
|
||
|
"plt.ylabel('peak to through')\n",
|
||
|
"\n",
|
||
|
"plt.legend(bbox_to_anchor=(0,1.02,1,0.2), loc=\"lower left\",\n",
|
||
|
" mode=\"expand\", borderaxespad=0, ncol=2)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"clusters.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"clusters.png\", dpi=600, bbox_inches=\"tight\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 85,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAARgAAADwCAYAAADb7nvXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJztnXl8VOX1h5+ZJLIvQhKWIGFzXgghoCgEhIrVKgoCAiqIVgWsIuAuP21tLa1FbbUUKwgqKAoFhbAURaUWsQqishMCL1sMCAkJSFgTmMzc3x8zE4eQZZLMnSVzHj7zyczd5tw73O8957znfV+LYRgIgiCYgTXYBgiCUHMRgREEwTREYARBMA0RGEEQTEMERhAE04gOtgHVYePGjfHR0dFvA8mIWApCIHAC6UVFRWO7d++eW9HGYS0w0dHR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9YsGD3ihUrdjkcDsv3339f95FHHslu3bp1wTPPPJM9derU5j179jy1aNGi3X/5y1+ynn/++dbex0pISLD/6U9/+nHx4sW7WrZseX7QoEFJK1asuCDcadeu3fnU1NQz3stOnToVVb9+fYfnc926dR0nT56MKmnrpEmT2g4fPlwNHz5c3X333TbP8rlz5+5bvHix7tKly+mRI0ceqaq4QAR6MFk7sht89vZa201jr9md2LnFKX8cMzY21vHUU08dfPrpp9umpKScPnHiRFRWVlatyZMnHwIO/fjjjzEPP/xw+48//vjMrbfeesIf3ym4Wb68ISNHdmDBgr0MG3ayuofr1q3bqTfffHM/wK5du2qNGjWqU58+fbauW7eu/l133XXs3nvvPVZYWGiZNm1a88mTJ7eePXv2Pu/9ExMTzwFERUURExNjjBs3rl2dOnUcR48evaSoqOiCB/q+ffvqbNy4seGqVauaAJw6deqi+3HDhg11FyxYEHvgwIHa48aNO3TddddV+H+2QYMGjrNnzxYLytmzZ6MaNWrkKLndX//618xOnToVgisHc+ONNxY3PU+bNq3Z8ePHo//xj39kVfR95RFxHkxi5xan/CkuHm699dYTrVu3Lvz000+bnj9/3vr000+3y8nJiQZo0aKFvUmTJvZatWpJiORvBg8+yYIFexk8uNriUpJmzZoVu0Xvv/9+sw8++KApQO3atQ2bzVYQExNzkUvqKZvYunVrnTVr1jR+880390+ZMuWg0+nEMAysViuGYVgAEhMTC+++++4jixcv1tOnT9/Xv3//Y97HWrFiRaP58+fHjRw58uiiRYt2jxkz5mj9+vUrdIOvuuqqM1u3bq1fUFBgyc/Pj8rKyqqdnJxcUNF+Ht59993YzZs313/llVeqJS4QgR4MuETGjOP++c9/PjBgwIDOcXFx9kmTJh0YO3bs5VFRUYbT6bRcc801+TfeeKPfb4KIJzoaf3guHjwhktVqNQoKCqIeffTRg3Xr1jWmTJmS9bvf/a71/Pnzm9WqVcvZqFEj+5QpUw6UdZwOHTqcq1OnjnPIkCEdAZo2bWrPycmJSU1NPW232y3PP/98wuOPP5791FNPtVm8eHHc2bNnrePGj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8GKXUJOBtoHYpq7sDv9Za93O/NDAO2K617gu8Bzxnhl2CIAQWs0KkfcDQMtZ1B55VSn2tlHrWvawP8Kn7/SfADSbZJQhCADFFYLTWaUBZnWsWAg8BvwT6KKUGAg2BE+71p4BGZtglCEJgCWgdjFLKAvxDa33C/flj4ArgJNDAvVkDID+QdgmCYA6BLrRrCKQrpToBZ3B5MXOAs8AtwHfAzcBXAbZLEAQTCIjAKKXuAuprrd9USv0W+AI4B/xXa71SKbUGmKuU+ho4D9w
|
||
|
"text/plain": [
|
||
|
"<Figure size 288x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure(figsize=figsize_gen)\n",
|
||
|
"\n",
|
||
|
"size = 5\n",
|
||
|
"mew = .5\n",
|
||
|
"marker_bs = '.'\n",
|
||
|
"marker_ns = '+'\n",
|
||
|
"\n",
|
||
|
"plt.scatter(\n",
|
||
|
" results.query('bs==0')['half_width'], \n",
|
||
|
" results.query('bs==0')['peak_to_trough'], \n",
|
||
|
" c=color_ns, s=size, marker=marker_ns, linewidth=mew, label='NS')\n",
|
||
|
"\n",
|
||
|
"plt.scatter(\n",
|
||
|
" results.query('bs==1')['half_width'], \n",
|
||
|
" results.query('bs==1')['peak_to_trough'], \n",
|
||
|
" c=color_bs, s=size, marker=marker_bs, linewidth=mew, label='BS')\n",
|
||
|
"\n",
|
||
|
"plt.scatter(\n",
|
||
|
" results.query('bs==1 and average_firing_rate > 10')['half_width'], \n",
|
||
|
" results.query('bs==1 and average_firing_rate > 10')['peak_to_trough'], \n",
|
||
|
" c='red', s=size, marker=marker_bs, linewidth=mew, label='BS rate > 10 Hz')\n",
|
||
|
"\n",
|
||
|
"plt.xlabel('half width')\n",
|
||
|
"plt.ylabel('peak to through')\n",
|
||
|
"\n",
|
||
|
"plt.legend(bbox_to_anchor=(0,1.02,1,0.2), loc=\"lower left\",\n",
|
||
|
" mode=\"expand\", borderaxespad=0, ncol=2)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"clusters_and_rate.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"clusters_and_rate.png\", dpi=600, bbox_inches=\"tight\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 31,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"stim = results.query('stimulated').loc[:, ['half_width', 'peak_to_trough']].dropna()\n",
|
||
|
"\n",
|
||
|
"idxs_stim = cluster_waveform_features(stim.half_width, stim.peak_to_trough)\n",
|
||
|
"\n",
|
||
|
"results.loc[stim.index, 'bs_stim'] = idxs_stim"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 32,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"control = results.query('not stimulated').loc[:, ['half_width', 'peak_to_trough']].dropna()\n",
|
||
|
"\n",
|
||
|
"idxs_control = cluster_waveform_features(control.half_width, control.peak_to_trough)\n",
|
||
|
"\n",
|
||
|
"results.loc[control.index, 'bs_ctrl'] = idxs_control"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 87,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAARgAAADwCAYAAADb7nvXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJztnXl4VFW2t9+qSiqVOWQgCQkQCGTLIIjMCgItMqkog43QXFtbrt3tcFu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HZrPZrrg+EhISbO6md1FRUeCoUaOqASZNmlSemZnZYpPZaDTy3HPPZb744otJeXl59Q+L7du3hz/88MP569atkzt27DgcHBxsX7VqVWJ7z73HCUxQYrItauqswqDEZFtH93X06NHgp59+up87gJuWllYTGhpqN5lMGAwG7Wpz7bTUtAgKCnIUFRUFAmRmZporKioaCdVf//rX+JEjR1a++OKL5+bMmVPi3r/7WLGxsXWxsbG2V155JeODDz6QDzzwwKUbb7yxPDU1tfrgwYOhAAcPHgxuKkwNiYiIcDz11FPnV61aVS8g//jHP+LffffdGACLxaKlpaVVBwYGtj1C6Uf07RViu214QmHfXiEdvk5mz559ec+ePZEZGRlBADabzfDMM8/0lVIGDxo0qObbb78Ndy8/cuRIWGpqqhWufq0YjUbNHRw2GAz1F1hMTExtenp6MMDOnTvDk5OTa1o9x759ax944IGcv/zlL/XezurVq5O3b98eBk4vKyUlxepuyrWHHhmD6QxxAZg3b97ljIwMy9y5c4cEBwc7NE3jscceuxgVFWW/9tprq1avXp08ePDgVv/RbsaMGVMZFhZWd/vtt1+TkpJSEx8f38jO6dOnl65cubLf1q1bo8PCwupMJpNWU1NjaHisJ598Muu+++4bpGmaISQkxL569epzEydOrPiP//iPAfPmzRP9+/evCQwMbPGCmTp1avnNN99cfOrUqRCAlStXnv/1r3/d76233ooPCgpyREZG1q5cufJC+341/6EzxAUgMjLS8dvf/vbcr371q/4Oh8NQVVVlnDx5cumyZcsKjEYje/fuDb/jjjuuqa2tNUyfPr1k9OjRVa+//vpV93XttddWPPHEEwNWrFjRKMbyzDPPZK5YsaKfpmmYTCbt2WefzfTEtqVLlxZ99tln9UHc1atXn12xYkXf3//+9wGBgYFanz59rC3Fc1rD4M8z2qWnp2eOHDmysKvtUCh6Gunp6bEjR45MaW29HtdEUigU3kMJjEKh0A0lMAqFQjeUwCgUCt1QAqNQKHRDCYxCodCNHpkH05msWrUqYd++fRF1dXUGo9GoPfnkkxfHjBlTdfjw4eCSkhLTlClTKh544IGBf/rTn861d8DjI488knLrrbcWz5o1q+xq3zc8Vmv7qq6uNsyYMWP4zp07jzRcPnny5Gt79+5tA6ipqTFOnz69+LHHHstr6Rzbcy49laNHj1qeffbZZKvVaqyurjbdcMMNpb/4xS9yjMa2PeM3bNgQNXbs2MqkpKTa1tY9d+6c+Wc/+9nAjz76qNHYsmHDhl0/ZMiQSk3TqK6uNi5dujRvyZIlxXa7naeeeir5zJkzwbW1tUaLxeJYsWLF+dTU1HbnAymB6QDu0dTr168/aTQaOXToUPAvfvGLAVu3bj3+8ccf94qNja2dMmVKhXvwol40PFZH9rNmzZpTwcHBmtVqNcyYMWPYkiVLigoLCwOaO8fOsr+74x5N/ec///lMWlqata6ujgceeCD11Vdfjfv3f//3ZseGXY01a9bECyHOeyIwzREWFmb/4IMPJMDly5dNM2bMGH733XcXb926NbKgoMD8zjv
|
||
|
"text/plain": [
|
||
|
"<Figure size 288x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure(figsize=figsize_gen)\n",
|
||
|
"size = 5\n",
|
||
|
"mew = .5\n",
|
||
|
"marker_bs = '.'\n",
|
||
|
"marker_ns = '+'\n",
|
||
|
"plt.scatter(\n",
|
||
|
" results.query('bs_stim==0')['half_width'], \n",
|
||
|
" results.query('bs_stim==0')['peak_to_trough'], \n",
|
||
|
" c=color_stimulated, s=size, marker=marker_ns, \n",
|
||
|
" linewidth=mew, label='Stimulated NS', alpha=.5)\n",
|
||
|
"\n",
|
||
|
"plt.scatter(\n",
|
||
|
" results.query('bs_stim==1')['half_width'], \n",
|
||
|
" results.query('bs_stim==1')['peak_to_trough'], \n",
|
||
|
" c=color_stimulated, s=size, marker=marker_bs, \n",
|
||
|
" linewidth=mew, label='Stimulated BS', alpha=.5)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"plt.scatter(\n",
|
||
|
" results.query('bs_ctrl==0')['half_width'], \n",
|
||
|
" results.query('bs_ctrl==0')['peak_to_trough'], \n",
|
||
|
" c=color_control, s=size, marker=marker_ns, \n",
|
||
|
" linewidth=mew, label='Control NS', alpha=.5)\n",
|
||
|
"\n",
|
||
|
"plt.scatter(\n",
|
||
|
" results.query('bs_ctrl==1')['half_width'], \n",
|
||
|
" results.query('bs_ctrl==1')['peak_to_trough'], \n",
|
||
|
" c=color_control, s=size, marker=marker_bs, \n",
|
||
|
" linewidth=mew, label='Control BS', alpha=.5)\n",
|
||
|
"\n",
|
||
|
"plt.xlabel('half width')\n",
|
||
|
"plt.ylabel('peak to through')\n",
|
||
|
"plt.legend(bbox_to_anchor=(0,1.02,1,0.2), loc=\"lower left\",\n",
|
||
|
" mode=\"expand\", borderaxespad=0, ncol=2)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"compare-clusters.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"compare-clusters.png\", dpi=600, bbox_inches=\"tight\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 47,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"results.average_firing_rate = results.apply(lambda x: float(x.average_firing_rate), axis=1)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 64,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"results.frequency = results.apply(\n",
|
||
|
" lambda x: \n",
|
||
|
" float(x.frequency.replace('Hz', '')) if isinstance(x.frequency, str) \n",
|
||
|
" else float(x.frequency), axis=1)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 74,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQUAA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dmEekkj6XobwJuyrkuyahxHcMVJdch9aNrH0QkQWc09qkrHvunskuQmlKnICIJ6hT6TPNcgiYYpVsKhT4xGgYaNkhGGj6ISII6hT6lYYOMl0Kh5nRfRcmbQqGGFARSJIVCn9AEo+RFoVBj8Qub1sxRKEg+FAp9RhOMkpVCoeZ0vwTJm85TEJEEdQo10umog4YNkheFQg3oEKT0kkKhhnQ7NSmSQqFGGmGgyUUpkkKhgtoNFxQG0gsKhRrT5KIUQaFQYe2GCwoDKZJCocI0XJAyKBRqRB2C9ELmpehj+/wEuN3dryqi0EHSfMWjwkB6KdNS9DEXAW/Lu7hBEj/ioAVcpExZl6LHzI4Dtjb2kfyoQ5AyZFqK3sz2A44HjgP+oYgC+11jMlHdgVRF1qXoPwsMA/cCewGvmdmv3V1dg0hNZVqK3t3nNR6b2YXAMwqEztodZvz8QeGvUtc1SNkyL0VfaHV9Is0kosJAqiLzUvSx/S7MqaaB0OgMGpaWVIdIM5281AOt7rSszkCqSqFQIJ2mLHWkUChAuzDQeQdSBwqFHlAYSJ0oFMap1Y1QmucORg8z9qQikXwoFHLQbsk2TSZKHWndh4xaffCnLlikIYPUljqFLjWGDY3uIL6Go4JA+oE6BRFJUKeQUnOH0KDuQPqNQmEMWp1JBo1CoYU0hxvVIUi/0pyCiCSoU+hg6ecO05oLMnDUKYhIgjoFtj+y0LgRis5BkEGkTkFEEtQpoCMLInEDHQqjw4aS6xCpkoEMhXYnJKlDEBnQUGhod8mzyCAbyFBQGIi01/eh0O5CpjgNG0S2ybwUvZn9HfCp6Omd7v7
|
||
|
"text/plain": [
|
||
|
"<Figure size 288x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"bins=100\n",
|
||
|
"density=True\n",
|
||
|
"cumulative=True\n",
|
||
|
"histtype='step'\n",
|
||
|
"lw = 2\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=figsize_gen)\n",
|
||
|
"plt.title('Narrow spiking')\n",
|
||
|
"_, bins, _ = plt.hist(\n",
|
||
|
" results.query('bs_ctrl==0')['average_firing_rate'], \n",
|
||
|
" bins=bins, density=density, cumulative=cumulative, \n",
|
||
|
" histtype=histtype, color=color_control, lw=lw, label='Control');\n",
|
||
|
"\n",
|
||
|
"_, bins, _ = plt.hist(\n",
|
||
|
" results.query('bs_stim==0')['average_firing_rate'], \n",
|
||
|
" bins=bins, density=density, cumulative=cumulative, \n",
|
||
|
" histtype=histtype, color=color_stimulated, lw=lw, label='Stimulated');\n",
|
||
|
"\n",
|
||
|
"plt.xlim(-.5, 56)\n",
|
||
|
"# plt.legend(bbox_to_anchor=(0,1.02,1,0.2), loc=\"lower left\",\n",
|
||
|
"# mode=\"expand\", borderaxespad=0, ncol=2)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"cumulative_ns.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"cumulative_ns.png\", dpi=600, bbox_inches=\"tight\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 75,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQUAAADPCAYAAAD8ksT3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAEANJREFUeJzt3XuwJHV5xvHv4boiK0rhjS0DGsITEgJELBbktqmwAiaghVpJ0AhLuCWg4JJawYKAKcQoEBIWFYVwEUUSLisQuQursNxviaybl1qCGyOFAYv7ZWHZkz+6Z7d7mDOnz+me6Z6Z51NFMTPdO+c9uzXPvP3rX/d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cCf9eD2kaS77FodSu7FP1ngVnArcCWwGuSfhER7hoK6nbY4A7B6lBqKfqIWNB6LOkU4EkHgtlgKxIKi4C56VL0Y8A8SfOB5RHhr7ICigwi+rDBmqL0UvSZ/U6pqKaR4sugrWk8o7GPOnUDDgNrGodCD01l7oEHFa0pPM3ZzHLcKfRAe4eQX5/BFzdZszkUpsnTkm1YORR6qNtpRo8hWFM5FEry/AIbNg6FKfJhgw07n30wsxx3CgV1O6MwGZ9xsEHiUJiEDxds1DgUOugWBGU6BJ9xsEHgUCjIZxlsVDgUuphuELhDsEHmsw9mluNOgfKDiROdXXCHYIPInYKZ5bhTyCg798CdgQ2DkQ4Fz0Ewe7ORDIUyYeAzCzbsRjIU2nkOgtlaIx0Knp1o9mZDHwoeNzCbmtJL0Uv6AvDn6dPrIuLLvSh0qqoKA3cINmpKLUUv6QPAp4HZJCtP3yFpUUT8Z68KnsxEYeBxA7Niyi5
|
||
|
"text/plain": [
|
||
|
"<Figure size 288x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"bins=100\n",
|
||
|
"density=True\n",
|
||
|
"cumulative=True\n",
|
||
|
"histtype='step'\n",
|
||
|
"lw = 2\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=figsize_gen)\n",
|
||
|
"plt.title('Narrow spiking')\n",
|
||
|
"_, bins, _ = plt.hist(\n",
|
||
|
" results.query('bs_ctrl==0')['average_firing_rate'], \n",
|
||
|
" bins=bins, density=density, cumulative=cumulative, \n",
|
||
|
" histtype=histtype, color=color_control, lw=lw, label='Control');\n",
|
||
|
"\n",
|
||
|
"_, bins, _ = plt.hist(\n",
|
||
|
" results.query('bs_stim==0 and frequency==30')['average_firing_rate'], \n",
|
||
|
" bins=bins, density=density, cumulative=cumulative, \n",
|
||
|
" histtype=histtype, color=color_stimulated, lw=lw, label='Stimulated');\n",
|
||
|
"\n",
|
||
|
"plt.xlim(-.5, 56)\n",
|
||
|
"# plt.legend(bbox_to_anchor=(0,1.02,1,0.2), loc=\"lower left\",\n",
|
||
|
"# mode=\"expand\", borderaxespad=0, ncol=2)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"cumulative_ns_30.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"cumulative_ns_30.png\", dpi=600, bbox_inches=\"tight\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 76,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQUAAADPCAYAAAD8ksT3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAEARJREFUeJzt3X2wXHV9x/H3JYREJKIMPpGxIFI+paVAxSFEBNIpSGKLOIjTFq0QSoCWKhQ6ERwo2EF8AGpL0KJQHkSRykMEKhBQiEIAeW5NTL9MKFIrQ4c4PBMCIbd/nLOXczZ795579+yes7uf1wzD7p7N3u9NZj/7/f3O7+xvZHR0FDOzhs2qLsDM6sWhYGY5DgUzy3EomFmOQ8HMchwKZpazedUFWJ6kHYDHgUURcXHm8b8Ddo2IIysqrWOSLgauAtYAKyNiq6bj2wHXRMQHq6jPEu4U6mkjcK6knasupEwRcXRE/KjN8ScdCNVzp1BP64DzgO9JmhsRr2YPpmHxdWArYDvgEeBPI+IVSeuB64HdgU8CK5ruvwk4B9gSeBU4DbgNeAqYGxFrJJ0C/FVEbJ/+vNuAr0XETZka3gV8G9g2feiHEXG6pCOBPyf5wJkN/Bo4IiKelLQcuAB4IPM6uwA3AScBD5N2EJLOBHY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zMBp1DoYV2QeAOwQadQ6Egh4ENi6EOhYkmGB0ENoyKfHGrmQ2RoewUvGTZbHxDEwpei2BWzNCEQitesmy2qaELhexaBK9BMNvUwIdCq2GDw8BsfAMfCkV42GD2hqEJhVZLmB0GZpsamlDwkMGsmI63opf0t8CfpXdviogvdKPQyWqEwJKK6zDrN0U6hbG
|
||
|
"text/plain": [
|
||
|
"<Figure size 288x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"bins=100\n",
|
||
|
"density=True\n",
|
||
|
"cumulative=True\n",
|
||
|
"histtype='step'\n",
|
||
|
"lw = 2\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=figsize_gen)\n",
|
||
|
"plt.title('Narrow spiking')\n",
|
||
|
"_, bins, _ = plt.hist(\n",
|
||
|
" results.query('bs_ctrl==0')['average_firing_rate'], \n",
|
||
|
" bins=bins, density=density, cumulative=cumulative, \n",
|
||
|
" histtype=histtype, color=color_control, lw=lw, label='Control');\n",
|
||
|
"\n",
|
||
|
"_, bins, _ = plt.hist(\n",
|
||
|
" results.query('bs_stim==0 and frequency==11')['average_firing_rate'], \n",
|
||
|
" bins=bins, density=density, cumulative=cumulative, \n",
|
||
|
" histtype=histtype, color=color_stimulated, lw=lw, label='Stimulated');\n",
|
||
|
"\n",
|
||
|
"plt.xlim(-.5, 56)\n",
|
||
|
"# plt.legend(bbox_to_anchor=(0,1.02,1,0.2), loc=\"lower left\",\n",
|
||
|
"# mode=\"expand\", borderaxespad=0, ncol=2)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"cumulative_ns_11.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"cumulative_ns_11.png\", dpi=600, bbox_inches=\"tight\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type":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92EOsDtAi6Xo5wKbmNk6ZrYysBWwMPNWikjPZLEU/fHArHDba919fk5tLQV1G6TfZbEU/dXA1Rm3q1LUbZB+okunRSRGMxq70I1WpW4UCimo2yD9SKGQkG60KnWhUGijXbehVXWgboP0Ew00ikiMKoUu2nUbVB1Iv1IoNBlKt0GkH6n7ICIxqhTofI8E3VtR6kaVgojEqFKIiA4qqkKQuqp1KAxlCrNIXdQ6FJJQhSB1o1Cgc7dBpG400CgiMbWsFJKMJajbIHWlSkFEYmpZKTS0m6AkUme1CgWdghTprlah0I3GEURqGgrqNoi01/ehoC6DyNCkXoo+ss1twM3ufnEeDc2SrmsQaS/VUvQRpwFrZ924NJorhPisxbN73RyRykgSCrGl6M0suhQ9ZrY3sKKxTZmpQhDpLtVS9Ga2CTAZ2Bv4SR4NHKpOFYKIdJd2KfoDgDHA3cAGwLtm9k93L3XVoApBpL0koTAH2AO4tnkpenef1vjZzE4F/l2WQNBpR5HhSb0Ufa6tGwKdehTJRuql6CPbnZpRm3KhLoNIMn03eUndBpF0dOm0iMT0XaXQTN0GkaGpfChogFEkW+o+iEhM5SuFBg0wimRDlYKIxFSyUtDdmEXyo0pBRGIqWSk0aGUnkeypUhCRmEpXCqAbp4hkrVKhoIlKIvmrVCh0ogpBJBuVDAXdYk0kP5UMBZ1pEMmPzj6ISEwlKoV2A4waRxDJnioFEYmpRKXQcOHjWtlJJG+qFEQkptSVgsYSRHpPlYKIxKReit7Mjgb2Cx/e7u4/zbqRH95VSWMKInlLUil8sBQ98GOCpegBMLPPAt8BtgG2AnY2s03zaKiI9EbapeifA3Z19/cBzGwksCzrRmoGo0jvpFqK3t3fA5aa2QBwDvCEuz+dpkG6ElKkWGmXosfMRgE
|
||
|
"text/plain": [
|
||
|
"<Figure size 288x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"bins = 100\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=figsize_gen)\n",
|
||
|
"plt.title('Broad spiking')\n",
|
||
|
"_, bins, _ = plt.hist(\n",
|
||
|
" results.query('bs_ctrl==1')['average_firing_rate'], \n",
|
||
|
" bins=bins, density=density, cumulative=cumulative, \n",
|
||
|
" histtype=histtype, color=color_control, lw=lw);\n",
|
||
|
"\n",
|
||
|
"_, bins, _ = plt.hist(\n",
|
||
|
" results.query('bs_stim==1')['average_firing_rate'], \n",
|
||
|
" bins=bins, density=density, cumulative=cumulative, \n",
|
||
|
" histtype=histtype, color=color_stimulated, lw=lw);\n",
|
||
|
"\n",
|
||
|
"plt.xlim(-.5, 44)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"cumulative_bs.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"cumulative_bs.png\", dpi=600, bbox_inches=\"tight\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 80,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQUAAADPCAYAAAD8ksT3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAADwxJREFUeJzt3X+wXGV9x/H3DSCxEFEL2jZjBYt8y5QBWixBiRBmggIVtZRRSy0mVqhTKSrOxIJStUUZBWotacVCI9SB8hvEigVTKkLAkV+xENIvAzMyjL8KVH7Jz5DbP85Z2LPu3bs3+/Pcfb9mGLK75+4+J7Cf+32e85znmZqenkaSGhaMugGSxouhIKnCUJBUYShIqjAUJFUYCpIqth51AzSziNgZuA+4s3xqK+BJ4ITMXDegz9wReDAzp/rwXm8H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kEV2GWtkzPW9EPtHVzYLdB6o+et6JvOu7TfWpTX9ltkOZm3s1oXHvc0raLpkjqzrwLBUm9mXfTnF0wRepN7UPBAUapv2ofCjNxgFHaMvNmTMEBRqk/5k0oSOqPWnYf3NlJGhwrBUkVtawUGoo1EqoVggOMUm+sFCRV1LpSaGaFIPVHrULBiUrS4NUqFBpcYk0aHMcUJFXUqlJw3wZp8KwUJFXUolJoDDCeWT62QpAGx0pBUoWhIKnCUJBUMdZjCk5WkoZvrEOhwY1dpOHpeSv6iPgo8J7y4dWZ+ZlBNFTScHQzpvDCVvTAX1FsRQ9ARLwO+BPgTcB+wFsiYs9BNBSKS5FejpQGq5tQqGxFDzRvRf8AcEhmPp+Z08A2wNN9b6W
|
||
|
"text/plain": [
|
||
|
"<Figure size 288x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"bins = 100\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=figsize_gen)\n",
|
||
|
"plt.title('Broad spiking')\n",
|
||
|
"_, bins, _ = plt.hist(\n",
|
||
|
" results.query('bs_ctrl==1')['average_firing_rate'], \n",
|
||
|
" bins=bins, density=density, cumulative=cumulative, \n",
|
||
|
" histtype=histtype, color=color_control, lw=lw);\n",
|
||
|
"\n",
|
||
|
"_, bins, _ = plt.hist(\n",
|
||
|
" results.query('bs_stim==1 and frequency==11')['average_firing_rate'], \n",
|
||
|
" bins=bins, density=density, cumulative=cumulative, \n",
|
||
|
" histtype=histtype, color=color_stimulated, lw=lw);\n",
|
||
|
"\n",
|
||
|
"plt.xlim(-.5, 44)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"cumulative_bs_11.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"cumulative_bs_11.png\", dpi=600, bbox_inches=\"tight\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 79,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQUAAADPCAYAAAD8ksT3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAADwlJREFUeJzt3XnMHHUdx/H3UygUoaAIeDSEw8JXIqEoSIEWKEk5FVAkgFWhoFSiyJkUuQQUaOQQsVVRagENyFkuQQsVuVoMZ5GW+iUlgRAObZFyFyh9/GNm25nt7j6zz8zszOx+Xgnh2d3p7m8K+3m+853fzK+vv78fEZGaIUUPQETKRaEgIjEKBRGJUSiISIxCQURiFAoiErNm0QOQ5sxsc+A54OnwqTWAd4GT3X1OTp+5EbDY3fsyeK8DgfHufryZ3QdMc/eb6raZDlzn7rPTfp5kQ6FQfu+5+/a1B2Z2KHAVsFVhI0rI3W8Hbh9gm+91aDiSkEKhej4JvAJgZuOAy4B3gHWBnYAjgeOBj4D/AMe5+7NmtjXwa2A94LPAPOAwd19mZgcD5xNUIY82+2AzOxf4OvAB8Bow0d1fMbPlwC+BPcNxnO7uM81sInCIu3818h5rAtcCH4ZjnQ1MAx4D/g7cBYwGNgTOcPfrzexjwOXAzsBS4BkAd584qL9BaUk9hfJbx8zmhf+8QBACUyKvbwt8091HAWOAycCe4eNrgVvNrA84Brja3XcBRgJbAF8xs08BM4BvuPsOwAuNBmFmmwInAl929x2Buwm+vBAc1vwv/POHAjPMbOMGb7MWcCPwX+Db7r687vUtgVnuvhNwKnBh+PxZBL/APg+MB77Y+q9M0lAolN977r59+M9mwDjgOjPbInz9RXevfZH3Ba5398UA7n4VMALYnOBLttjMJgO/JagW1gPGAk+7+zPhe/yuyTheAp4Cn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_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"bins = 100\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=figsize_gen)\n",
|
||
|
"plt.title('Broad spiking')\n",
|
||
|
"_, bins, _ = plt.hist(\n",
|
||
|
" results.query('bs_ctrl==1')['average_firing_rate'], \n",
|
||
|
" bins=bins, density=density, cumulative=cumulative, \n",
|
||
|
" histtype=histtype, color=color_control, lw=lw);\n",
|
||
|
"\n",
|
||
|
"_, bins, _ = plt.hist(\n",
|
||
|
" results.query('bs_stim==1 and frequency==30')['average_firing_rate'], \n",
|
||
|
" bins=bins, density=density, cumulative=cumulative, \n",
|
||
|
" histtype=histtype, color=color_stimulated, lw=lw);\n",
|
||
|
"\n",
|
||
|
"plt.xlim(-.5, 44)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"cumulative_bs_30.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"cumulative_bs_30.png\", dpi=600, bbox_inches=\"tight\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 73,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"U-test: U value 104995.0 p value 0.047251399227811186\n",
|
||
|
"U-test: U value 13472.0 p value 0.6449484150738996\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAIgAAADPCAYAAAAu55mGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAFwhJREFUeJztnXmUHVWdxz9V7/XrJQmIrMZh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yB+K5KlYvJiMp5HMu2RznhERtnjjJfoAc/DS/aFbcrYHShriyfpS2Voi4f/qDhU0ok44IxeH2Q0sLktTiKVprEz/JM8VDI93eBagZSVVU3dAGxsDf9RcaikuzpxIlFS7eE/CI5JgWQ8j3U7uqmrirByW2fY5gyZVHsLbixGqqUpbFPGpkC2d/aSznjUVkVoaOoK25whkUkmSXd34cSq6WvcGrY5Y1MgG1rNEHXUdehIJOnqTYVsUeEkt2/FiURxqmIkd2zHS4XrZI9RgcRJZTwcxyHqumxpD9/ZK5T4+jV46RSO4+BEovRu3hCqPWNSIOuau6nyxz7SnsfWjtEjkO63FoMbAcBLJenW5aHaMyYFsrEtTjRiDi2T8djQEv5b0UJId3cRX7cat7oGACdWQ+eiBXghjgiPOYHEk2lae/p2tiCxiEvD9tHhqHa+8Rp43s4gIaeqilRnG4l1q0KzacwJZF1zNxHX3RkLEou6bGjtoS9d2ZM+Z5J9tMx9GicW27nMcRzIeLQ8Nzs0u8acQN7Y2EYqs0sMruOAA9pY2eMh7QteJNPTg1sVe89yt24c8TUNxNdoKHa
|
||
|
"text/plain": [
|
||
|
"<Figure size 122.4x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAIIAAADPCAYAAAA5xQlPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAH7pJREFUeJztnXuUHNV95z+3qrun56UXAj0QSOJ1scTbOAYTA94Nj/i9ON61WdbYWsDkJCc4ttchOfgsWcd7NsGO40dsxzhemziE2AayxmCMwQgsHhIgDS9JV29ppNFII6nnPf2oqrt/VLXUGk1PV1dX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jU19gVvmpW7srGaFwWmvGN7+OyLRVP8jRTOzcGl2lPGaEEHr2DuI4etrZxGqkDcGT6mAi3NesI4ewx0YRqWkEbQjG3lgfXaXKl438igF4cstA7YOq0JYyODhaSMQi1PiWN0HrKfsHZYxMloltm9FWtKOdxAshN15k84ER2tPBlmeFEDha8+z2+DuNo6++BDU6u8I0AU1+9/ZoKuWReCGs3ZVDa3+TSNVoT5k8s/UQll01XXTTsSfGmdi5DaMtW/NYx7IZfT3a5iHRQtBa8+vNB6Z0Uq2HtGlQsBw29o+EVLP6mdiy0R02+hj+mtksIxvWoZ3ohJtoIezJTTAwVqQtBE8jR8PTW4P3NRpl+KU1vndpFKk0TiFPfs+O5laqgkQL4fkdh3FqdK780pE2Wd87yEQx+vwJ9tgo41s3YWTb6zjJZuTl55tXqUkkVgiO1jyz/RDtqXB8+ExDoIENe6Ofch597RV3tFDPrGh7OyM
|
||
|
"text/plain": [
|
||
|
"<Figure size 122.4x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure(figsize=figsize_violin)\n",
|
||
|
"# test = 'permutation_resampling'\n",
|
||
|
"test = 'mann_whitney'\n",
|
||
|
"\n",
|
||
|
"plt.title('Broad spiking')\n",
|
||
|
"violinplot(\n",
|
||
|
" results.query('bs_ctrl==1')['average_firing_rate'].to_numpy(), \n",
|
||
|
" results.query('bs_stim==1')['average_firing_rate'].to_numpy(), \n",
|
||
|
" test=test)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"rates_bs.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"rates_bs.png\", dpi=600, bbox_inches=\"tight\")\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=figsize_violin)\n",
|
||
|
"plt.title('Narrow spiking')\n",
|
||
|
"violinplot(\n",
|
||
|
" results.query('bs_ctrl==0')['average_firing_rate'].to_numpy(), \n",
|
||
|
" results.query('bs_stim==0')['average_firing_rate'].to_numpy(), \n",
|
||
|
" test=test)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"rates_ns.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"rates_ns.png\", dpi=600, bbox_inches=\"tight\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 81,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"U-test: U value 63173.0 p value 0.3220377333457417\n",
|
||
|
"U-test: U value 8043.0 p value 0.32905688838219194\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAIIAAADPCAYAAAA5xQlPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAG5JJREFUeJztnXu0JVV95z+76pxzb3eD2Ao0IPJQZBOMaRifBBVYE0WdiAnJQobFIHSUOCuOaMwYx8csHeNyKTGOkcREHAbN2IMYiEsHfMAY1KERaKDtbrr7d/v9uN193/eee951qvb8UXW6T9++j/OoOlXnUp+1evW991Tt+p2qb/32b79+WxljSEmx4jYgJRmkQkgBUiGkBKRCSAFSIaQEpEJIASATtwHzobW+ANgNbAn+ZAMl4M9F5PGIrnk6MCYiKoSyrgN+T0Q+rLV+DLhLRP55zjHfAu4TkUe7vV4YJFIIAWURuazxi9b6BuBe4FWxWdQiIvJD4IdLHPP+HpnTEkkWwlxeChwB0FpfDXwNKAKrgDcA7wM+DLjACPAhERnSWl8M/B1wCnAOsAl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T3DPXOqIC+FcLwTJmsfbJ79YzhaELjBGd8BK9aRWUWGeKxbIrbftM7oxqX7fkVQyBfcag4HvY89azrGfZPxjsRdCHKe3bCEvW/lRugsneo50vl+1IIw9MVMpaaN+DK2hY7R+Od/7cQpe2bl0ylp2wbDFQPH+yRVT59KYT9k0WcBd6snG2xf6qcuETdx/oPBk7uPzjpWLdOZd+uHlh1nL4UwraRWewFchPalsJxPcYS1ox0xkbwnCr
|
||
|
"text/plain": [
|
||
|
"<Figure size 122.4x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAIIAAADPCAYAAAA5xQlPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAH8dJREFUeJztnXuUHFd95z+3ql8zoxnJsowsYdmyZPtiG2PZITHGAZtNbBwIjxjYgEN4aME4h5yYAEtIjjnrLMueJDZhEwgQYDlAiMMCxiS8jAEjG78k29IYy5au9X7PaGY0z55+VdXdP261NW5NT1dXV3fVOP05R0c93V23f9X9rXtv3d/jCq01XbpYcRvQJRl0hdAF6Aqhi09XCF2ArhC6+HSF0AWAVNwGAEgp1wL7gPcrpb4y5/mPAi9VSr0nJtNaRkr5FeBbwG5gu1JqSc3rq4HvKqVeGYd9VZLUI3jAHVLKC+I2JEqUUu9TSv18gdePxi0CSEiP4FMAPg38m5TySqVUee6LvkD+CVgCrAYGgT9UShWllCXg34FLgT8CHqr5uwe4HegFysCtwM+AIeBKpdRuKeXHgT9RSp3jf97PgM8opX48x4YzgW8AK/ynfqSU+oSU8j3AOzAX1ouBI8C7lVJHpZSbgM8Bj89p50Lgx8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HXj62oQto12XYoH9rTZqpMkWggP7x3D0zrQVdSI3rTN1kMTFMqdr5/gFmYp7NuFlc01cZDL9JOPtc+oGhIrBE9r7t8zSk8qGt+8bQk0sO1w55ec8zt+DTCvf6EeVq6HmW1
|
||
|
"text/plain": [
|
||
|
"<Figure size 122.4x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure(figsize=figsize_violin)\n",
|
||
|
"# test = 'permutation_resampling'\n",
|
||
|
"test = 'mann_whitney'\n",
|
||
|
"\n",
|
||
|
"plt.title('Broad spiking')\n",
|
||
|
"violinplot(\n",
|
||
|
" results.query('bs_ctrl==1')['average_firing_rate'].to_numpy(), \n",
|
||
|
" results.query('bs_stim==1 and frequency==11')['average_firing_rate'].to_numpy(), \n",
|
||
|
" test=test)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"rates_bs_11.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"rates_bs_11.png\", dpi=600, bbox_inches=\"tight\")\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=figsize_violin)\n",
|
||
|
"plt.title('Narrow spiking')\n",
|
||
|
"violinplot(\n",
|
||
|
" results.query('bs_ctrl==0')['average_firing_rate'].to_numpy(), \n",
|
||
|
" results.query('bs_stim==0 and frequency==11')['average_firing_rate'].to_numpy(), \n",
|
||
|
" test=test)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"rates_ns_11.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"rates_ns_11.png\", dpi=600, bbox_inches=\"tight\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 82,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"U-test: U value 41822.0 p value 0.016842133424593897\n",
|
||
|
"U-test: U value 5429.0 p value 0.7318233387867226\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAIgAAADPCAYAAAAu55mGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAF0hJREFUeJztnXd0XNWdxz/vTVGxDUkooQQDgfAjQCiBTWgL5ixtCSUhBdaHdSjBSU6yAdKXJCeksNmlhCX0QFgDiWOKITEQMKHYFNOMkYNj6yc3JFd1q89oyts/7hsjZOlpNJrRGyn3c46OpHnv3ft7M9/3u2V+v3sdz/OwWIbDDdsAS3ljBWIJxArEEogViCUQKxBLIFYglkCiYRuQLyKyH7AWeMd/KQL0At9W1VdKVOeuQLOqOkUo61zgVFX9logsAm5V1UcGnXMPME9Vnx1rfcViwgjEp09Vj8z9IyJfAuYAHwvNojxR1QXAghHO+co4mZM3E00gg9kF2AIgIjOAm4EeYArwKeDLwLeADNAIfFNV60TkIOA2YCqwF1ADXKCqCRE5H7gW453eHK5iEfkZ8DmgH2gFLlbVLSKSBv4XOMW342pVfVRELga+oKpnDygjCswFUr6tzwK3AkuB54C/AJ8GPgT8SFUfFJFq4E7gWGAbsBJAVS8u6B0cgYnWB6kSkRr/px4jiF8NOH4Y8G+qegRwAvB94BT//7nAn0TEAS4H7lPV44ADgf2Bz4jIh4F7gc+r6tFA/VBGiMg+wJXAP6nqMcAzmA8STNPX5l//JeBeEdltiGLiwMNAE3CRqqYHHf8osFBVPwX8ALjOf/0nmAf7YOBU4Kjgt2xsTDSB9Knqkf7PvsAMYJ6I7O8f36CquQ/1TOBBVW0GUNU5wN7Afpg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co9qfEJGTgDd4b/uP9di0h0lHwcNcVf3+EC/btIdJhp0oswRiBWIJxArEEogViCUQKxBLIFYglkCsQCyBWIFYArECKVc8b+RzxgErEEsgViCWQKxALIFYgZQpnu2DWCYCk1Yg9W29zP7jsrDNKByvPBICJq1AupNpMmXipgsiWx62FxwwBCAiuwNvAadRhtuBODhhVl8wXjZjfjIZnEgkVFsK9iD+njF3AX3+S2WXF+NOTH3g9Sfxslmy/cmwTRlTE3MDcCew2f+/7PJiHGdiKiST6INMmmyib+STS0yhmXUXA82qunDAy0655cVMTHlAtrcXL50m29sTtikF90EuBTwRORU4Ergf2H3AcZsXMwYy3Z14qRSZnq6wTSnMg6jqSap6sqrOAGqAWcBT5ZYXUx7jgNGTam3By2ZId3aMfHKJGdMoZhDfoczyYrITdJibam0CN0K6oz1sU8YuEN+L5CibvJis55HKeGSyHpEJNpxJtTXjxivob9wStimTd6JsW1+K/nSWbX2psE0ZFV42S3pbO25FBakmK5CSsWlbH4l0hsauRNimjIpcs+LE4vQ3N4b+pd2kFcjqZjNE3NAe/lzCaEg1bcFxXXBdvFQ/me5wRzKTUiBZz2N9aw/VsQi1W8MfKo6G5KYGvHQax3FwIhH6t2wM1Z5JKZCmriSZrEdVLEJdc3fY5oyK3rqVOFEzdvDSKRL1a0O1Z1IKpKG9F4Co69CZSNGdTIdsUX546TSJ+rU48QrA9EN6VtaEatMkFUgf6ayH4zhEXZfNHROjo5poWIfneaYPAjjxCpKbNpAJccp9UgpkfUsPMX/uI+N5bOmcGALpXv4mXuY9b+c4DjgOPbXvhGbTpBTIhm19RCPm1rJZj4a23pAtGhkvnaLrrdeIVFa//4Dj0PnqolBsgkkokL5Uhvbe/u0eJB5xqWsq/45q1zvLyKb6t3dQc7iVVSQa1tHfuHmYK0vLpBPI+pYeIq6
|
||
|
"text/plain": [
|
||
|
"<Figure size 122.4x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
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kkhtEL00YIlq3Z9M4x2jx0C+AEsxoCth9IugcvTBsh7OoZoVC2SU2y0FQNATy3pzc8o04hpo0QXtjTV/O2cSLZtIk6MsJgLukeajEtMp1Kls3GrmO0Zbx1CxUMIRDAln39/JqMfnJp+NWtHP3nv6fWxivpWXNYfPd9iFS6OYYxTTzCjkNDlG2bVJX1hakwDcEvVE8IVtXPwLPr0FYZkUpP+a/Ye5TcHtVU26aFEH6pevAbhphNGRwczNEdcVBreWiAwoEujGwrwjCm/IdtMbRlQ1Pti70QhvIlXu0erLtbqCCEQGvNCxEPGkde3QKaqnEU4zGybYzu2IZdaF6ORuyF8NJep6B3I2sGLSmTZ3b1YEcU3ay1ZnDjs4iUtyGZME20bTP65qshW/YusRfCujeP1lxbqEXGNBgrWrx5ZDggq+qjePggpd6jiEyL94OEYHDDM+EZNYFYC6F7MM+hoTzZKWIPvGJpzbO7oukehja/AFp76hYqGNlW8u/sptTfF6Jl476vKd/ikw1dvdh1/oDVaE+n2Ly3v+n1E+xSiaGXXsBoydZ1nBACtGbopRdDsuxEYisErTXP7uoja/obJE7ENAS21rx6cKj2hwNkdMc2dKnkeXwwHpHJMvji02grfPHGVgh7jzkLRulJklj8ojU83+S7h4Hn1jm3hD4w0mnsfI4xFeh+4JPiNcFlPrAVZyf1MnXs3uKXl/b1YwXULVRoTZu82j1IsWyTCWDcUYvCoQMUuvdhtLY31E7/s+toPy/c7YO87OCSxslsqoQFN2X3lg1dx2gJqFuoUIlj2Nmku4fBF59G242J2WhtI9+1i2LP4QAtm+R7PHzmQZxNubvd56Hv3tI7UqB3pEgmwG6hQtnSbN0X/mZjVm6
|
||
|
"text/plain": [
|
||
|
"<Figure size 122.4x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure(figsize=figsize_violin)\n",
|
||
|
"# test = 'permutation_resampling'\n",
|
||
|
"test = 'mann_whitney'\n",
|
||
|
"\n",
|
||
|
"plt.title('Broad spiking')\n",
|
||
|
"violinplot(\n",
|
||
|
" results.query('bs_ctrl==1')['average_firing_rate'].to_numpy(), \n",
|
||
|
" results.query('bs_stim==1 and frequency==30')['average_firing_rate'].to_numpy(), \n",
|
||
|
" test=test)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"rates_bs.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"rates_bs.png\", dpi=600, bbox_inches=\"tight\")\n",
|
||
|
"\n",
|
||
|
"plt.figure(figsize=figsize_violin)\n",
|
||
|
"plt.title('Narrow spiking')\n",
|
||
|
"violinplot(\n",
|
||
|
" results.query('bs_ctrl==0')['average_firing_rate'].to_numpy(), \n",
|
||
|
" results.query('bs_stim==0 and frequency==30')['average_firing_rate'].to_numpy(), \n",
|
||
|
" test=test)\n",
|
||
|
"\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"rates_ns_30.svg\", bbox_inches=\"tight\")\n",
|
||
|
"plt.savefig(output_path / \"figures\" / \"rates_ns_30.png\", dpi=600, bbox_inches=\"tight\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 101,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"columns = [\n",
|
||
|
" 'average_firing_rate',\n",
|
||
|
" 'half_width',\n",
|
||
|
" 'peak_to_trough'\n",
|
||
|
"]\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def summarize(data):\n",
|
||
|
" return \"{:.2f} ± {:.2f} ({})\".format(data.mean(), data.sem(), sum(~np.isnan(data)))\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"bs = pd.DataFrame()\n",
|
||
|
"\n",
|
||
|
"bs['Control'] = results.query('bs_ctrl==1')[columns].agg(summarize)\n",
|
||
|
"bs['Stimulated'] = results.query('bs_stim==1')[columns].agg(summarize)\n",
|
||
|
"\n",
|
||
|
"ns = pd.DataFrame()\n",
|
||
|
"\n",
|
||
|
"ns['Control'] = results.query('bs_ctrl==0')[columns].agg(summarize)\n",
|
||
|
"ns['Stimulated'] = results.query('bs_stim==0')[columns].agg(summarize)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def MWU(column, df, cluster, extra):\n",
|
||
|
" '''\n",
|
||
|
" Mann Whitney U\n",
|
||
|
" '''\n",
|
||
|
" Uvalue, pvalue = scipy.stats.mannwhitneyu(\n",
|
||
|
" df.query('bs_ctrl=={} {}'.format(cluster, extra))[column].dropna(), \n",
|
||
|
" df.query('bs_stim=={} {}'.format(cluster, extra))[column].dropna(),\n",
|
||
|
" alternative='two-sided')\n",
|
||
|
"\n",
|
||
|
" return \"{:.2f}, {:.3f}\".format(Uvalue, pvalue)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def PRS(column, df, cluster, extra):\n",
|
||
|
" '''\n",
|
||
|
" Permutation ReSampling\n",
|
||
|
" '''\n",
|
||
|
" pvalue, observed_diff, diffs = permutation_resampling(\n",
|
||
|
" df.query('bs_ctrl=={} {}'.format(cluster, extra))[column].dropna(), \n",
|
||
|
" df.query('bs_stim=={} {}'.format(cluster, extra))[column].dropna())\n",
|
||
|
"\n",
|
||
|
" return \"{:.2f}, {:.3f}\".format(observed_diff, pvalue)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"bs['MWU'] = list(map(lambda x: MWU(x, results, 1, ''), columns))\n",
|
||
|
"bs['PRS'] = list(map(lambda x: PRS(x, results, 1, ''), columns))\n",
|
||
|
"\n",
|
||
|
"ns['MWU'] = list(map(lambda x: MWU(x, results, 0, ''), columns))\n",
|
||
|
"ns['PRS'] = list(map(lambda x: PRS(x, results, 0, ''), columns))\n",
|
||
|
"\n",
|
||
|
"bs.to_latex(output_path / \"statistics\" / \"broad_spiking.tex\")\n",
|
||
|
"bs.to_csv(output_path / \"statistics\" / \"broad_spiking.csv\")\n",
|
||
|
"\n",
|
||
|
"ns.to_latex(output_path / \"statistics\" / \"narrow_spiking.tex\")\n",
|
||
|
"ns.to_csv(output_path / \"statistics\" / \"narrow_spiking.csv\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 99,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"columns = [\n",
|
||
|
" 'average_firing_rate',\n",
|
||
|
" 'half_width',\n",
|
||
|
" 'peak_to_trough'\n",
|
||
|
"]\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def summarize(data):\n",
|
||
|
" return \"{:.2f} ± {:.2f} ({})\".format(data.mean(), data.sem(), sum(~np.isnan(data)))\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"bs = pd.DataFrame()\n",
|
||
|
"\n",
|
||
|
"bs['Control'] = results.query('bs_ctrl==1')[columns].agg(summarize)\n",
|
||
|
"bs['Stimulated'] = results.query('bs_stim==1 and frequency==11')[columns].agg(summarize)\n",
|
||
|
"\n",
|
||
|
"ns = pd.DataFrame()\n",
|
||
|
"\n",
|
||
|
"ns['Control'] = results.query('bs_ctrl==0')[columns].agg(summarize)\n",
|
||
|
"ns['Stimulated'] = results.query('bs_stim==0 and frequency==11')[columns].agg(summarize)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def MWU(column, df, cluster, extra):\n",
|
||
|
" '''\n",
|
||
|
" Mann Whitney U\n",
|
||
|
" '''\n",
|
||
|
" Uvalue, pvalue = scipy.stats.mannwhitneyu(\n",
|
||
|
" df.query('bs_ctrl=={} {}'.format(cluster, extra))[column].dropna(), \n",
|
||
|
" df.query('bs_stim=={} {} and frequency==11'.format(cluster, extra))[column].dropna(),\n",
|
||
|
" alternative='two-sided')\n",
|
||
|
"\n",
|
||
|
" return \"{:.2f}, {:.3f}\".format(Uvalue, pvalue)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def PRS(column, df, cluster, extra):\n",
|
||
|
" '''\n",
|
||
|
" Permutation ReSampling\n",
|
||
|
" '''\n",
|
||
|
" pvalue, observed_diff, diffs = permutation_resampling(\n",
|
||
|
" df.query('bs_ctrl=={} {}'.format(cluster, extra))[column].dropna(), \n",
|
||
|
" df.query('bs_stim=={} {} and frequency==11'.format(cluster, extra))[column].dropna())\n",
|
||
|
"\n",
|
||
|
" return \"{:.2f}, {:.3f}\".format(observed_diff, pvalue)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"bs['MWU'] = list(map(lambda x: MWU(x, results, 1, ''), columns))\n",
|
||
|
"bs['PRS'] = list(map(lambda x: PRS(x, results, 1, ''), columns))\n",
|
||
|
"\n",
|
||
|
"ns['MWU'] = list(map(lambda x: MWU(x, results, 0, ''), columns))\n",
|
||
|
"ns['PRS'] = list(map(lambda x: PRS(x, results, 0, ''), columns))\n",
|
||
|
"\n",
|
||
|
"bs.to_latex(output_path / \"statistics\" / \"broad_spiking_11.tex\")\n",
|
||
|
"bs.to_csv(output_path / \"statistics\" / \"broad_spiking_11.csv\")\n",
|
||
|
"\n",
|
||
|
"ns.to_latex(output_path / \"statistics\" / \"narrow_spiking_11.tex\")\n",
|
||
|
"ns.to_csv(output_path / \"statistics\" / \"narrow_spiking_11.csv\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 100,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"columns = [\n",
|
||
|
" 'average_firing_rate',\n",
|
||
|
" 'half_width',\n",
|
||
|
" 'peak_to_trough'\n",
|
||
|
"]\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def summarize(data):\n",
|
||
|
" return \"{:.2f} ± {:.2f} ({})\".format(data.mean(), data.sem(), sum(~np.isnan(data)))\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"bs = pd.DataFrame()\n",
|
||
|
"\n",
|
||
|
"bs['Control'] = results.query('bs_ctrl==1')[columns].agg(summarize)\n",
|
||
|
"bs['Stimulated'] = results.query('bs_stim==1 and frequency==30')[columns].agg(summarize)\n",
|
||
|
"\n",
|
||
|
"ns = pd.DataFrame()\n",
|
||
|
"\n",
|
||
|
"ns['Control'] = results.query('bs_ctrl==0')[columns].agg(summarize)\n",
|
||
|
"ns['Stimulated'] = results.query('bs_stim==0 and frequency==30')[columns].agg(summarize)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def MWU(column, df, cluster, extra):\n",
|
||
|
" '''\n",
|
||
|
" Mann Whitney U\n",
|
||
|
" '''\n",
|
||
|
" Uvalue, pvalue = scipy.stats.mannwhitneyu(\n",
|
||
|
" df.query('bs_ctrl=={} {}'.format(cluster, extra))[column].dropna(), \n",
|
||
|
" df.query('bs_stim=={} {} and frequency==30'.format(cluster, extra))[column].dropna(),\n",
|
||
|
" alternative='two-sided')\n",
|
||
|
"\n",
|
||
|
" return \"{:.2f}, {:.3f}\".format(Uvalue, pvalue)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"def PRS(column, df, cluster, extra):\n",
|
||
|
" '''\n",
|
||
|
" Permutation ReSampling\n",
|
||
|
" '''\n",
|
||
|
" pvalue, observed_diff, diffs = permutation_resampling(\n",
|
||
|
" df.query('bs_ctrl=={} {}'.format(cluster, extra))[column].dropna(), \n",
|
||
|
" df.query('bs_stim=={} {} and frequency==30'.format(cluster, extra))[column].dropna())\n",
|
||
|
"\n",
|
||
|
" return \"{:.2f}, {:.3f}\".format(observed_diff, pvalue)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"bs['MWU'] = list(map(lambda x: MWU(x, results, 1, ''), columns))\n",
|
||
|
"bs['PRS'] = list(map(lambda x: PRS(x, results, 1, ''), columns))\n",
|
||
|
"\n",
|
||
|
"ns['MWU'] = list(map(lambda x: MWU(x, results, 0, ''), columns))\n",
|
||
|
"ns['PRS'] = list(map(lambda x: PRS(x, results, 0, ''), columns))\n",
|
||
|
"\n",
|
||
|
"bs.to_latex(output_path / \"statistics\" / \"broad_spiking_30.tex\")\n",
|
||
|
"bs.to_csv(output_path / \"statistics\" / \"broad_spiking_30.csv\")\n",
|
||
|
"\n",
|
||
|
"ns.to_latex(output_path / \"statistics\" / \"narrow_spiking_30.tex\")\n",
|
||
|
"ns.to_csv(output_path / \"statistics\" / \"narrow_spiking_30.csv\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 97,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<div>\n",
|
||
|
"<style scoped>\n",
|
||
|
" .dataframe tbody tr th:only-of-type {\n",
|
||
|
" vertical-align: middle;\n",
|
||
|
" }\n",
|
||
|
"\n",
|
||
|
" .dataframe tbody tr th {\n",
|
||
|
" vertical-align: top;\n",
|
||
|
" }\n",
|
||
|
"\n",
|
||
|
" .dataframe thead th {\n",
|
||
|
" text-align: right;\n",
|
||
|
" }\n",
|
||
|
"</style>\n",
|
||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
||
|
" <thead>\n",
|
||
|
" <tr style=\"text-align: right;\">\n",
|
||
|
" <th></th>\n",
|
||
|
" <th>Control</th>\n",
|
||
|
" <th>Stimulated</th>\n",
|
||
|
" <th>MWU</th>\n",
|
||
|
" <th>PRS</th>\n",
|
||
|
" </tr>\n",
|
||
|
" </thead>\n",
|
||
|
" <tbody>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>average_firing_rate</th>\n",
|
||
|
" <td>9.53 ± 0.37 (491)</td>\n",
|
||
|
" <td>10.62 ± 0.44 (462)</td>\n",
|
||
|
" <td>104995.00, 0.047</td>\n",
|
||
|
" <td>1.09, 0.058</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>half_width</th>\n",
|
||
|
" <td>0.30 ± 0.00 (491)</td>\n",
|
||
|
" <td>0.30 ± 0.00 (462)</td>\n",
|
||
|
" <td>116089.00, 0.530</td>\n",
|
||
|
" <td>0.00, 0.420</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>peak_to_trough</th>\n",
|
||
|
" <td>0.66 ± 0.00 (491)</td>\n",
|
||
|
" <td>0.67 ± 0.01 (462)</td>\n",
|
||
|
" <td>116944.00, 0.407</td>\n",
|
||
|
" <td>0.00, 0.522</td>\n",
|
||
|
" </tr>\n",
|
||
|
" </tbody>\n",
|
||
|
"</table>\n",
|
||
|
"</div>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
" Control Stimulated MWU \\\n",
|
||
|
"average_firing_rate 9.53 ± 0.37 (491) 10.62 ± 0.44 (462) 104995.00, 0.047 \n",
|
||
|
"half_width 0.30 ± 0.00 (491) 0.30 ± 0.00 (462) 116089.00, 0.530 \n",
|
||
|
"peak_to_trough 0.66 ± 0.00 (491) 0.67 ± 0.01 (462) 116944.00, 0.407 \n",
|
||
|
"\n",
|
||
|
" PRS \n",
|
||
|
"average_firing_rate 1.09, 0.058 \n",
|
||
|
"half_width 0.00, 0.420 \n",
|
||
|
"peak_to_trough 0.00, 0.522 "
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 97,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"bs"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 98,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<div>\n",
|
||
|
"<style scoped>\n",
|
||
|
" .dataframe tbody tr th:only-of-type {\n",
|
||
|
" vertical-align: middle;\n",
|
||
|
" }\n",
|
||
|
"\n",
|
||
|
" .dataframe tbody tr th {\n",
|
||
|
" vertical-align: top;\n",
|
||
|
" }\n",
|
||
|
"\n",
|
||
|
" .dataframe thead th {\n",
|
||
|
" text-align: right;\n",
|
||
|
" }\n",
|
||
|
"</style>\n",
|
||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
||
|
" <thead>\n",
|
||
|
" <tr style=\"text-align: right;\">\n",
|
||
|
" <th></th>\n",
|
||
|
" <th>Control</th>\n",
|
||
|
" <th>Stimulated</th>\n",
|
||
|
" <th>MWU</th>\n",
|
||
|
" <th>PRS</th>\n",
|
||
|
" </tr>\n",
|
||
|
" </thead>\n",
|
||
|
" <tbody>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>average_firing_rate</th>\n",
|
||
|
" <td>21.22 ± 1.17 (147)</td>\n",
|
||
|
" <td>20.20 ± 0.96 (178)</td>\n",
|
||
|
" <td>13472.00, 0.645</td>\n",
|
||
|
" <td>1.02, 0.501</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>half_width</th>\n",
|
||
|
" <td>0.23 ± 0.01 (147)</td>\n",
|
||
|
" <td>0.23 ± 0.00 (178)</td>\n",
|
||
|
" <td>12839.00, 0.773</td>\n",
|
||
|
" <td>0.01, 0.454</td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <th>peak_to_trough</th>\n",
|
||
|
" <td>0.29 ± 0.00 (147)</td>\n",
|
||
|
" <td>0.29 ± 0.00 (178)</td>\n",
|
||
|
" <td>13194.50, 0.895</td>\n",
|
||
|
" <td>0.00, 0.893</td>\n",
|
||
|
" </tr>\n",
|
||
|
" </tbody>\n",
|
||
|
"</table>\n",
|
||
|
"</div>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
" Control Stimulated MWU \\\n",
|
||
|
"average_firing_rate 21.22 ± 1.17 (147) 20.20 ± 0.96 (178) 13472.00, 0.645 \n",
|
||
|
"half_width 0.23 ± 0.01 (147) 0.23 ± 0.00 (178) 12839.00, 0.773 \n",
|
||
|
"peak_to_trough 0.29 ± 0.00 (147) 0.29 ± 0.00 (178) 13194.50, 0.895 \n",
|
||
|
"\n",
|
||
|
" PRS \n",
|
||
|
"average_firing_rate 1.02, 0.501 \n",
|
||
|
"half_width 0.01, 0.454 \n",
|
||
|
"peak_to_trough 0.00, 0.893 "
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 98,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"ns"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# example waveforms"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 102,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def normalize(a):\n",
|
||
|
" t = a - a.min()\n",
|
||
|
" return t / t.max()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"'half_width','peak_to_trough'"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 142,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"[<matplotlib.lines.Line2D at 0x7f05ec0bc7f0>]"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 142,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQUAAADECAYAAACWVTQ0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJztnXd4HPWd/1+zXb03q9iWJY8b7sYFXCimBAIkJKRw6ZeQh+QXLlxCCIQAAZLjIAnhkhwJuYQn3OWS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93PEmnI/JrSqYyU0oUAKwmK5++5Da+vuqrmA2aXW532/nJnp9fUCw0nggMR45lPgDkFGcwmEvU0dSNy+Ge8HvXdtVzoPGQvn/LvOk5SxhKQUo+D2/8HisLlunHlLaT3P/OQ9MmzB0JppwoDLK26FK+v+FeUi1a7dhuZzc/2/MLXN6Jf3kiyXjNB7PVREbBQHFsFVrqOka/YBTerPq7vr2yYDnFqRdPubNEcwJ3rf4aty34qO6w7nR08ej2x9ly5h1RxGUYpqwoAJRmzOYbq+/Ul/lq5cifj8tfdJD5EMJMAYJToSdqQnQ7u9lV976+f0P5daOcPT0xSAZulm/knnXfJHlgYZVX9fK7w8/zq4O/xSnqNAQxpUUBYH62zO2LPqHvv1uzg73n4isPXlXVcc8UIDx+hX9Uv6tXTy7NmE155pwJ3Wc6sDhvEY9e8SCz0kr0Y9trd/LAtkdEdacAprwoAFw75+qgrLYXjv8Fr88bwxEF4+hz4XVr4zHbTFgTQivIOlQUxjsD8vg8bDmzVd+/bs7Vcb3oKRrkJGX
|
||
|
"text/plain": [
|
||
|
"<Figure size 288x216 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure(figsize=figsize_gen)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"lw = 3\n",
|
||
|
"\n",
|
||
|
"row = results.query('bs==1').sort_values('half_width', ascending=False).iloc[50]\n",
|
||
|
"template = data_loader.template(\n",
|
||
|
" row.action, row.channel_group, row.unit_name)\n",
|
||
|
"\n",
|
||
|
"mean_wf = template.data\n",
|
||
|
"peak_wf = mean_wf[np.argmin(mean_wf.min(1))]\n",
|
||
|
"plt.plot(normalize(peak_wf.T), color=color_bs, lw=lw)\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"row = results.query('bs==0').sort_values('half_width').iloc[10]\n",
|
||
|
"template = data_loader.template(\n",
|
||
|
" row.action, row.channel_group, row.unit_name)\n",
|
||
|
"\n",
|
||
|
"mean_wf = template.data\n",
|
||
|
"peak_wf = mean_wf[np.argmin(mean_wf.min(1))]\n",
|
||
|
"plt.plot(normalize(peak_wf.T), color=color_ns, lw=lw)\n",
|
||
|
"\n",
|
||
|
"# plt.savefig(output_path / \"figures\" / \"example_waveforms.svg\", bbox_inches=\"tight\")\n",
|
||
|
"# plt.savefig(output_path / \"figures\" / \"example_waveforms.png\", dpi=600, bbox_inches=\"tight\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Store results in Expipe action"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 105,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"action = project.require_action(\"waveform-analysis\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 106,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"stuff = {\n",
|
||
|
" \"figures\": \"figures\",\n",
|
||
|
" \"statistics\": \"statistics\"\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"for key, value in stuff.items():\n",
|
||
|
" action.data[key] = value\n",
|
||
|
" data_path = action.data_path(key)\n",
|
||
|
" data_path.parent.mkdir(exist_ok=True, parents=True)\n",
|
||
|
" source = output_path / value\n",
|
||
|
" if source.is_file():\n",
|
||
|
" shutil.copy(source, data_path)\n",
|
||
|
" else:\n",
|
||
|
" copy_tree(str(source), str(data_path))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 108,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"septum_mec.analysis.registration.store_notebook(action, \"10_waveform_analysis.ipynb\")"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"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.6.8"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 2
|
||
|
}
|