discussion

This commit is contained in:
a.ott 2020-09-17 22:34:22 +02:00
parent dc6adfbd1c
commit fe34966e6a
13 changed files with 100 additions and 41 deletions

View File

@ -48,7 +48,7 @@ def main():
# create_boxplots(errors) # create_boxplots(errors)
# example_good_hist_fits(dir_path) # example_good_hist_fits(dir_path)
# example_bad_hist_fits(dir_path) example_bad_hist_fits(dir_path)
# example_good_fi_fits(dir_path) # example_good_fi_fits(dir_path)
# example_bad_fi_fits(dir_path) # example_bad_fi_fits(dir_path)
@ -247,8 +247,8 @@ def example_good_hist_fits(dir_path):
def example_bad_hist_fits(dir_path): def example_bad_hist_fits(dir_path):
strong_bursty_cell = "2018-05-08-ab-invivo-1"
bursty_cell = "2014-06-06-ag-invivo-1" bursty_cell = "2014-06-06-ag-invivo-1"
strong_bursty_cell = "2018-05-08-ab-invivo-1"
extra_structure_cell = "2014-12-11-ad-invivo-1" extra_structure_cell = "2014-12-11-ad-invivo-1"
fig, axes = plt.subplots(1, 3, sharex="all", figsize=(8, 4)) fig, axes = plt.subplots(1, 3, sharex="all", figsize=(8, 4))

View File

@ -249,8 +249,8 @@ def create_behaviour_distributions(drawn_model_behaviour, fits_info):
# max_v = limit # max_v = limit
step = (max_v - min_v) / 15 step = (max_v - min_v) / 15
bins = np.arange(min_v, max_v + step, step) bins = np.arange(min_v, max_v + step, step)
axes_flat[i].hist(drawn_model_behaviour[l], bins=bins, alpha=0.75, density=False, color=consts.COLOR_MODEL) axes_flat[i].hist(drawn_model_behaviour[l], bins=bins, alpha=0.75, density=True, color=consts.COLOR_MODEL)
axes_flat[i].hist(cell_behaviour[l], bins=bins, alpha=0.5, density=False, color=consts.COLOR_DATA) axes_flat[i].hist(cell_behaviour[l], bins=bins, alpha=0.5, density=True, color=consts.COLOR_DATA)
axes_flat[i].set_xlabel(behaviour_titles[l] + " " + unit[i]) axes_flat[i].set_xlabel(behaviour_titles[l] + " " + unit[i])
axes_flat[i].set_yticks([]) axes_flat[i].set_yticks([])
axes_flat[i].set_yticklabels([]) axes_flat[i].set_yticklabels([])

18
test.py
View File

@ -23,7 +23,23 @@ from matplotlib import gridspec
cell = "data/final/2018-05-08-ab-invivo-1/"
cell_data = CellData(cell)
step = cell_data.get_sampling_interval()
v1 = cell_data.get_base_traces(cell_data.V1)[0]
time = cell_data.get_base_traces(cell_data.TIME)[0]
spiketimes = cell_data.get_base_spikes()[0]
start = 0
duration = 25
fig, ax = plt.subplots(1, 1)
ax.plot((np.array(time[:int(duration/step)]) - start) * 1000, v1[:int(duration/step)])
ax.eventplot([s * 1000 for s in spiketimes if start < s < start + duration],
lineoffsets=max(v1[:int(duration/step)])+1.25, color="black", linelengths=2)
plt.show()
plt.close()
quit()
# sp = self.spikes(index) # sp = self.spikes(index)
# binary = np.zeros(t.shape) # binary = np.zeros(t.shape)

View File

@ -56,6 +56,12 @@ Maciver, M.~A., Sharabash, N.~M., and Nelson, M.~E. (2001).
effects of water conductivity. effects of water conductivity.
\newblock {\em Journal of experimental biology}, 204(3):543--557. \newblock {\em Journal of experimental biology}, 204(3):543--557.
\bibitem[Olypher and Calabrese, 2007]{olypher2007using}
Olypher, A.~V. and Calabrese, R.~L. (2007).
\newblock Using constraints on neuronal activity to reveal compensatory changes
in neuronal parameters.
\newblock {\em Journal of Neurophysiology}, 98(6):3749--3758.
\bibitem[Ratnam and Nelson, 2000]{ratnam2000nonrenewal} \bibitem[Ratnam and Nelson, 2000]{ratnam2000nonrenewal}
Ratnam, R. and Nelson, M.~E. (2000). Ratnam, R. and Nelson, M.~E. (2000).
\newblock Nonrenewal statistics of electrosensory afferent spike trains: \newblock Nonrenewal statistics of electrosensory afferent spike trains:

View File

@ -3,44 +3,44 @@ Capacity: max_strings=35307, hash_size=35307, hash_prime=30011
The top-level auxiliary file: Masterthesis.aux The top-level auxiliary file: Masterthesis.aux
The style file: apalike.bst The style file: apalike.bst
Database file #1: citations.bib Database file #1: citations.bib
You've used 16 entries, You've used 17 entries,
1935 wiz_defined-function locations, 1935 wiz_defined-function locations,
586 strings with 6698 characters, 591 strings with 6859 characters,
and the built_in function-call counts, 6592 in all, are: and the built_in function-call counts, 7014 in all, are:
= -- 665 = -- 709
> -- 251 > -- 264
< -- 6 < -- 7
+ -- 84 + -- 88
- -- 82 - -- 86
* -- 606 * -- 645
:= -- 1143 := -- 1213
add.period$ -- 48 add.period$ -- 51
call.type$ -- 16 call.type$ -- 17
change.case$ -- 119 change.case$ -- 126
chr.to.int$ -- 16 chr.to.int$ -- 17
cite$ -- 16 cite$ -- 17
duplicate$ -- 222 duplicate$ -- 236
empty$ -- 470 empty$ -- 502
format.name$ -- 105 format.name$ -- 112
if$ -- 1265 if$ -- 1348
int.to.chr$ -- 1 int.to.chr$ -- 1
int.to.str$ -- 0 int.to.str$ -- 0
missing$ -- 15 missing$ -- 16
newline$ -- 83 newline$ -- 88
num.names$ -- 48 num.names$ -- 51
pop$ -- 83 pop$ -- 87
preamble$ -- 1 preamble$ -- 1
purify$ -- 120 purify$ -- 127
quote$ -- 0 quote$ -- 0
skip$ -- 167 skip$ -- 178
stack$ -- 0 stack$ -- 0
substring$ -- 577 substring$ -- 620
swap$ -- 16 swap$ -- 17
text.length$ -- 0 text.length$ -- 0
text.prefix$ -- 0 text.prefix$ -- 0
top$ -- 0 top$ -- 0
type$ -- 96 type$ -- 102
warning$ -- 0 warning$ -- 0
while$ -- 61 while$ -- 65
width$ -- 0 width$ -- 0
write$ -- 210 write$ -- 223

Binary file not shown.

View File

