updating summary

This commit is contained in:
saschuta 2024-05-29 17:27:31 +02:00
parent 9add8c9035
commit 04faafed58
17 changed files with 2551 additions and 67 deletions

Binary file not shown.

View File

@ -6,7 +6,10 @@ import pandas as pd
from IPython import embed
from matplotlib import gridspec, pyplot as plt
from plotstyle import plot_style
try:
from plotstyle import plot_style, spines_params
except:
print('plotstyle not installed')
from threefish.core_plot_subplots import plot_lowpass2, plt_single_square_modl, plt_time_arrays
from threefish.core_plot_suscept import perc_model_full, plt_data_susept
from threefish.core_filenames import overlap_cells

View File

@ -2317,6 +2317,17 @@ article{Egerland2020,
publisher={Taylor \& Francis}
}
@article{French1976,
title={Practical nonlinear system analysis by {Wiener} kernel estimation in the frequency domain},
author={French, AS},
journal={Biological Cybernetics},
volume={24},
number={2},
pages={111--119},
year={1976},
publisher={Springer}
}
@article{Marmarelis1999,
title={Principal dynamic mode analysis of nonlinear transduction in a spider mechanoreceptor},
author={Marmarelis, Vasilis Z and Juusola, Mikko and French, Andrew S},
@ -6506,6 +6517,50 @@ groups and electrogenic mechanisms.},
PAGES = {57--66}
}
@article{Victor1977,
title={Nonlinear analysis of cat retinal ganglion cells in the frequency domain.},
author={Victor, Jonathan D and Shapley, Robert M and Knight, Bruce W},
journal={Proceedings of the National Academy of Sciences},
volume={74},
number={7},
pages={3068--3072},
year={1977},
publisher={National Acad Sciences}
}
@article{Victor1980,
title={A method of nonlinear analysis in the frequency domain},
author={Victor, J and Shapley, R},
journal={Biophysical Journal},
volume={29},
number={3},
pages={459--483},
year={1980},
publisher={Elsevier}
}
@article{Victor1979,
title={Nonlinear systems analysis: comparison of white noise and sum of sinusoids in a biological system.},
author={Victor, Jonathan D},
journal={Proceedings of the National Academy of Sciences},
volume={76},
number={2},
pages={996--998},
year={1979},
publisher={National Acad Sciences}
}
@article{Shapley1978,
title={The effect of contrast on the transfer properties of cat retinal ganglion cells.},
author={Shapley, Robert M and Victor, Jonathan D},
journal={The Journal of physiology},
volume={285},
number={1},
pages={275--298},
year={1978},
publisher={Wiley Online Library}
}
@article{Wen2009,
title={Dynamic range adaptation to sound level statistics in the auditory nerve},
author={Wen, Bo and Wang, Grace I and Dean, Isabel and Delgutte, Bertrand},

View File

@ -2317,6 +2317,17 @@ article{Egerland2020,
publisher={Taylor \& Francis}
}
@article{French1976,
title={Practical nonlinear system analysis by {Wiener} kernel estimation in the frequency domain},
author={French, AS},
journal={Biological Cybernetics},
volume={24},
number={2},
pages={111--119},
year={1976},
publisher={Springer}
}
@article{Marmarelis1999,
title={Principal dynamic mode analysis of nonlinear transduction in a spider mechanoreceptor},
author={Marmarelis, Vasilis Z and Juusola, Mikko and French, Andrew S},

View File

@ -529,7 +529,7 @@ Nonlinear processes are key to neuronal information processing. Decision making
\notejb{For the estimation problem we need to cite work that also measured higher order Wiener kernels and filters (we need to find the Andrew French paper, who else? Gabbiani? John Miller?). For nonlinear encoding we need to talk about linear-nonlinear models (Chinchilinsky, Gollisch, Jan Clemens) versus Wiener series (French). And we find nonlinear responses in neurons that have been considered as quite linear, but only at specific frequency combinations and low signal amplitudes.}
\noteab{Nonlinearity has been measured considering a system approach starting with wiener kernels \cite{French1973,French1976,French 2019} in response to white noise stimulation. In addition the nonlinearity of a system has been addressed by pure sinewave simulation under usage of the Volterra series \cite{Victor1977,Victor1980,Shapley1979}.Nonlinearity was also of interest beyond the system approach when the quadratic phase coupling of two input requencies was investigated \cite{ Nikias1993}. With this approaches nonlinearity at the sum of two input frequencies was quantified in retinal cells \cite{Shapley1979} for stimuli with small amplitudes, in ampullary cells \cite{ Neimann}, in the EEG of sleep \cite{ Barnett1971,Bullock1997, Johnosn1967} and in mechanorecetors of spiders \cite{ French 2019}. Although this has also addressed stimuli for small amplitudes it has to be considered that for white noise stimuli this might have had not the sufficient number of trials \cite{French1976}, still for pure sinewave stimulation this should have been sufficient \cite{Shapley1979}. Especially these last works are interesting for us sind they were also applied on amplitude modulated signals. What was less the focus were the low CVs.}
\noteab{The nonlinearity of a system has been accessed with the use of wiener kernels \cite{French1973,French1976}, measuring the system response to white noise stimulation. Besides that the nonlinearity of a system has been addressed by pure sinewave simulation, considering the Fourier transform of the Volterra series \cite{Victor1977,Victor1980,Shapley1979}. The estimates of the nonlinearity with both methods, white noise and sinewave stimulation, was shown to yield similar results \cite{Vitor1979}. Nonlinearity was investigated, not addressing the system properties, but focusing on the quadratic phase coupling of the two input frequencies \cite{Nikias1993, Neiman2011fish}. With these approaches nonlinearity at the sum of two input frequencies was quantified in retinal cells \cite{Shapley1979} for stimuli with small amplitudes, in ampullary cells \cite{Neiman2011fish}, in the EEG of sleep \cite{Barnett1971,Bullock1997} and in mechanorecetors \cite{French1976}. Second-order responses have been quantified in not amplitude modulated \cite{Neiman2011fish} and amplitude modulated systems \cite{Victor1977,Victor1980,Shapley1979}.}
While the encoding of signals can often be well described by linear models in the sensory periphery\cite{Machens2001}, this is not true for many upstream neurons. Rather, nonlinear processes are implemented to extract special stimulus features\cite{Adelson1985,Gabbiani1996,Olshausen1996,Gollisch2009}. In active electrosensation, the self-generated electric field (electric organ discharge, EOD) that is quasi sinusoidal in wavetype electric fish acts as the carrier signal that is amplitude modulated in the context of communication\cite{Walz2014, Henninger2018, Benda2020}, object detection and navigation\cite{Fotowat2013, Nelson1999}. In social contexts, the interference of the EODs of two interacting animals result in a characteristic periodic amplitude modulation, the so-called beat. The beat amplitude is defined by the smaller EOD amplitude, its frequency is defined as the difference between the two EOD frequencies ($\Delta f = f-\feod{}$, valid for $f < \feod{}/2$)\cite{Barayeu2023}. Cutaneous electroreceptor organs that are distributed over the bodies of these fish \cite{Carr1982} are tuned to the own field\cite{Hopkins1976,Viancour1979}. Probability-type electroreceptor afferents (P-units) innervate these organs via ribbon synapses\cite{Szabo1965, Wachtel1966} and project to the hindbrain where they trifurcate and synapse onto pyramidal cells in the electrosensory lateral line lobe (ELL)\cite{Krahe2014}. The P-units of the gymnotiform electric fish \lepto{} encode such amplitude modulations (AMs) by modulation of their firing rate\cite{Gabbiani1996}. They fire probabilistically but phase-locked to the own EOD and the skipping of cycles leads to their characteristic multimodal interspike-interval distribution. Even though the extraction of the AM itself requires a nonlinearity\cite{Middleton2006,Stamper2012Envelope,Savard2011,Barayeu2023} encoding the time-course of the AM is linear over a wide range of AM amplitudes and frequencies\cite{Xu1996,Benda2005,Gussin2007,Grewe2017,Savard2011}. In the context of social signalling among three fish we observe an AM of the AM, also referred to as second-order envelope or just social envelope\cite{Middleton2006, Savard2011, Stamper2012Envelope}. Encoding this again requires nonlinearities\cite{Middleton2006} and it was shown that a subpopulation of P-units are sensitive to envelopes\cite{Savard2011} and exhibit nonlinearities e.g. when driven by strong stimuli\cite{Nelson1997,Chacron2004}.

View File

@ -514,7 +514,6 @@
\notejg{Cite Schlungbaum in introduction}
\section*{Introduction}
%with nonlinearities being observed in all sensory modalities
@ -523,12 +522,16 @@ Nonlinear processes are key to neuronal information processing. Decision making
\notejb{Wo genau soll die Einleitung hinzielen? Das ist bis jetzt eine Ansammlung von Aussagen zum Thema nonlinearities und irgendwie schleicht sich da der Fisch noch rein.}
\notejb{What are the main findings of the manuscript? (i) 2nd order susceptibility can be measured using RAM stimuli, (ii) we see a bit of nonlinearity in low-CV P-units and strong one in ampullary cells. (iii) There is an estimation problem because of low N and RAM stimulus introducing linearizing noise. (iii) noise split gives a good estimate that translates well to pure sine wave stimulation.}
\notejb{What are the main findings of the manuscript? (i) 2nd order susceptibility can be measured using RAM stimuli, (ii) we see a bit of nonlinearity in low-CV P-units and strong one in ampullary cells. (ii) We find stuff, that matches the theoretical predictions (Voronekov) (iii) AMs with carrier (auditory) (iv) There is an estimation problem because of low N and RAM stimulus introducing linearizing noise. (v) noise split gives a good estimate that translates well to pure sine wave stimulation.}
\notejb{Strong aspects are (i) how to estimate 2nd order susceptibilities, (ii) what do they tell us about relevant stimuli, (iii) nonlinearities show up only for very specific frequencies}
\notejb{For the estimation problem we need to cite work that also measured higher order Wiener kernels and filters (we need to find the Andrew French paper, who else? Gabbiani? John Miller?). For nonlinear encoding we need to talk about linear-nonlinear models (Chinchilinsky, Gollisch, Jan Clemens) versus Wiener series (French). And we find nonlinear responses in neurons that have been considered as quite linear, but only at specific frequency combinations and low signal amplitudes.}
\noteab{The nonlinearity of a system has been accessed with the use of wiener kernels \cite{French1973,French1976}, measuring the system response to white noise stimulation. Besides that the nonlinearity of a system has been addressed by pure sinewave simulation, considering the Fourier transform of the Volterra series \cite{Victor1977,Victor1980,Shapley1979}. The estimates of the nonlinearity with both methods, white noise and sinewave stimulation, was shown to yield similar results \cite{Vitor1979}. Nonlinearity was investigated, not addressing the system properties, but focusing on the quadratic phase coupling of the two input frequencies \cite{Nikias1993, Nieman}. With these approaches nonlinearity at the sum of two input frequencies was quantified in retinal cells \cite{Shapley1979} for stimuli with small amplitudes, in ampullary cells \cite{Neimann}, in the EEG of sleep \cite{Barnett1971,Bullock1997, Johnosn1967} and in mechanorecetors of spiders \cite{French 2019}. Second-order responses have been quantified in not amplitude modulated \cite{Neimann} and amplitude modulated systesm \cite{Victor1977,Victor1980,Shapley1979}.}
While the encoding of signals can often be well described by linear models in the sensory periphery\cite{Machens2001}, this is not true for many upstream neurons. Rather, nonlinear processes are implemented to extract special stimulus features\cite{Adelson1985,Gabbiani1996,Olshausen1996,Gollisch2009}. In active electrosensation, the self-generated electric field (electric organ discharge, EOD) that is quasi sinusoidal in wavetype electric fish acts as the carrier signal that is amplitude modulated in the context of communication\cite{Walz2014, Henninger2018, Benda2020}, object detection and navigation\cite{Fotowat2013, Nelson1999}. In social contexts, the interference of the EODs of two interacting animals result in a characteristic periodic amplitude modulation, the so-called beat. The beat amplitude is defined by the smaller EOD amplitude, its frequency is defined as the difference between the two EOD frequencies ($\Delta f = f-\feod{}$, valid for $f < \feod{}/2$)\cite{Barayeu2023}. Cutaneous electroreceptor organs that are distributed over the bodies of these fish \cite{Carr1982} are tuned to the own field\cite{Hopkins1976,Viancour1979}. Probability-type electroreceptor afferents (P-units) innervate these organs via ribbon synapses\cite{Szabo1965, Wachtel1966} and project to the hindbrain where they trifurcate and synapse onto pyramidal cells in the electrosensory lateral line lobe (ELL)\cite{Krahe2014}. The P-units of the gymnotiform electric fish \lepto{} encode such amplitude modulations (AMs) by modulation of their firing rate\cite{Gabbiani1996}. They fire probabilistically but phase-locked to the own EOD and the skipping of cycles leads to their characteristic multimodal interspike-interval distribution. Even though the extraction of the AM itself requires a nonlinearity\cite{Middleton2006,Stamper2012Envelope,Savard2011,Barayeu2023} encoding the time-course of the AM is linear over a wide range of AM amplitudes and frequencies\cite{Xu1996,Benda2005,Gussin2007,Grewe2017,Savard2011}. In the context of social signalling among three fish we observe an AM of the AM, also referred to as second-order envelope or just social envelope\cite{Middleton2006, Savard2011, Stamper2012Envelope}. Encoding this again requires nonlinearities\cite{Middleton2006} and it was shown that a subpopulation of P-units are sensitive to envelopes\cite{Savard2011} and exhibit nonlinearities e.g. when driven by strong stimuli\cite{Nelson1997,Chacron2004}.
\begin{figure*}[t]

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -75,10 +75,7 @@ def trialnr(nffts=['whole'], powers=[1], contrasts=[0], noises_added=[''], D_ext
perc = 'perc'
lp = 2
label_model = r'Nonlinearity $\frac{1}{S}$'
for all in it.product(*iternames):
var_type, stim_type_afe, stim_type_noise, power, nfft, dendrid, cut_off1, trial_nrs, c_sig, c_noise, ref_type, adapt_type, noise_added, extract, a_fr, a_fe = all
# print(trials_stim,stim_type_noise, power, nfft, a_fe,a_fr, dendrid, var_type, cut_off1,trial_nrs)
fig = plt.figure()
hs = 0.45
@ -98,8 +95,21 @@ def trialnr(nffts=['whole'], powers=[1], contrasts=[0], noises_added=[''], D_ext
# for trial in trials:#.009
trial_nr = 1000000#1000000
trial_nrs_here = trial_nrs_ram_model()
# 'calc_RAM_model-2__nfft_whole_power_1_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_5000000_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV'
# 'calc_RAM_model-2__nfft_whole_power_1_afe_0.009_RAM_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_11_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',
# 'calc_RAM_model-2__nfft_whole_power_1_afe_0.009_RAM_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_500000_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',
fig, ax = plt.subplots(1, 1)
ax = [ax]
alphas = [1, 0.5]
colors = ['black', 'red']
for s in range(2):
stacks = []
perc95 = []
perc90 = []
vars = []
cv_stims = []
fr_stims = []
@ -109,25 +119,24 @@ def trialnr(nffts=['whole'], powers=[1], contrasts=[0], noises_added=[''], D_ext
perc95_wo_norm = []
perc05_wo_norm = []
median_wo_norm = []
counter = []
for tr in trial_nrs_here:
save_names = [
'calc_RAM_model-2__nfft_whole_power_1_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_'+str(tr)+'_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',]
#'calc_RAM_model-2__nfft_whole_power_1_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_5000000_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV'
#'calc_RAM_model-2__nfft_whole_power_1_afe_0.009_RAM_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_11_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',
#'calc_RAM_model-2__nfft_whole_power_1_afe_0.009_RAM_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_500000_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',
'calc_RAM_model-2__nfft_whole_power_1_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_' + str(
tr) + '_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',
'calc_RAM_model-3__nfft_whole_power_1_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_' + str(
tr) + '_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV']
nrs_s = [3, 4, 8, 9]#, 10, 11
save_name = save_names[s]
#embed()
tr_name = trial_nr/1000000
if tr_name == 1:
tr_name = 1
ax_model = []
for s, sav_name in enumerate(save_names):
save_name = find_folder_name('calc_model') + '/' + sav_name
save_name = find_folder_name('calc_model') + '/' + save_name
cell_add, cells_save = title_find_cell_add(cells_given)
perc = 'perc'
@ -140,15 +149,20 @@ def trialnr(nffts=['whole'], powers=[1], contrasts=[0], noises_added=[''], D_ext
# im = plt_RAM_perc(ax, perc, np.abs(stack))
#
stack = load_model_susept(path, cells_save, save_name.split(r'/')[-1] + cell_add)
if len(stack)> 0:
model_show, stack_plot, stack_plot_wo_norm = get_stack(cell, stack)
stacks.append(stack_plot)
#em
if 'counter_validate' in stack.keys():
counter.append(stack['counter_validate'].iloc[0])
else:
counter.append(float('nan'))
cv_stims.append(stack['cv_stim_mean'].iloc[0])
fr_stims.append(stack['fr_stim_mean'].iloc[0])
vars.append(stack['var_RAM'].iloc[0])
perc95.append(np.percentile(stack_plot,99.99))
perc90.append(np.percentile(stack_plot, 10))
perc05.append(np.percentile(stack_plot, 10))
median.append(np.percentile(stack_plot, 50))
stacks_wo_norm.append(stack_plot_wo_norm)
@ -162,6 +176,7 @@ def trialnr(nffts=['whole'], powers=[1], contrasts=[0], noises_added=[''], D_ext
fr_stims.append(float('nan'))
stacks.append([])
perc95.append(float('nan'))
perc90.append(float('nan'))
perc05.append(float('nan'))
median.append(float('nan'))
@ -169,22 +184,15 @@ def trialnr(nffts=['whole'], powers=[1], contrasts=[0], noises_added=[''], D_ext
perc95_wo_norm.append(float('nan'))
perc05_wo_norm.append(float('nan'))
median_wo_norm.append(float('nan'))
#embed()
test = False
if test:
fig, ax = plt.subplots(1,3)
ax[0].plot(trial_nrs_here,cv_stims/trial_nrs_here)
ax[1].plot(trial_nrs_here, fr_stims / trial_nrs_here)
ax[2].plot(trial_nrs_here, vars / trial_nrs_here)
plt.show()
counter.append(float('nan'))
# vars, cv_stims, fr_stims
fig, ax = plt.subplots(1,2)
print((np.array(counter)+1)/trial_nrs_here)
embed()
#ax.plot(trial_nrs_here, perc05, color = 'grey')
ax[0].plot(trial_nrs_here, perc95, color = 'grey', clip_on = False, label = '99.99th percentile')
ax[0].plot(trial_nrs_here, perc95, color = colors[s], clip_on = False, label = '99.99th percentile', alpha = alphas[s])
#ax.plot(trial_nrs_here, median, color = 'black', label = 'median')
#ax.scatter(trial_nrs_here, perc05, color = 'grey')
ax[0].scatter(trial_nrs_here, perc95, color = 'black', clip_on = False)
ax[0].scatter(trial_nrs_here, perc95, color = colors[s], clip_on = False, alpha = alphas[s])
ax[0].set_xscale('log')
ax[0].set_yscale('log')
ax[0].set_xlabel('Trials [$N$]')
@ -192,13 +200,17 @@ def trialnr(nffts=['whole'], powers=[1], contrasts=[0], noises_added=[''], D_ext
ax[0].legend()
############################################
ax[1].plot(trial_nrs_here, perc05, color='grey', clip_on=False, label = '10th percentile')
ax[1].scatter(trial_nrs_here, perc05, color='black', clip_on=False)
ax[1].set_xscale('log')
ax[1].set_yscale('log')
ax[1].set_xlabel('Trials [$N$]')
ax[1].set_ylabel('$\chi_{2}$\,[Hz]')
ax[1].legend()
ax[0].plot(trial_nrs_here, perc05, color='grey', clip_on=False, label = '10th percentile', alpha = alphas[s])
ax[0].scatter(trial_nrs_here, perc05, color='grey', clip_on=False, alpha = alphas[s])
ax[0].plot(trial_nrs_here, perc05, color='grey', clip_on=False, label='10th percentile', alpha = alphas[s])
ax[0].scatter(trial_nrs_here, perc05, color='grey', clip_on=False, alpha = alphas[s])
#ax[0].set_xscale('log')
#ax[0].set_yscale('log')
#ax[0].set_xlabel('Trials [$N$]')
#ax[0].set_ylabel('$\chi_{2}$\,[Hz]')
#ax[0].legend()
''' ax = plt.subplot(1,3,2)
ax.plot(trial_nrs_here, perc05_wo_norm, color = 'grey')