septum-mec/actions/waveform-analysis/data/10_waveform_analysis.ipynb

1466 lines
184 KiB
Plaintext
Raw Permalink Normal View History

2019-10-09 12:24:44 +00:00
{
"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": [
2019-12-13 10:43:57 +00:00
"08:31:25 [I] klustakwik KlustaKwik2 version 0.2.6\n"
2019-10-09 12:24:44 +00:00
]
}
],
"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",
2019-12-13 10:43:57 +00:00
"from tqdm.notebook import tqdm_notebook as tqdm\n",
"tqdm.pandas()\n",
2019-10-09 12:24:44 +00:00
"\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": 3,
"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",
2019-12-13 10:43:57 +00:00
"execution_count": 5,
2019-10-09 12:24:44 +00:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
2019-12-13 10:43:57 +00:00
"N cells: 1284\n"
2019-10-09 12:24:44 +00:00
]
}
],
"source": [
"identify_neurons = actions['identify-neurons']\n",
"sessions = pd.read_csv(identify_neurons.data_path('sessions'))\n",
2019-12-13 10:43:57 +00:00
"units = pd.read_csv(identify_neurons.data_path('units'))\n",
2019-10-09 12:24:44 +00:00
"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",
2019-12-13 10:43:57 +00:00
"execution_count": 6,
2019-10-09 12:24:44 +00:00
"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>baseline</th>\n",
" <th>entity</th>\n",
" <th>frequency</th>\n",
" <th>i</th>\n",
" <th>ii</th>\n",
" <th>session</th>\n",
" <th>stim_location</th>\n",
" <th>stimulated</th>\n",
" <th>tag</th>\n",
2019-12-13 10:43:57 +00:00
" <th>date</th>\n",
" <th>entity_date</th>\n",
" <th>Hz11</th>\n",
" <th>Hz30</th>\n",
2019-10-09 12:24:44 +00:00
" <th>channel_group</th>\n",
2019-12-13 10:43:57 +00:00
" <th>max_depth_delta</th>\n",
" <th>max_dissimilarity</th>\n",
" <th>unit_id</th>\n",
" <th>unit_idnum</th>\n",
2019-10-09 12:24:44 +00:00
" <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>False</td>\n",
" <td>True</td>\n",
" <td>3</td>\n",
" <td>NaN</td>\n",
" <td>False</td>\n",
" <td>baseline ii</td>\n",
2019-12-13 10:43:57 +00:00
" <td>60319</td>\n",
" <td>1849-060319</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
2019-10-09 12:24:44 +00:00
" <td>1</td>\n",
2019-12-13 10:43:57 +00:00
" <td>100</td>\n",
" <td>0.05</td>\n",
" <td>f129d848-ebee-4555-965f-420e402eb820</td>\n",
" <td>703</td>\n",
2019-10-09 12:24:44 +00:00
" <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>False</td>\n",
" <td>True</td>\n",
" <td>3</td>\n",
" <td>NaN</td>\n",
" <td>False</td>\n",
" <td>baseline ii</td>\n",
2019-12-13 10:43:57 +00:00
" <td>60319</td>\n",
" <td>1849-060319</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
2019-10-09 12:24:44 +00:00
" <td>1</td>\n",
2019-12-13 10:43:57 +00:00
" <td>100</td>\n",
" <td>0.05</td>\n",
" <td>b50f3878-32aa-40e9-8753-9f401ef32a23</td>\n",
" <td>704</td>\n",
2019-10-09 12:24:44 +00:00
" <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>False</td>\n",
" <td>True</td>\n",
" <td>3</td>\n",
" <td>NaN</td>\n",
" <td>False</td>\n",
" <td>baseline ii</td>\n",
2019-12-13 10:43:57 +00:00
" <td>60319</td>\n",
" <td>1849-060319</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
2019-10-09 12:24:44 +00:00
" <td>1</td>\n",
2019-12-13 10:43:57 +00:00
" <td>100</td>\n",
" <td>0.05</td>\n",
" <td>b1626e1a-0469-4ee0-a812-88ee18accd39</td>\n",
" <td>705</td>\n",
2019-10-09 12:24:44 +00:00
" <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>False</td>\n",
" <td>True</td>\n",
" <td>3</td>\n",
" <td>NaN</td>\n",
" <td>False</td>\n",
" <td>baseline ii</td>\n",
2019-12-13 10:43:57 +00:00
" <td>60319</td>\n",
" <td>1849-060319</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
2019-10-09 12:24:44 +00:00
" <td>1</td>\n",
2019-12-13 10:43:57 +00:00
" <td>100</td>\n",
" <td>0.05</td>\n",
" <td>feb62d54-f173-4a3c-939c-8c1465e71b0f</td>\n",
" <td>706</td>\n",
2019-10-09 12:24:44 +00:00
" <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>False</td>\n",
" <td>True</td>\n",
" <td>3</td>\n",
" <td>NaN</td>\n",
" <td>False</td>\n",
" <td>baseline ii</td>\n",
2019-12-13 10:43:57 +00:00
" <td>60319</td>\n",
" <td>1849-060319</td>\n",
" <td>False</td>\n",
" <td>True</td>\n",
2019-10-09 12:24:44 +00:00
" <td>1</td>\n",
2019-12-13 10:43:57 +00:00
" <td>100</td>\n",
" <td>0.05</td>\n",
" <td>3498a09b-b943-4917-866a-8910dbcfd0cd</td>\n",
" <td>707</td>\n",
2019-10-09 12:24:44 +00:00
" <td>98</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" action baseline entity frequency i ii session \\\n",
"0 1849-060319-3 True 1849 NaN False True 3 \n",
"1 1849-060319-3 True 1849 NaN False True 3 \n",
"2 1849-060319-3 True 1849 NaN False True 3 \n",
"3 1849-060319-3 True 1849 NaN False True 3 \n",
"4 1849-060319-3 True 1849 NaN False True 3 \n",
"\n",
2019-12-13 10:43:57 +00:00
" stim_location stimulated tag date entity_date Hz11 Hz30 \\\n",
"0 NaN False baseline ii 60319 1849-060319 False True \n",
"1 NaN False baseline ii 60319 1849-060319 False True \n",
"2 NaN False baseline ii 60319 1849-060319 False True \n",
"3 NaN False baseline ii 60319 1849-060319 False True \n",
"4 NaN False baseline ii 60319 1849-060319 False True \n",
"\n",
" channel_group max_depth_delta max_dissimilarity \\\n",
"0 1 100 0.05 \n",
"1 1 100 0.05 \n",
"2 1 100 0.05 \n",
"3 1 100 0.05 \n",
"4 1 100 0.05 \n",
"\n",
" unit_id unit_idnum unit_name \n",
"0 f129d848-ebee-4555-965f-420e402eb820 703 104 \n",
"1 b50f3878-32aa-40e9-8753-9f401ef32a23 704 108 \n",
"2 b1626e1a-0469-4ee0-a812-88ee18accd39 705 85 \n",
"3 feb62d54-f173-4a3c-939c-8c1465e71b0f 706 94 \n",
"4 3498a09b-b943-4917-866a-8910dbcfd0cd 707 98 "
2019-10-09 12:24:44 +00:00
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"session_units.head()"
]
},
{
"cell_type": "code",
2019-12-13 10:43:57 +00:00
"execution_count": 7,
2019-10-09 12:24:44 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"action\n",
2019-12-13 10:43:57 +00:00
"1833-010719-2 33\n",
"1833-010719-1 29\n",
"1833-290519-1 28\n",
"1833-020719-3 27\n",
"1849-280219-1 26\n",
" ..\n",
2019-10-09 12:24:44 +00:00
"1849-110319-3 4\n",
"1839-060619-4 4\n",
"1839-060619-3 4\n",
"1839-120619-1 3\n",
"1839-060619-1 2\n",
2019-12-13 10:43:57 +00:00
"Name: unit_name, Length: 87, dtype: int64"
2019-10-09 12:24:44 +00:00
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2019-12-13 10:43:57 +00:00
"# session_units.groupby('action').count().unit_name.hist()\n",
"session_units.groupby('action').count().sort_values('unit_name', ascending=False).unit_name"
2019-10-09 12:24:44 +00:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Process all data"
]
},
{
"cell_type": "code",
2019-12-13 10:43:57 +00:00
"execution_count": 8,
2019-10-09 12:24:44 +00:00
"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",
2019-12-13 10:43:57 +00:00
"execution_count": 9,
2019-10-09 12:24:44 +00:00
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
2019-12-13 10:43:57 +00:00
"model_id": "39294999a86e4f8ea477c5180a80e8c6",
2019-10-09 12:24:44 +00:00
"version_major": 2,
"version_minor": 0
},
"text/plain": [
2019-12-13 10:43:57 +00:00
"HBox(children=(IntProgress(value=0, max=1284), HTML(value='')))"
2019-10-09 12:24:44 +00:00
]
},
"metadata": {},
"output_type": "display_data"
2019-12-13 10:43:57 +00:00
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n"
]
2019-10-09 12:24:44 +00:00
}
],
"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": null,
"metadata": {},
2019-12-13 10:43:57 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"> \u001b[0;32m/home/mikkel/apps/expipe-project/septum-mec/septum_mec/analysis/data_processing.py\u001b[0m(619)\u001b[0;36mtemplate\u001b[0;34m()\u001b[0m\n",
"\u001b[0;32m 617 \u001b[0;31m lim=lim)\n",
"\u001b[0m\u001b[0;32m 618 \u001b[0;31m }\n",
"\u001b[0m\u001b[0;32m--> 619 \u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_templates\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0maction_id\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mchannel_group\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0munit_id\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0m\u001b[0;32m 620 \u001b[0;31m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0m\u001b[0;32m 621 \u001b[0;31m \u001b[0;32mdef\u001b[0m \u001b[0mspike_train\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maction_id\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mchannel_group\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0munit_id\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0m\n",
"ipdb> action_id\n",
"'1834-010319-3'\n",
"ipdb> channel_group\n",
"0\n",
"ipdb> unit_id\n",
"72\n"
]
}
],
2019-10-09 12:24:44 +00:00
"source": [
"%debug"
]
},
{
"cell_type": "code",
2019-12-13 10:43:57 +00:00
"execution_count": 10,
2019-10-09 12:24:44 +00:00
"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",
2019-12-13 10:43:57 +00:00
"execution_count": 11,
2019-10-09 12:24:44 +00:00
"metadata": {},
2019-12-13 10:43:57 +00:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQ8AAADiCAYAAABQgkLWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO3de3xU1bnw8d9MgqASIJiEQEK4zwohjakoSYBaX9sqcgd922prWyu+vXATEN+jbU/ltbXn1FKU2ot4q8dDra2EhFvR4+nxBgkoChhCVkAUCCEkIBCEAElmv3/smWESkslkMnsumef7+eSTzOzJ3s+emf3stdZea22bYRgIIURn2cMdgBAiOknyEEIERJKHECIgkjyEEAGR5CGECEh8uAPwx44dO1Li4+OfBbKRhCdEKDiBsqampjljx46tbesFUZE84uPjn01NTR2dnJx80m63y7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GnOUrfCTHBT+icQG286Ixc/Zn2qLTWv9fcsj6abcB8WS/AUxWW/2t7Exkq9i+SMWP+d2P02l1BVKqSuAA0qpAqVUT6/nYkrrs4r3447OOP4eFN3xzOU0nKzXm/wqUYSyL4MV73W0J79A+PqkNOaI2puBv7j+dj8XM9o6ALyL2B0Vt70Piva+tJ05yKJJWW05ayqKma2md+qgsjqRWlFFitSOXJYyDMPnj8PhuKHV45s6+p9g/8yaNcsIl101Hxl3r51jFO1dbzQ7mw3DMIxmZ7Oxq+Yjo9nZ3OLv9jQ7m40Pj+4yCsu
"text/plain": [
"<Figure size 288x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
2019-10-09 12:24:44 +00:00
"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",
2019-12-13 10:43:57 +00:00
"execution_count": 12,
2019-10-09 12:24:44 +00:00
"metadata": {},
2019-12-13 10:43:57 +00:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQ8AAADwCAYAAAAenOFGAAA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FxcnP+3335bPy0tzVy3bt2sxYsXH50zZ07gyZMna7zzzjuBEydOTJo2bVpQSkqKL8Crr756qlOnTmmO9TVr1ixz48aNDcLDw5v16dPn8pgxYy40a9Ys0/kzr127Zn7mmWfOfPfddznJY/fu3bd07Njxmr+/v+Hv75/dvHnzGwcOHKjRrVu3VFe2+9FHH73t+vXrvgCHDx++Zd68ebF9+/a95sp7K3XJI+HQ2dqlvc6///3vCZGRkU3i4uKqO55bunRpbFpamnnatGnBPXr0uH327NmBhR1BhJuysmDNmjpkZZXK6vbv3197xIgRasiQIe3efPPNVgMHDrwIMHny5HMDBgy4sHjx4qa9e/e+ffz48W3OnDnjl/f9tWrVylq3bp3u27fv1cuXL/tGRkbGbty4MSY7O9u0a9eums8+++zZli1bpr300ktnZ8+e3bR79+5XV61aFfv2228nvP766y2d19W8efPMv/3tb6dXr14d06xZs4zBgweHbNy4MVcVJDg4OCMsLOy683NXr171qVWrVrbjcc2aNbNTUlJ88sY6Y8aM1iNGjFAjRoxQjzzyiMXx/CeffHJ09erVumPHjtdGjx59ztXEAZW45JFw6Gztrz7abuk3oVdsUIfAq6W13kaNGmVPnz791Isvvti6U6dO165cueKTkJBQfebMmb8Cv54+fdrv6aefvu3LL7+8PmjQoCul9bkC2LChDqNHtyEyMp7hw1NKurrOnTtfXbRo0TGAmJiY6mPHjm3fu3fvqB07dtQaM2bMhUcfffRCenq66YMPPmg6c+bMlosXLz7q/P6goKAbAD4+Pvj5+RmTJk0KrlGjRvb58+erZWVl5TowHz16tMaePXvqbNmypQHA1atXb9r3du/eXTMyMrLRyZMn/SdNmvTrvffeW+Tvtnbt2tmpqak5ySI1NdWnbt262Xlf989//vN4+/bt08HW5nH//ffndMF+8MEHTS5duuT7/vvvJxT1ec4qbckjqEPg1dJOHA6DBg260rJly/TNmzc3zMjIML/44ovBiYmJvgCBgYGZDRo0yKxevbpUW0rbkCEpREbGM2RIiRNHXk2aNMkpzixfvrzJp59+2hDA39/fsFgsaX5+fjcVJR3D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EKL8kaO4EMItkjyEEG4p9TYPpZQfsARoBVQH3tJaf+60fBDwGpAFLNFaf1jUOrt37240b968tEMVQhTh0KFD57XW+V7k2xMNpo8AF7TW45RSDYD9wOeQk1hmA3cB14HtSqnPtdbnClth8+bNWbt2rQdCFUIURilV4JXkPFFtWQW8ar9vwlbCcGgPxGutL2mtM4Afgbs9EIMQwsNKveShtb4GoJSqDawG/uq0uA7gfEm9q0CuK4ELISoGjzSYKqVuBb4Dlmut/+20KAWo7fS4NnDZEzEIITzLEw2mTYAtwBSt9X/zLD4CtLW3hVzDVmV5t7RjEEJ4nicaTF8B6gOvKqUcbR8fArdorRcppV4AvsJW6lmitf7VAzGIcshqWIlOOkxo4xDMJhklUNF5os1jKjC1kOUbgY2l/bmi/ItOOsx7O+cwLexZOjUJ9XY4ooQk/YsyE9o4hGlhzxLaOMTboYhSUCEmxonKwWwyS4mjEpGShxDCLZI8hBBukeQhhHCLJA8hhFskeQgh3CLJQwjhFkkeQgi3SPIQQrhFkocQwi2SPIQQbpHkIYRwiyQPIYRbJHkIIdwiyUMI4RZJHkIIt0jyEEK4RZKHEMItkjyEEG6R5CGEcIskDyGEWyR5CCHcIslDCOEWSR5CCLdUqeRhzcrk6KcLsWZlejs
"text/plain": [
"<Figure size 288x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
2019-10-09 12:24:44 +00:00
"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",
2019-12-13 10:43:57 +00:00
"execution_count": 13,
2019-10-09 12:24:44 +00:00
"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",
2019-12-13 10:43:57 +00:00
"execution_count": 14,
2019-10-09 12:24:44 +00:00
"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",
2019-12-13 10:43:57 +00:00
"execution_count": 15,
2019-10-09 12:24:44 +00:00
"metadata": {},
2019-12-13 10:43:57 +00:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQ8AAADwCAYAAAAenOFGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAg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jwYXFVVFXDttdfW33vvvZl/+tOfcrydHPfAAw9k3HTTTZUzZ86sbW25+7Yutq7GxkbdjBkzRu3evfuQ+/uTJ0++JCEhwQLQ1NSknzZtWuVDDz1U0t4+erMv/dXhw4dNTz31VJrZbNY3NjYGXHXVVTW//OUvC/X6jl2nN2/eHDV+/Phzqamp1ot9Nicnx/jzn/8885133jlvrtLIkSMvHz58+DlN02hsbNQvWbKkZNGiRZV2u53HH3887dSpU8FWq1VvMpkcy5cvPzN48OAOjXdRycMDrlm1mzZtOq7X6/n666+Df/nLXw7atm3b0ffeey86Li7Oeu2119a7Jrr5ivu2OrOeNWvWnAgODtbMZrNuxowZIxctWlRRXl4e2NY+dlX8fZ1rVu2f//znU1lZWWabzca99947+KWXXor/0Y9+1OZco9asWbMmUQhxxpPk0ZawsDD7W2+9JQGqq6sDZsyYMer222+v3LZtW2RZWZlxw4YNJwG2bNkStXz58vTXXnvtVEfWr5K
"text/plain": [
"<Figure size 288x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
2019-10-09 12:24:44 +00:00
"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",
2019-12-13 10:43:57 +00:00
"execution_count": 16,
2019-10-09 12:24:44 +00:00
"metadata": {},
"outputs": [],
"source": [
"results.average_firing_rate = results.apply(lambda x: float(x.average_firing_rate), axis=1)"
]
},
{
"cell_type": "code",
2019-12-13 10:43:57 +00:00
"execution_count": 17,
2019-10-09 12:24:44 +00:00
"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",
2019-12-13 10:43:57 +00:00
"execution_count": 18,
2019-10-09 12:24:44 +00:00
"metadata": {},
2019-12-13 10:43:57 +00:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQIAAADPCAYAAAAeTt+OAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAPsElEQVR4nO3dfbBcdX3H8fdNCImUiDL4RMaClPJpWgpUHUJEIJ0SSGxRB3HaohVCCdDSCoVOBAcKdhDrQKoFalHSAKJI5SECFUhQiJIA8hRaE9NvJhRTK0OHOITHEAi5/e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JaHrpZFj4gFI48lXQg87RAon8cEbKy6Xha90Opsu9GuH/CX37rR9bLoDe+7MKeazKzHPKGowlpNGvL1A1YEB0GfcQBYERwEFdR2PADedE8Bjw1YHhwEfaBVF+AAsDw5CCrsrz+wYPQ3meXAQdAHvPe3ojkIesx3FrYqchAUrJsvvjsB6xUHQUlaXT78psVGelWM1Z6DIGftOgCvRGxV5iDoQl7H+152zMrmIBiDsXzxmzsAzwi0KnMQ5CCvtt+dgJXFQZBBxym/TUbb8/vLblXkIMiB237rdw6CNjpdApyF9/zWTxwE49CuA/CX3/qVg6DJWMYDzAaFgyDV7tRgp+N/dwA2KGofBO0CwJcAW53UPgiaNQeA9/pWB7UNAt8e3OwNtQoC3wvArLWul0WX9DfAn6RP74iILxRRaFF8VsCsy2XRJe0DfAqYQbIi8gpJSyLiP4sqOA9Z7gVgVidZgmCHZdElNS6L/gtgTkS8DiBpEvBK7lV2yYcEZp11tSx6RLwGbJQ0BFwCrIqIdUUUOh6dAsCzA83
"text/plain": [
"<Figure size 288x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
2019-10-09 12:24:44 +00:00
"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": null,
"metadata": {},
2019-12-13 10:43:57 +00:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQIAAADPCAYAAAAeTt+OAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAPbklEQVR4nO3dfbBcdX3H8fclhEQkogw+cceClPJpKgUqDpeIQDolklARB3Fa0QqhBGipQqETwIGCHcQKRC1BRUkDiCLlKQIVSFCImovIU2hNSL9MKKRWhg44PBMCIbd/nLNhs+zee+7dc/ac3f28Zhj2nN9m93uTud/z/T2c8xsYGRnBzPrbVmUHYGblcyIwMycCM3MiMDOcCMwMJwIzA7YuOwDbkqRdgMeAeRGxqO78PwB7RMQxJYXWNkmLgGuAtcCqiNiuoX0n4PqI+HAZ8fUzVwTVtAm4SNLuZQeSp4g4LiJ+Mkr7E04C5XBFUE3rgQXADyXNiIhX6xvTBPFNYDtgJ+Ah4C8i4hVJG4CbgL2AzwDDDcdvAS4EtgVeBc4C7gCeBGZExFpJZwB/ExE7p993B/D1iLi1Lob3AN8DdkxP/TgizpZ0DPBpkovMIPBb4OiIeELScuAS4P66z5kO3AqcCqwkrRQknQvsArwX2Bl4Kv0Zn5C0L/AtYBvg0bT91IhYPu6/aQNcEVTZl4GXgPObtM0DroyIGcBuwPuBP0/btgFuiQhFxP31xyRdjuuBkyNiT+Bo4PvA7wG3ALPTz5gNbCNpd0nbA3sDjVfyecB/R8QHgQOAP0jfC7A/cFJE/BHwAHBxsx9Q0h7p9x4XEUuavOUA4FMR8YfAM8AJkrYGbgDOTn+Gi9P4rA1OBBUV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1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
2019-10-09 12:24:44 +00:00
"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": null,
"metadata": {},
2019-12-13 10:43:57 +00:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQIAAADPCAYAAAAeTt+OAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAPbUlEQVR4nO3de9BcdX3H8fcDhkRKRBm8kbGgpXxKS4Gqw0Pklk4JJCrqIE5btEIoAVqsUOhwcaBgB2kdSLVAFYVyEUEqlwhUIAEhSoLILbQmpt9MKKRWBgccAgghEPL0j3M2bNZ9ds/z7Dl7zu75vGYY9lyy+91k9nu+v8s5v5GxsTHMrN62KjsA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aME4AVwYmgBxO5A7Ao7huwPDgRVJifKGT94kQwAeNVAH42oA06J4IK8pOFrd+cCDKY7JRfs0HhRFBhrgSsX5wIJqDoSsBDg1YWJ4KUHwVudeZEUAHuHLSy1T4R9Ksj0GW/VVntE0GVuBKwstQ2ERRVCXS78vvHblVU20SQJ5f9NuhqlQjajQwU1SfgK78NklolgryMVwH4x2+DqpaJwFOEzbZUy0SQRZZ2vysAGxZOBC3c8Wd1VItE0Mv0YV/1rQ5qkQgmwwnA6mSoE4GfI2CWTc/Lokv6W+DP0s3bI+KLRQRqZsXpaVl0Se8DPg2MkqyIvFTSwoj4r6ICzmIylYA7Ca3Oel0W/efAnIh4PSLGgCnAK7lHaWaF6mlZ9Ih4DXhW0ghwAbA8IlYXEehkdKoEPDvQ7A1ZKoJOy6IjaRpwbXrOX+cbnpn1Q0/LoqeVwC3APRHx5WJCLJYrALMel0UHtgYOAqZ
"text/plain": [
"<Figure size 288x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
2019-10-09 12:24:44 +00:00
"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": "code",
"execution_count": null,
"metadata": {},
2019-12-13 10:43:57 +00:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQIAAADPCAYAAAAeTt+OAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAO9klEQVR4nO3de7AkZXnH8e9ZQNbAihrQJFuWQJAnVCggwbAoKyxVi4IRTQilhhhcjKAVCSpWrQElaoJS4aIxbCIGskIsCXcQIwbcGJGbxXUJLOShoEqK8pIAkZtclz35o3tkGGbOmTO3np75fqq2ODM9Z+btXfo3z/v22/3OzM7OImm6Laq6AZKqZxBIMggkGQSSMAgkYRBIAjavugHqLCK2B+4D7iif2gx4Ejg2M68b0mduCzyYmTMDeK93Aisz85iI+D6wJjMvannNWcB5mbmu389T7wyC8fdUZu7ReBAR7wbOBt5QWYu6lJmXA5fP85oPjqg5moNBUD+/CvwUICJWAF8GfgFsBewFvB84Bnge+B/g6My8JyJ2Bv4B2Br4DWA98J7MfDoiDgE+T1Ft3NTpgyPic8AfAs8CDwOrMvOnEbER+Dtg/7Idx2fmJRGxCjg0M9/R9B6bA+cCz5VtXQesAW4G/gO4AlgGvBr4VGaeHxG/ApwB7A08AtwFkJmrevob1Es4RjD+Xh4R68s/91Mc+Cc1bd8V+OPM3B3YB1gN7F8+Phe4LCJmgCOBczLzTcBOwA7A70fEa4G1wB9l5p7A/e0aERGvAz4G/F5mvhG4iuKAhaLL8n/l778bWBsR27V5m5cBFwL/C7wvMze2bN8RuDIz9wI+CZxcPn8CxZfWbwErgd+Z+69MC2UQjL+nMnOP8s/rgRXAeRGxQ7n9gcxsHLwHAudn5oMAmXk2sBTYnuLAej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WAxkG/y6I/DNyUmT8DiIgfUITCVAZBO53GBAwAjZN+l0W/Fdg1IrYFHgH2Bs4ceCvHXDcDgnYJNM4GsSz6ccCV5WsvyMw7h9TWWjIAVAeDWBb9POC8AberFno5NWiXQOPICUU9cFBQk8YgGADHBFR3BkEfnCWoSWEQdKnXOwvbJVAdGAQDZHdAdWUQLJDdAU0ig2AAvNmo6s47FEmyIpjPQu4xaCWgurIikGRF0K3mQUIrAU0ag6ADVyTWNDEI+mAloElhEMzDW4xpGhgELewSaBoZBAtkd0CTyCAoeddhTTPnEUia7oqg3XhAp0rALoEmmRWBpOmuCBpcmVjTziBo4eCgppFdA0n9L4ve9JpvA9/MzDOG0dBB6mbSkF0CTZNuKoJfLosO/CXFsuitTgReNciGSRqdfpdFJyIOBTY1XlMnc11aLE2TvpZFj4hdgcOAQ4G/GkYDB8nrCKT2+l0W/XBgKfA9YHvg2Yj4UWbWojpoVwU4NqBp1Ney6Jm5uvFzRHwW+FkdQuD0W06uugnSWOl7WfShtm5A5usSWAVo2vW9LHrT6z47oDaNjAEgFSZ6ZmFrJWCXQGrPmYWSJq8imPvS4qIisEsgvdjEBUE7ThaS5jYxQdDpVmPwQiUgqb2JCYJ2vMuQ1J2JC4K5bjIiqb2JC4J2rASkudU+CLyQSOpf7YOglWcIpIWbmAlF645e7viA1KOJqwgaHBeQujcxFYGk3tW2ImgdJHRsQOqdFYGk+lYEDa2XFjs2IC2cFYGkelUEc00eshKQelerIGjm3Yakwall18CJQ9Jg1bYiaLBLIPWvVkHQ6A54oxFpsGoRBI1BwtMrboc0qfpeFj0iPg68t3x4RWZ+bhgNbWZ3QBqsvpZFj4gdgT8B3gzsDbw1InYbRkMlDU+/y6I/AByYmc8DRMQWwNODapw3HZFGo69l0TPzOeChiJgBTgFuy8x7htFQScPT77L
"text/plain": [
"<Figure size 288x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
2019-10-09 12:24:44 +00:00
"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": null,
"metadata": {},
2019-12-13 10:43:57 +00:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQIAAADPCAYAAAAeTt+OAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAOzUlEQVR4nO3dfbBcdX3H8fcNILEQUQvaNuMIFPmWKSO0WIIlQpgBBSrYUkYttZhYQadGVJyJBaVqizIVqLXSioVGqAPlGcSKBVMrQsDhMQgh/TIwI8P40AKVJyFAyO0f52xclt29e+8+nD1336+ZDHcf7tnfSTif/f5+53fOb2p6ehpJk21B1Q2QVD2DQJJBIMkgkIRBIAmDQBKwddUNUGcRsTPwAHB3+dRWwNPAiZm5dkifuSPwcGZODWBbRwIHZ+YJEfE94KzMvKzlPecCF2Xmmn4/T3NnEIy/ZzJz78aDiHgncB7whspa1KPMvBq4eob3vH9EzVEXBkH9/CrwU4CIWAZ8CfgFsB2wL/Be4ATgBeB/gJWZeV9E7A78I7A98BvAOuBdmbkxIo4CPkdRbdza6YMj4r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1L9aBoEHvzRYnjWQZBBIqknXYMvkoYrbIc1XfS+LHhEfA95dPrwmMz87jIZKGp6+lkWPiF2BPwWWUKyIfGNEXJmZPxxkI50zIA1Xv8uiPwQcmpkvAETENsDGQTXOLoE0Gn0ti56ZzwOPRMQUcDpwZ2beN4yGgqcNpWHp5axBt2XRiYiFwAXle/5isM2TNAq9BMFa4HCA1mXRy0rgG8BdmfmBRhdBUr30tSw6sBVwILBtRBxWvv+kzLx5KK2VNBS
"text/plain": [
"<Figure size 288x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
2019-10-09 12:24:44 +00:00
"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": null,
"metadata": {},
2019-12-13 10:43:57 +00:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQIAAADPCAYAAAAeTt+OAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAPJ0lEQVR4nO3de7AkZXnH8e9ZQNbAihrQJFtGIMg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gOsBDSNpjoI5sO5AppkBgGuRygZBPPkuIAmkUHQhqcINU36Xha94TXfAb6VmWdX0dBBctKQtKFuKoKXlkUvlzw7Azi06TUnA68bdONGwUpA06jfZdGJiMOBdbOvqRNPFUqFvpZFj4gdgSOAw4G/qqKBgzSfLoGVgKZJv8uiHwksBq4Htgaej4gHM7N21YE0zfpaFj0zj5/9OSI+D/y8DiHQqkvgfAFNs76XRa+0dQPiWQKps76XRW943ecH1KaRcmxA02iiJxTNdWmx3QGp4D0LJU1eRdDNpcVOGpI2NHFB0IldAam1iQmCXm41ZiUgFSYmCObDAJA2NHFB4PUD0vxNXBC04tiA1Fntg8BZg1L/ah8E8+HYgNTaxASBFxJJvXNmoaTJqQg6sUsgdVbbIGg3SGh3QJo/uwaS6lsRzGo3gcjugNQ9KwJJ9aoInDwkVaNWQdCJg4RS72oZBI3jAgaA1L9aBkEnDhJK8zcxQWAASL2rRRA4SChVq+9l0SPiE8D7y4fXZOYXqmhoM8cGpMHpZh7BS8uiA5+mWBYdgIjYFvgT4O3A7sA7I2KnKhoKxSChdyCSBq/fZdEfBg7IzBcBImITYM2gGtd
"text/plain": [
"<Figure size 288x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
2019-10-09 12:24:44 +00:00
"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": null,
"metadata": {},
2019-12-13 10:43:57 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"U-test: U value 135025.0 p value 0.11036062942886643\n",
"U-test: U value 6176.0 p value 0.12484872783599776\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAIIAAADPCAYAAAA5xQlPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAdD0lEQVR4nO2deZgkZZ3nP29EZtbR3AsCItAK8nogt6KrA92ueOs4qMj0w0jTMzKM46Ouuo4i7O4MOq46s47K4IHLMUcLKuCOK8jR0A22Td/Vd799Vh/VXfeV9xHx7h8RWV1dnVWZlRmRkVHG53nqqarMiPf9RcQ3fu/9e4XWmogII2gDIlqDSAgRQCSECJdICBFAJIQIl0gIEQDEgjagElLK+cBeYIv7kQlkgC8opVb6lOeZwIBSSniQ1oeBdymlPiulXA7cq5T65ZRjfgo8opR6rtH8vKAlheCSVUpdUf5HSnkT8BDw2sAsqhGl1H8A/1HlmL9okjk10cpCmMp/Ao4CSCkXAN8D0sA84C3ArcBnAQvoAz6jlNolpbwE+GfgJOCVQBfwCaVUTkp5I/ANHG+zdrqMpZR/C/wJUACGgMVKqaNSyhLwT8BC1447lVKPSykXAx9TSn1wUhoxYClQdG19DrgXWAcsA54ErgXOAL6mlHpUStkJ/Ah4KzAKbAdQSi2u6w7OQCvXETqklF3uzwGcB//NSd9fCvypUupy4O3Al4GF7v9LgV9JKQXwKeBhpdTbgIuBVwMfkFKeDTwAfFQpdTVwoJIRUsrzgc8Db1ZKXQM8g/PAwCmyht3zbwIekFKeVSGZBPALoB+4RSlVmvL9a4CnlVJvAf4G+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<Figure size 122.4x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAIIAAADPCAYAAAA5xQlPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO2deZhcZZnof985VdVVvWTpdFYSkpDAxx5AZVGEMBpBUcYLMuNwnVFzEZmrz+ijPg46cEcHnTtzcWYcZVCBq0EdBBUQUZawJU4CBBISiCT5su9LdyfpdKe7az3f/eOc0qJTXcupszW3fs+TJ1Vd53znPVXveb/tXYTWmiZNjLAFaBINmorQBGgqQhOHpiI0AZqK0MShqQhNAIiFLQCAlHIOsAP4lFLq3pK/fwk4Wyn1iZBEaxgp5b3AA8BW4PdKqfYRn88AfqmUemcY8hWJkkWwgG9JKU8LWxAvUUrdqJR6psLn+8NWAoiIRXAYBv4F+JmU8hKlVLb0Q0dB/gNoB2YA64A/V0qlpZQZ4FFgAfDfgZUj3qeAO4BWIAvcCjwNHAQuUUptlVLeAvy1Umq2c72ngX9TSj1eIsM04MdAl/On3yqlbpNSfgL4C+wH6yRgH/BxpdR+KeUy4E5gdUk7ZwCPA18A1uJYCinl14A5wHRgNtDj3ON+KeWFwF1AAtjmfP4FpdSyur/pMkTJIgB8ExgE/rHMZ58C7lNKXQLMB+YCVzufJYDHlFJSKbW69D12l/NL4HNKqXOBjwM/BU4GHgOuctq4CkhIKU+TUo4HzgNGPsmfArYrpS4A3g2c6hwL8C7gM0qpM4E1wHfK3aCU8mznujcqpR4pc8i7geuVUqcDR4FPSyljwEPAbc49fMeRzzMipQhKKQv4GPBJKeWiER//LdAjpfwy8D1sq1Da3/7XiOOL7y8CtiqlVjnXeAPbYiwEHgHeL6XswH4K7wcWAR8AnhxplYAngeuklI8D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LNVt7Gc7mScTqn+0aQvDQi7t9kModR1evA6t8BgEzlaTvtTewsrmApaot0ikL3FDmo4u9F6c8v3xx12jfXVVaW0y2HOhnV89xZk9ur36Cz3Q/vxJhlFfo4pjh2BubmHj+OUGKFf0Fpe5jw7yypZf2lLspoL24pPnVqvCtQiGdoW/teszW1KjHWLkcvSt9NbBlibwiPLpqN5Zlm3i3tLXE+M0rexnK5Ksf7CN9a9cDnDBbKMVMJjm0dHng+ySRVoR0tsBDL+6mtaW2tYPRKPooPLV2v0eSuePQM8ux8pWV0WhJkOnpZWj33oCkcq4b6NXq5OnX9pPJFYi7GCSOJGEa/GTZVgoheS5ZuRyHnv0dsfa2iscVu7Ke51cGJJlNZBWhYGmWPLe1rIOqG5IJk6PHs6FNJY++uh6dzWHEqo91zESCfY8+GWj3EFlFWLHhEEcGMpU9kerEEIIfPrslFD+FA489hVWordaGkWwhfbCbwW07/RWq9JqBXakOLEtz7zNbPI9Wam0x2d0zyOptwW5P54eG6F62knhHbdNXIQRYBQ48PmpxOM+JpCKs3trL3t5BWj20BsAflqfvfXpzoFahe9kL6IJVcbYwErO1lX2/egIrF8ziUuQUQWvNPU9vQQjq2leolfZkDLWvn/W7gsv/tednDyPqHOsYiThWOs3hl9b4JNWI6wVylTp4bedRth7op80nH4I/WIVnNlc50huOb93B8S07Ki4ijYYGdv80mPRUkVOEe5baP5Af1qBIRzLG6zuPBuLyvufBR9G6vl3TIrH2Nvpee4PBXXt8kOzNREoRNu7p4409fbQn/fUoEkKAhiXPbfH1Orlj/Rx4/BniVdYORsOW02LPg496LNmJREoRljy3FbS/1qBIeyrGqs2
"text/plain": [
"<Figure size 122.4x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
2019-10-09 12:24:44 +00:00
"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": null,
"metadata": {},
2019-12-13 10:43:57 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"U-test: U value 85419.0 p value 0.4550292852318226\n",
"U-test: U value 3843.0 p value 0.06623560612855536\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAIIAAADPCAYAAAA5xQlPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAdLklEQVR4nO2deZgc5X3nP29V91zi1IIFxhwGzOuT0xh77RjhBdv4ioNvPV4DSsx6Ez/G63gdH7BZh3hZ4ziJMfGFAziHjO2AvfEajIxAAmRJIMFI6JhXg6TRSHPffUxfVfXuH1UtjUY9Mz3dVV1ds/V5Hj2j7q5+61fV33rP3+/3Cq01MTFG2AbENAexEGKAWAgxHrEQYoBYCDEesRBiAEiEbUAlpJTnAfuAF723TGAa+IJSamNA5zwNGFFKCR/K+gBwrVLqc1LK9cA9Sql/m3XMj4EHlVKP13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OxjfRSTpsHgZPgh5vOR2r33iB/CbMz2ViZfiIWwKA4OZ47LnWQagkyu1NSTSuNbO+cMbxPJJMWJKfJDjZ9YiqwQ9g9mSJrHmi+EIJkwGJho3g7j2DNbMNvbKn4mhABhMLl9V4OtirAQekYyJBMVzNfQN9ac/YTC6Di5/iGM1pa5D3JsRp/e1DijPCIphFzRYjxdIGke384WLYf9Q+F6BM/F+NZO8Bxp5sLsaGd047MN902IpBAOjmRpSRgVb2gyIdh5MPxksJUYXvf0gpm/jGQSp1AkrV5qkFXeeRt6Np/YP5ieM6qpJWGyt7/5NgN1iiXGNm/F7OhY+FjLYnTjsw2w6iiRFMKOnok
"text/plain": [
"<Figure size 122.4x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAIIAAADPCAYAAAA5xQlPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO2deZQcV33vP1XV3bNrpBnttmxt1vWK5AUs7zJgbMwSng0J+JFgFAPOgxM4hkOA2AFCyEueyUsChAB2wAQiIEYWeLcly7KRLMuWrJFsWbral9Fom9GMZu+l6r4/qtq0Rz3T3dW3q2r8+nOOjrqnq279qvtbt27d+1sMpRRVqphhG1AlGlSFUAWoCqGKR1UIVYCqEKp4VIVQBYBY2AYACCFmA/uAT0kp78/5+5eAC6WUt4dkWtkIIe4HfgXsBl6TUjaO+Hwm8Bsp5ZVh2JclSj2CA3xHCLEgbEN0IqW8Q0q5aozPO8IWAUSkR/AYAv4J+KUQ4gopZSr3Q08g/wY0AjOBNuBPpJTDQogk8DtgIfA/gXUj3tcB9wL1QAq4G1gJHAWukFLuFkJ8BfgLKeXZ3vFWAv8spXw8x4bpwH8Ck70/PS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5udh/ppaFCPgRv9AqrdhbYUh8dDz+FUeLSsuE535x8MZinh8gJ4b6n3R+oEr1BlqbaGFv3dwfi8j7YfoTBA4fGnFYeDeU4dDzyVAWsOp1ICWH7oR62HeqhsbayHkWGYYCCB1bvquhxAI6tXINySrstZIk1NnBywybSvZUP6o2UEB5YvRtUZXuDLI11MTbs7GT/8ZHlIvWhlOLwQ49ilTJ
"text/plain": [
"<Figure size 122.4x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
2019-10-09 12:24:44 +00:00
"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": null,
"metadata": {},
2019-12-13 10:43:57 +00:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"U-test: U value 49606.0 p value 0.03757091416858637\n",
"U-test: U value 2333.0 p value 0.5891054506000802\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAIIAAADPCAYAAAA5x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ZxPbd9U4GpdSPJQ+JqX8qvfrJOAAG4L2SNBau+MM5uEcwXKcuheCnc4w2bMfI9Z01GdOLsfYlm0BRFXakrengUeklK8BUeDzuL4IgXokTKRyaA3GtAqX40DfcH13KiV27EZEIu7w8wzMpiZGNm4OIKoShKCUSgK35vkoUI+EwfHMEbkBQMQU7B8OdoJHMca71FEVxSmM5iYSO3bjZHNH9DHUgobtUIqPp4/yV4yYgt6h+s4Rhte1g5H/axeGgTANEjtqX09oWCH0j6ax7CNr3lHTqOuBJ601o+2dmM3NhY/JWYHUExpWCHvjiaO8k0zDna6WztbnjObUgT6sVBojOkuJbJoMrlpfu6A8GlYIOw9OEDWPDF8IQTRi0DsS7BLzQoxt6SpqF2y2NDO2eWvNO5YaVgh74gmikTzhazgwVJ9CGFq9oegDNiIRnJxFcndPjaLyrlvTq/lEKmsxPJEhah79fmUth139EwFENTtaa4bXbsRsaSl+rO0w2rGlBlEdpiGFsDeeJBYx8lrqRSOCrXuDN4OdSepAH7nxCcRs9YMpDMHg62urH9T0S9b0aj6xq2+i4KqmWMSku7f+NgMd3bwVKM0P0mxpYWRTZ03rCQ0phM49IwXdVqOmYDSZZTRZX4NPc3nDjYiJtm0S23dXMaIZ16zZlXxk855hmqJm3s+EEERMg+7e8RpHVRjtOAyv21RS/eDQOZbNSHtnFaM6koYTQiKdo3c4RVO+FoNHznLYurd+Ng1P7u7ByWRm7z+YgYi
"text/plain": [
"<Figure size 122.4x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAIIAAADPCAYAAAA5xQlPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAfWklEQVR4nO2deZQc1X3vP7e6unume0ajWSQkBqEVLiCEx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72L5+vDzf2nX5a2f3Eh+Xx/adQP92/PWGt577KnQbY2dEN5cv4uVGz8Y3GoSb4JJc+vjb4XS/lC2PvMCA1t3YGczWLYd7F8qydqb70Q7Rmt57UfshHDLwlWgw+kNCjQ1Jnll9Xbe2hReaJzWmjU/vQNRZVR2orGBge072fL0c4YsK06shLBqUy9db++kuTHcoYvlTzvf8VR3aMfYuaSLvW+/QyKbqbotkbBYfcPtaLcy76wgxEoIdzzVHXpvUKC5webZFVvYsG2v8ba11nRffxsYeupJZBrp2/gu2559yYB1xYmNEDbu2MezK7aENjYYjuX7Ktz9zFrjbe/qWsZu1Y3dZGa1UwiBsCxW33BbaHMgsRHCvYvXorWuaaaTbIPNo69uZNfe4ZV/g6O1pvu6WwGzPVsim2Hv2vVsf35J+Y0DEAsh7O7L8ciSDWRr7E6WsCwc1+WRJeuNtdnz2jJ6lyvs5qbyG48CIQQiYdF9/a2h9AqxEMLjr71L3tUl4xnDIp1M8KvFb++XlCsIXm/gFXcNY5yTyGbYu2YdO154xXjblQa4TARewauknmcU1Vv
"text/plain": [
"<Figure size 122.4x216 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
2019-10-09 12:24:44 +00:00
"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": null,
"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": null,
"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": null,
"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": null,
"metadata": {},
"outputs": [],
"source": [
"bs"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ns"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# example waveforms"
]
},
{
"cell_type": "code",
"execution_count": null,
"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": null,
"metadata": {},
"outputs": [],
"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",
2019-12-13 10:43:57 +00:00
"execution_count": 36,
2019-10-09 12:24:44 +00:00
"metadata": {},
"outputs": [],
"source": [
"action = project.require_action(\"waveform-analysis\")"
]
},
{
"cell_type": "code",
2019-12-13 10:43:57 +00:00
"execution_count": 37,
2019-10-09 12:24:44 +00:00
"metadata": {},
"outputs": [],
"source": [
"action.data['results'] = 'results.csv'\n",
"results.to_csv(action.data_path('results'), index=False)"
]
},
{
"cell_type": "code",
2019-12-13 10:43:57 +00:00
"execution_count": 38,
2019-10-09 12:24:44 +00:00
"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",
2019-12-13 10:43:57 +00:00
"execution_count": 39,
2019-10-09 12:24:44 +00:00
"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
}