@ -475,13 +475,14 @@ All errors were then summed up for the full error. The fits were done with the N
\end{figure} \end{figure}
\begin{figure}[H] \begin{figure}[H]
\includegraphics[scale=0.5]{figures/fit_adaption_comparison.pdf} \includegraphics[scale=0.5]{figures/fit_burstiness_comparison.pdf}
\caption{\label{fig:comp_adaption} Comparison of the cell behavior and the behavior of the corresponding fit: \textbf{A} steady state $f_\infty$ and \textbf{B} onset $f_0$ response slope. In grey the line on which cell and model values are equal. Excluded \todo{how many} value pairs from $f_0$ slope as they had slopes higher than \todo{}. In \textbf{A} the $f_\infty$ slope pairs. Cell and models show good agreement with a low scattering in both direction. \textbf{B} The $f_0$ values show a higher spread and for steeper slopes the models have more often too flat slopes.} \caption{\label{fig:comp_burstiness} Comparison of the cell behavior and the behavior of the corresponding fit: \textbf{A} burstiness, \textbf{B} coefficient of variation (CV). \textbf{A}: The model values for the burstiness agree well with the values of the model but again show a tendency that the higher the value of the cell the more the model value is below it. \textbf{B}: The CV also shows the problem of the burstiness but the values drift apart more slowly starting around 0.6.}
\end{figure} \end{figure}
\begin{figure}[H] \begin{figure}[H]
\includegraphics[scale=0.5]{figures/fit_burstiness_comparison.pdf} \includegraphics[scale=0.5]{figures/fit_adaption_comparison.pdf}
\caption{\label{fig:comp_burstiness} Comparison of the cell behavior and the behavior of the corresponding fit: \textbf{A} burstiness, \textbf{B} coefficient of variation (CV). \textbf{A}: The model values for the burstiness agree well with the values of the model but again show a tendency that the higher the value of the cell the more the model value is below it. \textbf{B}: The CV also shows the problem of the burstiness but the values drift apart more slowly starting around 0.6.} \caption{\label{fig:comp_adaption} Comparison of the cell behavior and the behavior of the corresponding fit: \textbf{A} steady state $f_\infty$ and \textbf{B} onset $f_0$ response slope. In grey the line on which cell and model values are equal. \todo{how many} value pairs from \textbf{B} lie outside of the shown area. They had slopes between \todo{}. In \textbf{A} the $f_\infty$ slope pairs. Cell and models show good agreement with a low scattering in both direction. \textbf{B} The $f_0$ values show a higher spread and for steeper slopes the models have more often too flat slopes.}
\end{figure} \end{figure}
@ -524,13 +525,37 @@ All errors were then summed up for the full error. The fits were done with the N
\caption{\label{fig:drawn_behavior_dist} Behavior distribution of the randomly drawn models \todo{color}(orange) and the original cells \todo{color}(blue). The distribution of the seven behavior characteristics agree well for the most part, but especially the vector strength (VS) in \textbf{G} is offset to the distribution seen in the cells.} \caption{\label{fig:drawn_behavior_dist} Behavior distribution of the randomly drawn models \todo{color}(orange) and the original cells \todo{color}(blue). The distribution of the seven behavior characteristics agree well for the most part, but especially the vector strength (VS) in \textbf{G} is offset to the distribution seen in the cells.}
\end{figure} \end{figure}
\newpage
\section{Discussion} \section{Discussion}
In this thesis a simple model based on the leaky integrate-and-fire (LIF) model was built to allow the simulation of a neuron population correctly representing the heterogeneity of P-units in the electrosensory pathway of the electric fish \textit{A. leptorhynchus}. The LIF model was extended by an adaption current, a refractory period and simulated the input synapses by rectifying and low pass filtering the input current. This model was then fit to single in vivo recordings of P-units characterized by seven behavior parameters and the resulting models compared to the reference cell. Additionally estimations of the model parameter distributions and their covariances were used to draw random parameter sets and the generated population of P-units compared to the data set. In this thesis a simple model based on the leaky integrate-and-fire (LIF) model was built to allow the simulation of a neuron population correctly representing the heterogeneity of P-units in the electrosensory pathway of the electric fish \textit{A. leptorhynchus}. The LIF model was extended by an adaption current, a refractory period and simulated the input synapses by rectifying and low pass filtering the input current, building on the model proposed by \cite{walz2013Phd}. This model was then fit to single in vivo recordings of P-units characterized by seven behavior parameters and the resulting models compared to the reference cell. Additionally estimations of the model parameter distributions and their covariances were used to draw random parameter sets and the generated population of P-units compared to the data set.
It was shown in figure \ref{fig:dend_ref_effect} that the expansion of the model by the dendtritic low pass filter and the refractory period was necessary for the model to match the firing behavior of the P-units. The effect that without the low pass filter the model is not able to match the VS and locks to strongly to the EOD was confirmed from \cite{walz2013Phd}. While the new addition of the refractory period $t_{ref}$ is necessary for the model to deviate from the Gaussian firing probability and show bursting behavior.
With these additions behavior of the cells was generally matched well by the models with very similar final distributions but there were some limitations. For cells with a high burstiness or a high coefficient of variation the models could not fully match the cells. This may be caused by cells as seen in figure \ref{fig:example_bad_isi_fits} \textbf{A} and \textbf{B}. These cells high values In both burstiness and CV. In the case of fig. \ref{fig:example_bad_isi_fits} \textbf{A} the model can show this type firing behavior but it seems difficult to reach the parameter configuration needed with the fitting approach used here. In contrast to that the firing behavior of the cells in fig. \ref{fig:example_bad_isi_fits} \textbf{B} and \textbf{C} are not possible for the model in its current form. The addition of the refractory period $t_{ref}$ does not also allow for an increased firing probability at the 2nd EOD period and the cell \textbf{C} shows a higher order structure in its ISI histogram on a comparatively long timescale which this simple model cannot reproduce. % These kind of cells showing higher order structure in their ISI histogram are rare but might provide interesting insights in the physiological properties of P-units when further studied.
Two firing properties had a high spread in the fitted models. In the serial correlation the models had a tendency to underestimate the cells SC. The second property was the slope of the $f_0$ response. Here one possible source is that the fitted Boltzmann function and its slope are quite sensitive to mis detections so especially for steep slopes a change in the detected frequency for a contrast can strongly influence the slope of the Boltzmann function. Also unlike the baseline firing properties there don't seem to be cases in which the model cannot fit the cell the cases shown in figure \ref{fig:example_bad_fi_fits} are both generally possible so improvements in the cost function and fitting routine should also further improve the model consistency for the adaption responses.
Comparing the correlation between the firing properties of the data and the models showed clear discrepancies (fig. \ref{fig:behavior_correlations}) with four additional and one missing significant correlation. The added correlation between bursts and baseline firing rate could be a result of the slightly stronger correlations of CV-base rate and bursts-CV but it may also be caused by the problems of fitting strongly bursting cells with a long pause between bursts that would have a lower firing rate even with a high burstiness. The correlation between $f_0$ slope-base rate might also be chain correlation caused by a slight increase in the correlations between $f_\infty$ slope-base rate and $f_\infty$ slope-$f_0$ slope. The other two added correlations are between the SC and the base rate as well as the $f_\infty$ slope, where the first may again cause the second because of the $f_\infty$-base rate correlation.
Finally the one missing correlation in the models is the one between base rate and VS, which is an unexpected correlation.
This was also looked at in \cite{walz2013Phd} but only 23 cells were used and they were exclusively non bursting cells which makes a direct comparison difficult. The data showed the SC-base rate correlation which is shown by the models in this work which might indicate that the highest bursting cells that are not fitted well, "remove" this correlation from the population in the data or that there is not enough data to robustly define the correlation. The data there also only showed four correlations in total: SC-base rate, $f_\infty$ slope-CV, $f_0$ slope-CV and $f_\infty$ slope -$f_0$ slope.
The parameters of the fitted models also showed extensive correlations between each other. This is an indication of strong compensation effects between them \citep{olypher2007using}. Especially for the input gain $\alpha$ and the bias current $I_{Bias}$ that have a nearly perfect correlation and together control the models baseline firing rate. Notably is also that the refractory period $t_{ref}$ is the only completely independent variable. This might show a certain independence between the strength of the burstiness and the other firing characteristics, which could be more closely investigated by looking at the sensitivity of models firing properties to changes in $t_{ref}$.
The correlations and the estimated parameter distributions were used form of their covariances to draw random parameter set from a multivariante normal distribution. The drawn parameters show the expected distributions but also show slightly different correlations. That could mean that the \todo{number} models used to calculate them were to few to give enough statistical power to the correct estimation of all correlations. Drawing more models and compensating for the increase in power showed that the involved correlations stay inconsistent, which points to an uncertainty already in the covariance matrix. This could also be further investigated with a robustness analysis, so the reliability of the calculated covariances can be estimated.
The firing behavior shown by the drawn models on the other hand fits the ones of the data quite well except for the VS, where it is consistently underestimating the VS of the data.
%Previous studies limited themselves in the P-unit behavior that was modeled.
% \cite{kashimori1996model} introduced a conductances based model but the estimation of variables is difficult because of the little experimental data that is available.
%In \cite{chacron2001simple} two P-units were modeled considering only the baseline behaviour with one bursty cell and one regularly firing one as representatives.
In general the model is the first that takes the burstiness as a continuum into account and seems to be able to accurately describe the firing behavior in a large part of the behavior space of the P-units. But further testing is required to get a clearer picture where and why discrepancies exist. In this work it wasn't possible to verify the models with a different type of stimulus. For this a stimulus with random or sinusoidal amplitude modulations could be used. The correlations also need further investigation a first step could be a robustness test to see if there are correlations that are not well characterized in both the cells and the models.
\newpage
\subsection*{Fitting quality} \subsection*{Fitting quality}
\begin{itemize} \begin{itemize}

View File

@ -273,6 +273,18 @@
year={1961} year={1961}
} }
@article{olypher2007using,
title={Using constraints on neuronal activity to reveal compensatory changes in neuronal parameters},
author={Olypher, Andrey V and Calabrese, Ronald L},
journal={Journal of Neurophysiology},
volume={98},
number={6},
pages={3749--3758},
year={2007},
publisher={American Physiological Society}
}