updates to statistics
This commit is contained in:
parent
b6a4cc0b49
commit
ffdf5a4853
|
@ -1,6 +1,5 @@
|
|||
registered: '2019-10-04T08:11:18'
|
||||
data:
|
||||
units: units.csv
|
||||
results: results.csv
|
||||
notebook: 10_calculate_spatial_statistics.ipynb
|
||||
html: 10_calculate_spatial_statistics.html
|
||||
|
|
|
@ -13173,7 +13173,7 @@ div#notebook {
|
|||
|
||||
|
||||
<div class="output_subarea output_stream output_stderr output_text">
|
||||
<pre>17:02:20 [I] klustakwik KlustaKwik2 version 0.2.6
|
||||
<pre>14:03:52 [I] klustakwik KlustaKwik2 version 0.2.6
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -13225,7 +13225,8 @@ div#notebook {
|
|||
<div class="inner_cell">
|
||||
<div class="input_area">
|
||||
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">identify_neurons</span> <span class="o">=</span> <span class="n">actions</span><span class="p">[</span><span class="s1">'identify-neurons'</span><span class="p">]</span>
|
||||
<span class="n">units</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">identify_neurons</span><span class="o">.</span><span class="n">data_path</span><span class="p">(</span><span class="s1">'units'</span><span class="p">))</span>
|
||||
<span class="n">units</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">read_csv</span><span class="p">(</span><span class="n">identify_neurons</span><span class="o">.</span><span class="n">data_path</span><span class="p">(</span><span class="s1">'all_non_identified_units'</span><span class="p">))</span>
|
||||
<span class="c1"># units = pd.read_csv(identify_neurons.data_path('units'))</span>
|
||||
<span class="n">units</span><span class="o">.</span><span class="n">head</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
|
||||
|
@ -13264,57 +13265,39 @@ div#notebook {
|
|||
<th></th>
|
||||
<th>action</th>
|
||||
<th>channel_group</th>
|
||||
<th>max_depth_delta</th>
|
||||
<th>max_dissimilarity</th>
|
||||
<th>unit_id</th>
|
||||
<th>unit_name</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>0</th>
|
||||
<td>1834-010319-1</td>
|
||||
<td>0</td>
|
||||
<td>100</td>
|
||||
<td>0.05</td>
|
||||
<td>8d8cecbe-e2e5-4020-9c94-9573ca55cdfc</td>
|
||||
<td>2</td>
|
||||
<td>1849-060319-3</td>
|
||||
<td>1</td>
|
||||
<td>104</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>1</th>
|
||||
<td>1834-010319-1</td>
|
||||
<td>0</td>
|
||||
<td>100</td>
|
||||
<td>0.05</td>
|
||||
<td>5b7fc3e8-b76d-4eed-a876-9ba184e508ac</td>
|
||||
<td>39</td>
|
||||
<td>1849-060319-3</td>
|
||||
<td>1</td>
|
||||
<td>108</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>2</th>
|
||||
<td>1834-010319-3</td>
|
||||
<td>0</td>
|
||||
<td>100</td>
|
||||
<td>0.05</td>
|
||||
<td>1b42831d-5d71-4cb1-ba85-b5019b56ca2e</td>
|
||||
<td>1849-060319-3</td>
|
||||
<td>1</td>
|
||||
<td>85</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>3</th>
|
||||
<td>1834-010319-3</td>
|
||||
<td>0</td>
|
||||
<td>100</td>
|
||||
<td>0.05</td>
|
||||
<td>270fb3b3-3a7d-4060-bc1a-bc68d2ecab1a</td>
|
||||
<td>12</td>
|
||||
<td>1849-060319-3</td>
|
||||
<td>1</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>4</th>
|
||||
<td>1834-010319-3</td>
|
||||
<td>0</td>
|
||||
<td>100</td>
|
||||
<td>0.05</td>
|
||||
<td>6da7e1db-2d4f-4bd7-b45c-a1855aaa2fec</td>
|
||||
<td>72</td>
|
||||
<td>1849-060319-3</td>
|
||||
<td>1</td>
|
||||
<td>98</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -13330,6 +13313,55 @@ div#notebook {
|
|||
<div class="cell border-box-sizing code_cell rendered">
|
||||
<div class="input">
|
||||
<div class="prompt input_prompt">In [6]:</div>
|
||||
<div class="inner_cell">
|
||||
<div class="input_area">
|
||||
<div class=" highlight hl-ipython3"><pre><span></span><span class="o">%</span><span class="k">matplotlib</span> inline
|
||||
<span class="n">units</span><span class="o">.</span><span class="n">groupby</span><span class="p">(</span><span class="s1">'action'</span><span class="p">)</span><span class="o">.</span><span class="n">count</span><span class="p">()</span><span class="o">.</span><span class="n">unit_name</span><span class="o">.</span><span class="n">hist</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="output_wrapper">
|
||||
<div class="output">
|
||||
|
||||
|
||||
<div class="output_area">
|
||||
|
||||
<div class="prompt output_prompt">Out[6]:</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="output_text output_subarea output_execute_result">
|
||||
<pre><matplotlib.axes._subplots.AxesSubplot at 0x7f1dd5d9ea90></pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="output_area">
|
||||
|
||||
<div class="prompt"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="output_png output_subarea ">
|
||||
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXIAAAD7CAYAAAB37B+tAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAC/9JREFUeJzt3X+IpHd9wPH35u4mq+UMCiJ6WBexfpi/QjjxItZ6YIpNj5KSP4tBDCJK/oiojdf0glAsXEpyghEV8sOTVkHMj/7hcZo/bJPYImISwcThcxo96x8KbSAYDePuXbZ/7BzdXnZ2Zp6dmWc/s+8XBGZmZ/f5fO/Zeee5Z+fZW1pfX0eSVNcVbQ8gSdoZQy5JxRlySSrO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qZVXuhp4dUQ8GhHfHby9sorngBs33T8MPDa4fRa4bu4TTW6rNRyLiMcj4v6IODjk83aLbwJ3DG4vAReotx+GraHMfsjMfwU+Mrj7FuAF6u2HsRnyV3oJuAt4Pxt/HftaRJT4m0tmPgSsbXpoKTMvvS3pReCq+U81mS3W8APgbzPzz4CfA59pZbAxZebvMvPFQegeBE5QbD8MWUOp/QCQmRci4qvAPcDXKLYfJmHIX+kc8C+ZuZ6Z54DngTe2PFNTm8//HWTjqKSaRzLzyUu3gWvaHGYcEfFm4N+Af87Mr1NwP2yxhnL7ASAzPwi8nY3z5a/a9KES+2FchvyVbmbw2xwj4k3Aa4BftzpRc08Pzg8CXA880eIsTX0nIt45uP0+4Mntnty2iHgD8Cjw6cx8YPBwqf0wZA3V9sNNEfF3g7svsfE/0x9W2g+TKHHKYM7uB05HxPfY+On2zdv9Hpld7pPAvRHRAXps/DW5mo8B90TEGvAb/u+85251O/Ba4I6IuHSe+Vbg84X2w1Zr+ATwuUL74WHgKxHxOHAA+Dgbf/bVXw9b8spOSSrOUyuSVJwhl6TiDLkkFWfIJak4Qy5JxRlySSrOkEtScYZckor7Xy3zQIQBBWTTAAAAAElFTkSuQmCC
|
||||
"
|
||||
>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="cell border-box-sizing code_cell rendered">
|
||||
<div class="input">
|
||||
<div class="prompt input_prompt">In [ ]:</div>
|
||||
<div class="inner_cell">
|
||||
<div class="input_area">
|
||||
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">data_loader</span> <span class="o">=</span> <span class="n">dp</span><span class="o">.</span><span class="n">Data</span><span class="p">(</span>
|
||||
|
@ -13346,7 +13378,7 @@ div#notebook {
|
|||
</div>
|
||||
<div class="cell border-box-sizing code_cell rendered">
|
||||
<div class="input">
|
||||
<div class="prompt input_prompt">In [7]:</div>
|
||||
<div class="prompt input_prompt">In [ ]:</div>
|
||||
<div class="inner_cell">
|
||||
<div class="input_area">
|
||||
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">first_row</span> <span class="o">=</span> <span class="n">units</span><span class="p">[</span><span class="n">units</span><span class="p">[</span><span class="s1">'action'</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'1849-060319-3'</span><span class="p">]</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
|
||||
|
@ -13427,7 +13459,7 @@ div#notebook {
|
|||
<span class="n">autocorrelogram</span> <span class="o">=</span> <span class="n">sp</span><span class="o">.</span><span class="n">autocorrelation</span><span class="p">(</span><span class="n">smooth_high_rate_map</span><span class="p">)</span>
|
||||
<span class="n">peaks</span> <span class="o">=</span> <span class="n">sp</span><span class="o">.</span><span class="n">fields</span><span class="o">.</span><span class="n">find_peaks</span><span class="p">(</span><span class="n">autocorrelogram</span><span class="p">)</span>
|
||||
<span class="n">real_peaks</span> <span class="o">=</span> <span class="n">peaks</span> <span class="o">*</span> <span class="n">bin_size</span>
|
||||
<span class="n">autocorrelogram_box_size</span> <span class="o">=</span> <span class="n">box_size</span> <span class="o">*</span> <span class="n">autocorrelogram</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">/</span> <span class="n">smooth_high_rate_map</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
|
||||
<span class="n">autocorrelogram_box_size</span> <span class="o">=</span> <span class="n">box_size</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">*</span> <span class="n">autocorrelogram</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">/</span> <span class="n">smooth_high_rate_map</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
|
||||
<span class="n">spacing</span><span class="p">,</span> <span class="n">orientation</span> <span class="o">=</span> <span class="n">sp</span><span class="o">.</span><span class="n">spacing_and_orientation</span><span class="p">(</span><span class="n">real_peaks</span><span class="p">,</span> <span class="n">autocorrelogram_box_size</span><span class="p">)</span>
|
||||
<span class="n">orientation</span> <span class="o">*=</span> <span class="mi">180</span> <span class="o">/</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span>
|
||||
|
||||
|
@ -13482,6 +13514,56 @@ div#notebook {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="output_wrapper">
|
||||
<div class="output">
|
||||
|
||||
|
||||
<div class="output_area">
|
||||
|
||||
<div class="prompt"></div>
|
||||
|
||||
|
||||
<div class="output_subarea output_stream output_stderr output_text">
|
||||
<pre>/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/elephant/statistics.py:835: UserWarning: Instantaneous firing rate approximation contains negative values, possibly caused due to machine precision errors.
|
||||
warnings.warn("Instantaneous firing rate approximation contains "
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="output_area">
|
||||
|
||||
<div class="prompt output_prompt">Out[ ]:</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="output_text output_subarea output_execute_result">
|
||||
<pre>average_rate 3.095328
|
||||
speed_score -0.063922
|
||||
out_field_mean_rate 1.837642
|
||||
in_field_mean_rate 5.122323
|
||||
max_field_mean_rate 8.882211
|
||||
max_rate 23.006163
|
||||
sparsity 0.468122
|
||||
selectivity 7.306812
|
||||
interspike_interval_cv 3.970863
|
||||
burst_event_ratio 0.397921
|
||||
bursty_spike_ratio 0.676486
|
||||
gridness -0.459487
|
||||
border_score 0.078474
|
||||
information_rate 0.965845
|
||||
head_mean_ang 5.788704
|
||||
head_mean_vec_len 0.043321
|
||||
spacing 0.624971
|
||||
orientation 22.067900
|
||||
dtype: float64</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="cell border-box-sizing code_cell rendered">
|
||||
<div class="input">
|
||||
|
@ -13497,6 +13579,77 @@ div#notebook {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="output_wrapper">
|
||||
<div class="output">
|
||||
|
||||
|
||||
<div class="output_area">
|
||||
|
||||
<div class="prompt"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="2b4825d6-9766-4260-96f8-a8462ab148ed"></div>
|
||||
<div class="output_subarea output_widget_view ">
|
||||
<script type="text/javascript">
|
||||
var element = $('#2b4825d6-9766-4260-96f8-a8462ab148ed');
|
||||
</script>
|
||||
<script type="application/vnd.jupyter.widget-view+json">
|
||||
{"model_id": "efa60f02cd1b4f1a946f01a7f61c1640", "version_major": 2, "version_minor": 0}
|
||||
</script>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="output_area">
|
||||
|
||||
<div class="prompt"></div>
|
||||
|
||||
|
||||
<div class="output_subarea output_stream output_stderr output_text">
|
||||
<pre>/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/ipykernel_launcher.py:56: RuntimeWarning: Mean of empty slice.
|
||||
/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/numpy/core/_methods.py:85: RuntimeWarning: invalid value encountered in double_scalars
|
||||
ret = ret.dtype.type(ret / rcount)
|
||||
/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/ipykernel_launcher.py:57: RuntimeWarning: Mean of empty slice.
|
||||
/home/mikkel/apps/expipe-project/spatial-maps/spatial_maps/stats.py:13: RuntimeWarning: divide by zero encountered in log2
|
||||
return (np.nansum(np.ravel(tmp_rate_map * np.log2(tmp_rate_map/avg_rate) *
|
||||
/home/mikkel/apps/expipe-project/spatial-maps/spatial_maps/stats.py:13: RuntimeWarning: invalid value encountered in log2
|
||||
return (np.nansum(np.ravel(tmp_rate_map * np.log2(tmp_rate_map/avg_rate) *
|
||||
/home/mikkel/apps/expipe-project/spatial-maps/spatial_maps/stats.py:13: RuntimeWarning: invalid value encountered in multiply
|
||||
return (np.nansum(np.ravel(tmp_rate_map * np.log2(tmp_rate_map/avg_rate) *
|
||||
/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/numpy/core/_methods.py:140: RuntimeWarning: Degrees of freedom <= 0 for slice
|
||||
keepdims=keepdims)
|
||||
/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/numpy/core/_methods.py:110: RuntimeWarning: invalid value encountered in true_divide
|
||||
arrmean, rcount, out=arrmean, casting='unsafe', subok=False)
|
||||
/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/numpy/core/_methods.py:132: RuntimeWarning: invalid value encountered in double_scalars
|
||||
ret = ret.dtype.type(ret / rcount)
|
||||
/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/quantities/quantity.py:624: RuntimeWarning: Mean of empty slice.
|
||||
ret = self.magnitude.mean(axis, dtype, None if out is None else out.magnitude)
|
||||
/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/ipykernel_launcher.py:82: RuntimeWarning: invalid value encountered in long_scalars
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="cell border-box-sizing code_cell rendered">
|
||||
<div class="input">
|
||||
<div class="prompt input_prompt">In [ ]:</div>
|
||||
<div class="inner_cell">
|
||||
<div class="input_area">
|
||||
<div class=" highlight hl-ipython3"><pre><span></span><span class="o">%</span><span class="k">debug</span>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="cell border-box-sizing code_cell rendered">
|
||||
<div class="input">
|
||||
|
@ -13517,8 +13670,7 @@ div#notebook {
|
|||
<div class="prompt input_prompt">In [ ]:</div>
|
||||
<div class="inner_cell">
|
||||
<div class="input_area">
|
||||
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">units</span><span class="o">.</span><span class="n">to_csv</span><span class="p">(</span><span class="n">output_path</span> <span class="o">/</span> <span class="s2">"units.csv"</span><span class="p">,</span> <span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<span class="n">results</span><span class="o">.</span><span class="n">to_csv</span><span class="p">(</span><span class="n">output_path</span> <span class="o">/</span> <span class="s2">"results.csv"</span><span class="p">,</span> <span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">results</span><span class="o">.</span><span class="n">to_csv</span><span class="p">(</span><span class="n">output_path</span> <span class="o">/</span> <span class="s2">"results.csv"</span><span class="p">,</span> <span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
@ -13535,7 +13687,7 @@ div#notebook {
|
|||
</div>
|
||||
<div class="cell border-box-sizing code_cell rendered">
|
||||
<div class="input">
|
||||
<div class="prompt input_prompt">In [14]:</div>
|
||||
<div class="prompt input_prompt">In [ ]:</div>
|
||||
<div class="inner_cell">
|
||||
<div class="input_area">
|
||||
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">statistics_action</span> <span class="o">=</span> <span class="n">project</span><span class="o">.</span><span class="n">require_action</span><span class="p">(</span><span class="s2">"calculate-statistics"</span><span class="p">)</span>
|
||||
|
@ -13548,11 +13700,10 @@ div#notebook {
|
|||
</div>
|
||||
<div class="cell border-box-sizing code_cell rendered">
|
||||
<div class="input">
|
||||
<div class="prompt input_prompt">In [15]:</div>
|
||||
<div class="prompt input_prompt">In [ ]:</div>
|
||||
<div class="inner_cell">
|
||||
<div class="input_area">
|
||||
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">statistics_action</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="s2">"units"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"units.csv"</span>
|
||||
<span class="n">statistics_action</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="s2">"results"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"results.csv"</span>
|
||||
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">statistics_action</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="s2">"results"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"results.csv"</span>
|
||||
<span class="n">copy_tree</span><span class="p">(</span><span class="n">output_path</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">statistics_action</span><span class="o">.</span><span class="n">data_path</span><span class="p">()))</span>
|
||||
</pre></div>
|
||||
|
||||
|
@ -13560,32 +13711,10 @@ div#notebook {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="output_wrapper">
|
||||
<div class="output">
|
||||
|
||||
|
||||
<div class="output_area">
|
||||
|
||||
<div class="prompt output_prompt">Out[15]:</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="output_text output_subarea output_execute_result">
|
||||
<pre>['/media/storage/expipe/septum-mec/actions/calculate-statistics/data/results.csv',
|
||||
'/media/storage/expipe/septum-mec/actions/calculate-statistics/data/sessions.csv',
|
||||
'/media/storage/expipe/septum-mec/actions/calculate-statistics/data/units.csv']</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="cell border-box-sizing code_cell rendered">
|
||||
<div class="input">
|
||||
<div class="prompt input_prompt">In [16]:</div>
|
||||
<div class="prompt input_prompt">In [ ]:</div>
|
||||
<div class="inner_cell">
|
||||
<div class="input_area">
|
||||
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">septum_mec</span><span class="o">.</span><span class="n">analysis</span><span class="o">.</span><span class="n">registration</span><span class="o">.</span><span class="n">store_notebook</span><span class="p">(</span><span class="n">statistics_action</span><span class="p">,</span> <span class="s2">"10_calculate_spatial_statistics.ipynb"</span><span class="p">)</span>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"17:02:20 [I] klustakwik KlustaKwik2 version 0.2.6\n"
|
||||
"14:03:52 [I] klustakwik KlustaKwik2 version 0.2.6\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@ -108,76 +108,51 @@
|
|||
" <th></th>\n",
|
||||
" <th>action</th>\n",
|
||||
" <th>channel_group</th>\n",
|
||||
" <th>max_depth_delta</th>\n",
|
||||
" <th>max_dissimilarity</th>\n",
|
||||
" <th>unit_id</th>\n",
|
||||
" <th>unit_name</th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th>0</th>\n",
|
||||
" <td>1834-010319-1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>100</td>\n",
|
||||
" <td>0.05</td>\n",
|
||||
" <td>8d8cecbe-e2e5-4020-9c94-9573ca55cdfc</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>1849-060319-3</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>104</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>1834-010319-1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>100</td>\n",
|
||||
" <td>0.05</td>\n",
|
||||
" <td>5b7fc3e8-b76d-4eed-a876-9ba184e508ac</td>\n",
|
||||
" <td>39</td>\n",
|
||||
" <td>1849-060319-3</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>108</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>2</th>\n",
|
||||
" <td>1834-010319-3</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>100</td>\n",
|
||||
" <td>0.05</td>\n",
|
||||
" <td>1b42831d-5d71-4cb1-ba85-b5019b56ca2e</td>\n",
|
||||
" <td>1849-060319-3</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>85</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>3</th>\n",
|
||||
" <td>1834-010319-3</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>100</td>\n",
|
||||
" <td>0.05</td>\n",
|
||||
" <td>270fb3b3-3a7d-4060-bc1a-bc68d2ecab1a</td>\n",
|
||||
" <td>12</td>\n",
|
||||
" <td>1849-060319-3</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>94</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>4</th>\n",
|
||||
" <td>1834-010319-3</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>100</td>\n",
|
||||
" <td>0.05</td>\n",
|
||||
" <td>6da7e1db-2d4f-4bd7-b45c-a1855aaa2fec</td>\n",
|
||||
" <td>72</td>\n",
|
||||
" <td>1849-060319-3</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>98</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" action channel_group max_depth_delta max_dissimilarity \\\n",
|
||||
"0 1834-010319-1 0 100 0.05 \n",
|
||||
"1 1834-010319-1 0 100 0.05 \n",
|
||||
"2 1834-010319-3 0 100 0.05 \n",
|
||||
"3 1834-010319-3 0 100 0.05 \n",
|
||||
"4 1834-010319-3 0 100 0.05 \n",
|
||||
"\n",
|
||||
" unit_id unit_name \n",
|
||||
"0 8d8cecbe-e2e5-4020-9c94-9573ca55cdfc 2 \n",
|
||||
"1 5b7fc3e8-b76d-4eed-a876-9ba184e508ac 39 \n",
|
||||
"2 1b42831d-5d71-4cb1-ba85-b5019b56ca2e 1 \n",
|
||||
"3 270fb3b3-3a7d-4060-bc1a-bc68d2ecab1a 12 \n",
|
||||
"4 6da7e1db-2d4f-4bd7-b45c-a1855aaa2fec 72 "
|
||||
" action channel_group unit_name\n",
|
||||
"0 1849-060319-3 1 104\n",
|
||||
"1 1849-060319-3 1 108\n",
|
||||
"2 1849-060319-3 1 85\n",
|
||||
"3 1849-060319-3 1 94\n",
|
||||
"4 1849-060319-3 1 98"
|
||||
]
|
||||
},
|
||||
"execution_count": 5,
|
||||
|
@ -187,7 +162,8 @@
|
|||
],
|
||||
"source": [
|
||||
"identify_neurons = actions['identify-neurons']\n",
|
||||
"units = pd.read_csv(identify_neurons.data_path('units'))\n",
|
||||
"units = pd.read_csv(identify_neurons.data_path('all_non_identified_units'))\n",
|
||||
"# units = pd.read_csv(identify_neurons.data_path('units'))\n",
|
||||
"units.head()"
|
||||
]
|
||||
},
|
||||
|
@ -195,6 +171,39 @@
|
|||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"<matplotlib.axes._subplots.AxesSubplot at 0x7f1dd5d9ea90>"
|
||||
]
|
||||
},
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD7CAYAAAB37B+tAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAC/9JREFUeJzt3X+IpHd9wPH35u4mq+UMCiJ6WBexfpi/QjjxItZ6YIpNj5KSP4tBDCJK/oiojdf0glAsXEpyghEV8sOTVkHMj/7hcZo/bJPYImISwcThcxo96x8KbSAYDePuXbZ/7BzdXnZ2Zp6dmWc/s+8XBGZmZ/f5fO/Zeee5Z+fZW1pfX0eSVNcVbQ8gSdoZQy5JxRlySSrOkEtScYZckooz5JJUnCGXpOIMuSQVZ8glqbj989jIkSNH1g8dOjSPTU3N6uoqnU6n7TF2xDXsDq5hd6i4hmefffZ/MvP1o543l5AfOnSIhx9+eB6bmpper0e32217jB1xDbuDa9gdKq4hIn45zvM8tSJJxRlySSrOkEtScYZckooz5JJUnCGXpOIMuSQVZ8glqThDLknFGXL9P/21i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bD8MWUOp/QCQmRci4qvAPcDXKLYfJmHIX+kc8C+ZuZ6Z54DngTe2PFNTm8//HWTjqKSaRzLzyUu3gWvaHGYcEfFm4N+Af87Mr1NwP2yxhnL7ASAzPwi8nY3z5a/a9KES+2FchvyVbmbw2xwj4k3Aa4BftzpRc08Pzg8CXA880eIsTX0nIt45uP0+4Mntnty2iHgD8Cjw6cx8YPBwqf0wZA3V9sNNEfF3g7svsfE/0x9W2g+TKHHKYM7uB05HxPfY+On2zdv9Hpld7pPAvRHRAXps/DW5mo8B90TEGvAb/u+85251O/Ba4I6IuHSe+Vbg84X2w1Zr+ATwuUL74WHgKxHxOHAA+Dgbf/bVXw9b8spOSSrOUyuSVJwhl6TiDLkkFWfIJak4Qy5JxRlySSrOkEtScYZckor7Xy3zQIQBBWTTAAAAAElFTkSuQmCC\n",
|
||||
"text/plain": [
|
||||
"<Figure size 432x288 with 1 Axes>"
|
||||
]
|
||||
},
|
||||
"metadata": {
|
||||
"needs_background": "light"
|
||||
},
|
||||
"output_type": "display_data"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"%matplotlib inline\n",
|
||||
"units.groupby('action').count().unit_name.hist()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"data_loader = dp.Data(\n",
|
||||
|
@ -206,7 +215,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -220,7 +229,44 @@
|
|||
"metadata": {
|
||||
"scrolled": false
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/elephant/statistics.py:835: UserWarning: Instantaneous firing rate approximation contains negative values, possibly caused due to machine precision errors.\n",
|
||||
" warnings.warn(\"Instantaneous firing rate approximation contains \"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"average_rate 3.095328\n",
|
||||
"speed_score -0.063922\n",
|
||||
"out_field_mean_rate 1.837642\n",
|
||||
"in_field_mean_rate 5.122323\n",
|
||||
"max_field_mean_rate 8.882211\n",
|
||||
"max_rate 23.006163\n",
|
||||
"sparsity 0.468122\n",
|
||||
"selectivity 7.306812\n",
|
||||
"interspike_interval_cv 3.970863\n",
|
||||
"burst_event_ratio 0.397921\n",
|
||||
"bursty_spike_ratio 0.676486\n",
|
||||
"gridness -0.459487\n",
|
||||
"border_score 0.078474\n",
|
||||
"information_rate 0.965845\n",
|
||||
"head_mean_ang 5.788704\n",
|
||||
"head_mean_vec_len 0.043321\n",
|
||||
"spacing 0.624971\n",
|
||||
"orientation 22.067900\n",
|
||||
"dtype: float64"
|
||||
]
|
||||
},
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"def process(row):\n",
|
||||
" action_id = row['action']\n",
|
||||
|
@ -286,7 +332,7 @@
|
|||
" autocorrelogram = sp.autocorrelation(smooth_high_rate_map)\n",
|
||||
" peaks = sp.fields.find_peaks(autocorrelogram)\n",
|
||||
" real_peaks = peaks * bin_size\n",
|
||||
" autocorrelogram_box_size = box_size * autocorrelogram.shape[0] / smooth_high_rate_map.shape[0]\n",
|
||||
" autocorrelogram_box_size = box_size[0] * autocorrelogram.shape[0] / smooth_high_rate_map.shape[0]\n",
|
||||
" spacing, orientation = sp.spacing_and_orientation(real_peaks, autocorrelogram_box_size)\n",
|
||||
" orientation *= 180 / np.pi\n",
|
||||
"\n",
|
||||
|
@ -343,13 +389,62 @@
|
|||
"metadata": {
|
||||
"scrolled": false
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"application/vnd.jupyter.widget-view+json": {
|
||||
"model_id": "efa60f02cd1b4f1a946f01a7f61c1640",
|
||||
"version_major": 2,
|
||||
"version_minor": 0
|
||||
},
|
||||
"text/plain": [
|
||||
"HBox(children=(IntProgress(value=0, max=1298), HTML(value='')))"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/ipykernel_launcher.py:56: RuntimeWarning: Mean of empty slice.\n",
|
||||
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/numpy/core/_methods.py:85: RuntimeWarning: invalid value encountered in double_scalars\n",
|
||||
" ret = ret.dtype.type(ret / rcount)\n",
|
||||
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/ipykernel_launcher.py:57: RuntimeWarning: Mean of empty slice.\n",
|
||||
"/home/mikkel/apps/expipe-project/spatial-maps/spatial_maps/stats.py:13: RuntimeWarning: divide by zero encountered in log2\n",
|
||||
" return (np.nansum(np.ravel(tmp_rate_map * np.log2(tmp_rate_map/avg_rate) *\n",
|
||||
"/home/mikkel/apps/expipe-project/spatial-maps/spatial_maps/stats.py:13: RuntimeWarning: invalid value encountered in log2\n",
|
||||
" return (np.nansum(np.ravel(tmp_rate_map * np.log2(tmp_rate_map/avg_rate) *\n",
|
||||
"/home/mikkel/apps/expipe-project/spatial-maps/spatial_maps/stats.py:13: RuntimeWarning: invalid value encountered in multiply\n",
|
||||
" return (np.nansum(np.ravel(tmp_rate_map * np.log2(tmp_rate_map/avg_rate) *\n",
|
||||
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/numpy/core/_methods.py:140: RuntimeWarning: Degrees of freedom <= 0 for slice\n",
|
||||
" keepdims=keepdims)\n",
|
||||
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/numpy/core/_methods.py:110: RuntimeWarning: invalid value encountered in true_divide\n",
|
||||
" arrmean, rcount, out=arrmean, casting='unsafe', subok=False)\n",
|
||||
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/numpy/core/_methods.py:132: RuntimeWarning: invalid value encountered in double_scalars\n",
|
||||
" ret = ret.dtype.type(ret / rcount)\n",
|
||||
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/quantities/quantity.py:624: RuntimeWarning: Mean of empty slice.\n",
|
||||
" ret = self.magnitude.mean(axis, dtype, None if out is None else out.magnitude)\n",
|
||||
"/home/mikkel/.virtualenvs/expipe/lib/python3.6/site-packages/ipykernel_launcher.py:82: RuntimeWarning: invalid value encountered in long_scalars\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"results = units.merge(\n",
|
||||
" units.progress_apply(process, axis=1), \n",
|
||||
" left_index=True, right_index=True)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"%debug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
|
@ -366,7 +461,6 @@
|
|||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"units.to_csv(output_path / \"units.csv\", index=False)\n",
|
||||
"results.to_csv(output_path / \"results.csv\", index=False)"
|
||||
]
|
||||
},
|
||||
|
@ -379,7 +473,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 14,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -388,31 +482,17 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"['/media/storage/expipe/septum-mec/actions/calculate-statistics/data/results.csv',\n",
|
||||
" '/media/storage/expipe/septum-mec/actions/calculate-statistics/data/sessions.csv',\n",
|
||||
" '/media/storage/expipe/septum-mec/actions/calculate-statistics/data/units.csv']"
|
||||
]
|
||||
},
|
||||
"execution_count": 15,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"statistics_action.data[\"units\"] = \"units.csv\"\n",
|
||||
"statistics_action.data[\"results\"] = \"results.csv\"\n",
|
||||
"copy_tree(output_path, str(statistics_action.data_path()))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue