diff --git a/plotting/code/errorbarplot.m b/plotting/code/errorbarplot.m new file mode 100644 index 0000000..6910d1e --- /dev/null +++ b/plotting/code/errorbarplot.m @@ -0,0 +1,43 @@ +% fake some data +x_data = 0:2*pi/10:2*pi; +sym_data = sin(repmat(x_data, 10,1)) * 0.75 + (randn(10, length(x_data)) .* cos(repmat(x_data, 10,1))); +asym_data = sin(repmat(x_data, 10,1)) * 0.75 + (randn(10, length(x_data)) .* cos(repmat(x_data, 10,1)) + 0.5); + +% get some data characteristics +avg_sym = mean(sym_data, 1); +err_sym = std(sym_data, [], 1); +avg_asym = median(asym_data, 1); +err_upper_asym = prctile(asym_data, 75, 1); +err_lower_asym = prctile(asym_data, 25, 1); + +fig = figure(); +set(fig, 'paperunits', 'centimeters', 'papersize', [15 6.5], ... + 'paperposition', [0.0 0.0 15, 6.5], 'color', 'white') +subplot(1,3,1) +errorbar(x_data, avg_sym, err_sym, 'marker', 'o') +xlim([-.5, 6.5]) +xlabel('x-data') +ylabel('y-data') +box('off') + +subplot(1,3,2) +errorbar(x_data, avg_asym, err_lower_asym, err_upper_asym, 'marker', 'o') +xlim([-.5, 6.5]) +yticklabels([]) +xlabel('x-data') +box('off') + +subplot(1,3,3) +hold on +p = fill(cat(2, x_data, fliplr(x_data)), ... + cat(2, avg_sym - err_sym, fliplr(avg_sym + err_sym)), ... + 'b'); +p.FaceAlpha = 0.125; +p.EdgeColor = 'w'; +xlim([-.5, 6.5]) +yticklabels([]) +box('off') +xlabel('x-data') +plot(x_data, avg_sym, 'b', 'linewidth', 1.) + +saveas(fig, '../lecture/images/errorbars', 'pdf') diff --git a/plotting/lecture/images/errorbars.pdf b/plotting/lecture/images/errorbars.pdf new file mode 100644 index 0000000..49ade7a Binary files /dev/null and b/plotting/lecture/images/errorbars.pdf differ diff --git a/projects/project_onset_fi/Makefile b/projects/project_ficurves/Makefile similarity index 100% rename from projects/project_onset_fi/Makefile rename to projects/project_ficurves/Makefile diff --git a/projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_-14.mat b/projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_-14.mat similarity index 100% rename from projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_-14.mat rename to projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_-14.mat diff --git a/projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_-18.mat b/projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_-18.mat similarity index 100% rename from projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_-18.mat rename to projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_-18.mat diff --git a/projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_-2.mat b/projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_-2.mat similarity index 100% rename from projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_-2.mat rename to projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_-2.mat diff --git a/projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_-6.mat b/projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_-6.mat similarity index 100% rename from projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_-6.mat rename to projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_-6.mat diff --git a/projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_-9.mat b/projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_-9.mat similarity index 100% rename from projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_-9.mat rename to projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_-9.mat diff --git a/projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_12.mat b/projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_12.mat similarity index 100% rename from projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_12.mat rename to projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_12.mat diff --git a/projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_15.mat b/projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_15.mat similarity index 100% rename from projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_15.mat rename to projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_15.mat diff --git a/projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_2.mat b/projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_2.mat similarity index 100% rename from projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_2.mat rename to projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_2.mat diff --git a/projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_5.mat b/projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_5.mat similarity index 100% rename from projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_5.mat rename to projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_5.mat diff --git a/projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_9.mat b/projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_9.mat similarity index 100% rename from projects/project_onset_fi/data/p_unit_2012-03-30-aa_fi_curve_9.mat rename to projects/project_ficurves/data/p_unit_2012-03-30-aa_fi_curve_9.mat diff --git a/projects/project_ficurves/ficurves.tex b/projects/project_ficurves/ficurves.tex new file mode 100644 index 0000000..7bfba31 --- /dev/null +++ b/projects/project_ficurves/ficurves.tex @@ -0,0 +1,73 @@ +\documentclass[a4paper,12pt,pdftex]{exam} + +\newcommand{\ptitle}{F-I curves} +\input{../header.tex} +\firstpagefooter{Supervisor: Jan Grewe}{phone: 29 74588}% +{email: jan.grewe@uni-tuebingen.de} + +\begin{document} + +\input{../instructions.tex} + + +%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%% +\section{Quantifying the responsiveness of a neuron by its F-I curves} +The responsiveness of a neuron is often quantified using an F-I +curve. The F-I curve plots the \textbf{F}iring rate of the neuron as a +function of the stimulus \textbf{I}ntensity. + +\begin{questions} + \question In the accompanying datasets you find the + \textit{spike\_times} of an P-unit electroreceptor of the weakly + electric fish \textit{Apteronotus leptorhynchus} to a stimulus of a + certain intensity, i.e. the \textit{contrast}. The spike times are + given in milliseconds relative to the stimulus onset. + \begin{parts} + \part For each stimulus intensity estimate the average response + (PSTH) and plot it. You will see that there are three parts. (i) + The first 200\,ms is the baseline (no stimulus) activity. (ii) + During the next 1000\,ms the stimulus was switched on. (iii) After + stimulus offset the neuronal activity was recorded for further + 825\,ms. + + \part Extract the neuron's activity for every 50\,ms after + stimulus onset and for one 50\,ms slice before stimulus onset. + + For each time slice plot the resulting F-I curve by plotting the + computed firing rates against the corresponding stimulus + intensity, respectively the contrast. + + \part Fit a Boltzmann function to each of the F-I-curves. The + Boltzmann function is a sigmoidal function and is defined as + \begin{equation} + f(x) = \frac{\alpha-\beta}{1+e^{-k(x-x_0)}}+\beta \; . + \end{equation} + $x$ is the stimulus intensity, $\alpha$ is the starting + firing rate, $\beta$ the saturation firing rate, $x_0$ defines the + position of the sigmoid, and $k$ (together with $\alpha-\beta$) + sets the slope. + + Before you do the fitting, familiarize yourself with the four + parameter of the Boltzmann function. What is its value for very + large or very small stimulus intensities? How does the Boltzmann + function change if you change either of the parameter? + + How could you get good initial estimates for the parameter? + + Do the fits and show the resulting Boltzmann functions together + with the corresponding data. + + \part Illustrate how the F-I curves change in time also by means + of the parameter you obtained from the fits with the Boltzmann + function. + + Which parameter stay the same, which ones change with time? + + Support your conclusion with appropriate statistical tests. + + \part Discuss you results with respect to encoding of different + stimulus intensities. + \end{parts} +\end{questions} + +\end{document} diff --git a/projects/project_onset_fi/solution/boltzmannFit.m b/projects/project_ficurves/solution/boltzmannFit.m similarity index 100% rename from projects/project_onset_fi/solution/boltzmannFit.m rename to projects/project_ficurves/solution/boltzmannFit.m diff --git a/projects/project_onset_fi/solution/boltzmannModel.m b/projects/project_ficurves/solution/boltzmannModel.m similarity index 100% rename from projects/project_onset_fi/solution/boltzmannModel.m rename to projects/project_ficurves/solution/boltzmannModel.m diff --git a/projects/project_onset_fi/solution/convolutionRate.m b/projects/project_ficurves/solution/convolutionRate.m similarity index 100% rename from projects/project_onset_fi/solution/convolutionRate.m rename to projects/project_ficurves/solution/convolutionRate.m diff --git a/projects/project_onset_fi/solution/getFICurve.m b/projects/project_ficurves/solution/getFICurve.m similarity index 100% rename from projects/project_onset_fi/solution/getFICurve.m rename to projects/project_ficurves/solution/getFICurve.m diff --git a/projects/project_onset_fi/solution/getFiringRates.m b/projects/project_ficurves/solution/getFiringRates.m similarity index 100% rename from projects/project_onset_fi/solution/getFiringRates.m rename to projects/project_ficurves/solution/getFiringRates.m diff --git a/projects/project_onset_fi/solution/main.m b/projects/project_ficurves/solution/main.m similarity index 100% rename from projects/project_onset_fi/solution/main.m rename to projects/project_ficurves/solution/main.m diff --git a/projects/project_onset_fi/solution/plotAverageResponse.m b/projects/project_ficurves/solution/plotAverageResponse.m similarity index 100% rename from projects/project_onset_fi/solution/plotAverageResponse.m rename to projects/project_ficurves/solution/plotAverageResponse.m diff --git a/projects/project_onset_fi/solution/plotFICurve.m b/projects/project_ficurves/solution/plotFICurve.m similarity index 100% rename from projects/project_onset_fi/solution/plotFICurve.m rename to projects/project_ficurves/solution/plotFICurve.m diff --git a/projects/project_onset_fi/solution/plotFICurveFit.m b/projects/project_ficurves/solution/plotFICurveFit.m similarity index 100% rename from projects/project_onset_fi/solution/plotFICurveFit.m rename to projects/project_ficurves/solution/plotFICurveFit.m diff --git a/projects/project_onset_fi/onset_fi.tex b/projects/project_onset_fi/onset_fi.tex deleted file mode 100644 index 94be9b5..0000000 --- a/projects/project_onset_fi/onset_fi.tex +++ /dev/null @@ -1,47 +0,0 @@ -\documentclass[a4paper,12pt,pdftex]{exam} - -\newcommand{\ptitle}{Onset f-I curve} -\input{../header.tex} -\firstpagefooter{Supervisor: Jan Grewe}{phone: 29 74588}% -{email: jan.grewe@uni-tuebingen.de} - -\begin{document} - -\input{../instructions.tex} - - -%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%% -\section{Quantifying the responsiveness of a neuron by its F-I curve} -The responsiveness of a neuron is often quantified using an F-I -curve. The F-I curve plots the \textbf{F}iring rate of the neuron as a -function of the stimulus \textbf{I}ntensity. - -\begin{questions} - \question In the accompanying datasets you find the - \textit{spike\_times} of an P-unit electroreceptor of the weakly - electric fish \textit{Apteronotus leptorhynchus} to a stimulus of a - certain intensity, i.e. the \textit{contrast}. The spike times are - given in milliseconds relative to the stimulus onset. - \begin{parts} - \part For each stimulus intensity estimate the average response - (PSTH) and plot it. You will see that there are three parts. (i) - The first 200\,ms is the baseline (no stimulus) activity. (ii) - During the next 1000\,ms the stimulus was switched on. (iii) After - stimulus offset the neuronal activity was recorded for further - 825\,ms. - \part Extract the neuron's activity in the first 50\,ms after - stimulus onset and plot it against the stimulus intensity, - respectively the contrast, in an appropriate way. - \part Fit a Boltzmann function to the FI-curve. The Boltzmann function - is defined as: - \begin{equation} - y=\frac{\alpha-\beta}{1+e^{(x-x_0)/\Delta x}}+\beta, - \end{equation} - where $\alpha$ is the starting firing rate, $\beta$ the saturation - firing rate, $x$ the current stimulus intensity, $x_0$ starting - stimulus intensity, and $\Delta x$ a measure of the slope. - \part Plot the fit into the data. - \end{parts} -\end{questions} - -\end{document} diff --git a/projects/project_steady_state_fi/Makefile b/projects/project_steady_state_fi/Makefile deleted file mode 100644 index a7b3726..0000000 --- a/projects/project_steady_state_fi/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -ZIPFILES= - -include ../project.mk diff --git a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-14.mat b/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-14.mat deleted file mode 100644 index ae0d020..0000000 Binary files a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-14.mat and /dev/null differ diff --git a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-18.mat b/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-18.mat deleted file mode 100644 index 13b040c..0000000 Binary files a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-18.mat and /dev/null differ diff --git a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-2.mat b/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-2.mat deleted file mode 100644 index be7a520..0000000 Binary files a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-2.mat and /dev/null differ diff --git a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-6.mat b/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-6.mat deleted file mode 100644 index d2ddde6..0000000 Binary files a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-6.mat and /dev/null differ diff --git a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-9.mat b/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-9.mat deleted file mode 100644 index d8d910f..0000000 Binary files a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_-9.mat and /dev/null differ diff --git a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_12.mat b/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_12.mat deleted file mode 100644 index f87fa0c..0000000 Binary files a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_12.mat and /dev/null differ diff --git a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_15.mat b/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_15.mat deleted file mode 100644 index 678173f..0000000 Binary files a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_15.mat and /dev/null differ diff --git a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_2.mat b/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_2.mat deleted file mode 100644 index 2af9e8b..0000000 Binary files a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_2.mat and /dev/null differ diff --git a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_5.mat b/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_5.mat deleted file mode 100644 index f999e5d..0000000 Binary files a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_5.mat and /dev/null differ diff --git a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_9.mat b/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_9.mat deleted file mode 100644 index ac3a369..0000000 Binary files a/projects/project_steady_state_fi/data/p_unit_2012-03-30-aa_fi_curve_9.mat and /dev/null differ diff --git a/projects/project_steady_state_fi/steady_state_fi.tex b/projects/project_steady_state_fi/steady_state_fi.tex deleted file mode 100644 index abba436..0000000 --- a/projects/project_steady_state_fi/steady_state_fi.tex +++ /dev/null @@ -1,45 +0,0 @@ -\documentclass[a4paper,12pt,pdftex]{exam} - -\newcommand{\ptitle}{Steady-state f-I curve} -\input{../header.tex} -\firstpagefooter{Supervisor: Jan Grewe}{phone: 29 74588}% -{email: jan.grewe@uni-tuebingen.de} - -\begin{document} - -\input{../instructions.tex} - - -%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%% -\section*{Quantifying the responsiveness of a neuron using the F-I curve.} -The responsiveness of a neuron is often quantified using an F-I -curve. The F-I curve plots the \textbf{F}iring rate of the neuron as a function -of the stimulus \textbf{I}ntensity. - -\begin{questions} - \question In the accompanying datasets you find the - \textit{spike\_times} of an P-unit electrorecptor of the weakly - electric fish \textit{Apteronotus leptorhynchus} to a stimulus of a - certain intensity, i.e. the \textit{contrast}. The contrast is also - part of the file name itself. - \begin{parts} - \part Estimate for each stimulus intensity the average response - (PSTH) and plot it. You will see that there are three parts. (i) - The first 200 ms is the baseline (no stimulus) activity. (ii) During - the next 1000 ms the stimulus was switched on. (iii) After stimulus - offset the neuronal activity was recorded for further 825 ms. - \part Extract the neuron's activity in the last 200 ms before - stimulus offset and plot it against the stimulus intensity or the - contrast, respectively. - \part Fit a Boltzmann function to the FI-curve. The Boltzmann function - is defined as: - \begin{equation} - y=\frac{\alpha-\beta}{1+e^{(x-x_0)/\Delta x}}+\beta, - \end{equation} - where $\alpha$ is the starting firing rate, $\beta$ the saturation - firing rate, $x$ the current stimulus intensity, $x_0$ starting - stimulus intensity, and $\Delta x$ a measure of the slope. - \end{parts} -\end{questions} - -\end{document}