Merge branch 'master' of https://whale.am28.uni-tuebingen.de/git/teaching/scientificComputing
This commit is contained in:
commit
76ab7e16b3
@ -42,6 +42,7 @@ no statistics
|
||||
|
||||
9) project_mutualinfo
|
||||
OK, medium
|
||||
Example code is missing
|
||||
|
||||
10) project_noiseficurves
|
||||
OK, simple-medium
|
||||
|
@ -9,17 +9,19 @@
|
||||
\vspace{1ex}
|
||||
\textbf{Dates:}
|
||||
|
||||
The code and the presentation should be uploaded to
|
||||
ILIAS \textbf{at latest the night before the presentation (23:59h)}. We will
|
||||
store all presentations on one computer to allow fast
|
||||
transitions between talks. The date of the presentations will be anounced.
|
||||
The code and the presentation should be uploaded to ILIAS
|
||||
\textbf{at latest on Tuesday, February 4th, 2020, 23:59h}. We
|
||||
will store all presentations on one computer to allow for fast
|
||||
transitions between talks.
|
||||
|
||||
The presentations are on Wednesday February 4th, 10--12, Thursday
|
||||
February 5th, 10--12 and 14--16.
|
||||
|
||||
\vspace{1ex}
|
||||
\textbf{Files:}
|
||||
|
||||
Hand in your presentation as a pdf file. Bundle
|
||||
everything (the pdf, the code, and the data) into a {\em single}
|
||||
zip-file.
|
||||
Hand in your presentation as a pdf file. Bundle everything (the
|
||||
pdf, the code, and the data) into a {\em single} zip-file.
|
||||
|
||||
\textbf{Hint:} create the zip file you want to upload, unpack it
|
||||
somewhere else and check if your main script is still running
|
||||
|
@ -11,35 +11,66 @@
|
||||
|
||||
|
||||
%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\section{Estimation of the activation curve}
|
||||
Mutations in genes, encoding for ion channels, can result in a variety of neurological diseases like epilepsy, autism and intellectual disability. One way to find a possible treatment is to compare the voltage dependent kinetics of the mutated channel with its corresponding wild-type. These kinetics are described in voltage-clamp experiments and the subsequent data analysis.
|
||||
|
||||
In this task you will compute and compare the activation curves of the Nav1.6 wild-type channel and a variation named A1622D (the amino acid Alanine (A) at the 1622nd position is replaced by Aspartic acid (D)) that causes intellectual disability in humans.
|
||||
|
||||
|
||||
\section{Estimation of activation curves of sodium channels}
|
||||
Mutations in genes encoding ion channels can result in a variety of
|
||||
neurological diseases like epilepsy, autism, or intellectual
|
||||
disability. One way to find a possible treatment is to compare the
|
||||
voltage dependent kinetics of the mutated channel with its
|
||||
corresponding wild-type (non-mutated channel). Voltage-clamp
|
||||
experiments are used to measure and describe the kinetics.
|
||||
|
||||
In the project you will compute and compare the activation curves of
|
||||
the Nav1.6 wild-type (WT) channel and the A1622D mutation (the amino
|
||||
acid Alanine (A) at the 1622nd position is replaced by Aspartic acid
|
||||
(D)) that causes intellectual disability in humans.
|
||||
|
||||
\begin{questions}
|
||||
\question In the accompanying datasets you find recordings of cells with WT or A1622D transfections. The cells were all clamped to -70mV for some time to bring all ion channels in the same closed states. They are activated by a step change in the command voltage to a value described in the "steps" vector. The corresponding recorded current (in pA) and time (in ms) traces are also saved in the files.
|
||||
|
||||
\begin{parts}
|
||||
\part Plot the current traces of a WT and a A1622D cell. Because the number of transfected channels can vary the peak values have little value. Normalize the curves accordingly (what kind of normalization would be appropriate?). Can you already spot differences between the cells?
|
||||
|
||||
\part \textbf{IV curve}: Find the peak values for each voltage step and plot them against the steps.
|
||||
|
||||
\part \textbf{Reversal potential}: Use the IV-curve to estimate the reversal potential of the sodium current. Consider a linear interpolation to increase the accuracy of your estimation.
|
||||
|
||||
\part \textbf{Activation curve}: The activation curve is a representation of the voltage dependence of the sodium conductivity. It is computed with a variation of Ohm's law:
|
||||
\question In the accompanying datasets you find recordings of both
|
||||
wildtype and A1622D transfected cells. The cells were all clamped to
|
||||
a holding potential of $-70$\,mV for some time to bring all ion
|
||||
channels in the same closed states. Then the channels were activated
|
||||
by a step change in the command voltage to a value described in the
|
||||
\code{steps} vector. The corresponding recorded current \code{I} (in
|
||||
pA) and time \code{t} (in ms) traces are also saved in the files.
|
||||
|
||||
\begin{parts}
|
||||
\part Plot all the current traces of a single WT and a single
|
||||
A1622D cell in two plots. Because the number of transfected
|
||||
channels can vary the peak values have little value. Normalize the
|
||||
curves accordingly (what kind of normalization would be
|
||||
appropriate?). Can you already spot differences between the cells?
|
||||
|
||||
\part \textbf{I-V curve}: Find the peak values (minimum or maximum)
|
||||
for each voltage step and plot them against the steps.
|
||||
|
||||
\part \textbf{Reversal potential}: Use the $I$-$V$-curve to
|
||||
estimate the reversal potential $E_\text{Na}$ of the sodium
|
||||
current. Consider a linear interpolation to increase the accuracy
|
||||
of your estimation.
|
||||
|
||||
\part \textbf{Activation curve}: The activation curve is a
|
||||
representation of the voltage dependence of the sodium
|
||||
conductivity. It is computed with a variation of Ohm's law:
|
||||
\begin{equation}
|
||||
g_{Na}(V) = \frac{I_{peak}}{V - V_{reversal}}
|
||||
g_\text{Na}(V) = \frac{I_{peak}}{V - E_\text{Na}}
|
||||
\end{equation}
|
||||
|
||||
\part \textbf{Compare the two variants}: To compare WT and A1622D activation curves you should first parameterise your data. Fit a sigmoid curve
|
||||
\part \textbf{Comparison of the two ion channel types}: To compare
|
||||
WT and A1622D activation curves you should first parameterize your
|
||||
data. Fit a sigmoidal function
|
||||
\begin{equation}
|
||||
g_{Na}(V) = g_{max,Na} / ( 1 + e^{ - \frac{V-V_{1/2}}{k}} )
|
||||
g_{Na}(V) = \frac{\bar g_\text{Na}}{1 + e^{ - \frac{V-V_{1/2}}{k}}}
|
||||
\end{equation}
|
||||
to the activation curves. With $g_{max,Na}$ being the maximum conductivity, $V_{1/2}$ the half activation voltage and $k$ a slope factor. Now you can compare the two variants with a few simple parameters. What do the differences mean?
|
||||
|
||||
\part \textbf{BONUS question}: Take a good look at your raw data. What other differences can you see? How could you analyse these?
|
||||
to the activation curves. With $\bar g_\text{Na}$ being the
|
||||
maximum conductivity, $V_{1/2}$ the half activation voltage and
|
||||
$k$ a slope factor (how these parameters influence the
|
||||
curve?). Now you can compare the two variants with three simple
|
||||
parameters. What do the differences mean? Which differences are
|
||||
statistically significant?
|
||||
|
||||
\part \textbf{BONUS question}: Take a closer look at your raw
|
||||
data. What other differences can you see between the two types of
|
||||
sodium currents? How could you analyze these?
|
||||
|
||||
\end{parts}
|
||||
\end{questions}
|
||||
|
@ -1,9 +1,9 @@
|
||||
\documentclass[a4paper,12pt,pdftex]{exam}
|
||||
|
||||
\newcommand{\ptitle}{F-I curves}
|
||||
\newcommand{\ptitle}{f-I curves}
|
||||
\input{../header.tex}
|
||||
\firstpagefooter{Supervisor: Jan Grewe}{phone: 29 74588}%
|
||||
{email: jan.grewe@uni-tuebingen.de}
|
||||
\firstpagefooter{Supervisor: Jan Benda}{phone: 29 74573}%
|
||||
{email: jan.benda@uni-tuebingen.de}
|
||||
|
||||
\begin{document}
|
||||
|
||||
@ -11,64 +11,67 @@
|
||||
|
||||
|
||||
%%%%%%%%%%%%%% 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.
|
||||
|
||||
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.
|
||||
\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.
|
||||
|
||||
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{questions}
|
||||
\question{Estimate the FI-curce for the onset and the steady state response.}
|
||||
\question Estimate the $f$-$I$-curve for the onset and the steady
|
||||
state response.
|
||||
\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 a 50\,ms time window immediately
|
||||
after stimulus onset (onset response) and 50\,ms before stimulus offset (steady state response).
|
||||
|
||||
For each plot the resulting F-I curve by plotting the
|
||||
computed firing rates against the corresponding stimulus
|
||||
intensity, respectively the contrast.
|
||||
\part Estimate for each stimulus intensity the time course of the
|
||||
trial-averaged 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 (mean over trials and standard
|
||||
deviation) in 50\,ms time windows before stimulus onset (baseline
|
||||
activity), immediately after stimulus onset (onset response), and
|
||||
50\,ms before stimulus offset (steady state response).
|
||||
|
||||
Plot the resulting $f$-$I$ curves by plotting the three computed
|
||||
firing rates against the corresponding stimulus intensities
|
||||
(contrasts).
|
||||
|
||||
\end{parts}
|
||||
|
||||
\question{} 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.
|
||||
|
||||
\begin{parts}
|
||||
\part{} Before you do the fitting, familiarize yourself with the four
|
||||
parameters 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 the parameters?
|
||||
|
||||
\part{} Can you get good initial estimates for the parameters?
|
||||
\part{} Do the fits and show the resulting Boltzmann functions together
|
||||
with the corresponding data.
|
||||
|
||||
\part{} Illustrate how fit to the F-I curves changes during the fitting
|
||||
process. You can plot the parameters as a function fit iterations.
|
||||
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.
|
||||
\question Fit a Boltzmann function to the onset and steady-state
|
||||
$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.
|
||||
|
||||
\begin{parts}
|
||||
\part Before you do the fitting, familiarize yourself with the
|
||||
four parameters 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 the parameters?
|
||||
|
||||
\part Can you get good initial estimates for the parameters?
|
||||
|
||||
\part Do the fits and show the resulting Boltzmann functions
|
||||
together with the corresponding data.
|
||||
|
||||
\part Use a statistical test to evaluate which of the onset and
|
||||
steady-state responses differ significantly from the baseline
|
||||
activity.
|
||||
|
||||
\part Discuss you results with respect to encoding of different
|
||||
stimulus intensities.
|
||||
\end{parts}
|
||||
\end{questions}
|
||||
|
||||
|
@ -52,7 +52,6 @@ time = [0.0:dt:tmax]; % t_i
|
||||
|
||||
Vary the time step $\Delta t$ by factors of 10 and discuss
|
||||
accuracy of numerical solutions. What is a good time step?
|
||||
|
||||
Why is $V=0$ the resting potential of this neuron?
|
||||
|
||||
\part Response of the passive membrane to a step input.
|
||||
@ -72,15 +71,15 @@ time = [0.0:dt:tmax]; % t_i
|
||||
|
||||
What do you observe?
|
||||
|
||||
\part Transfer function of the passive neuron.
|
||||
\part Filter function of the passive neuron.
|
||||
|
||||
Measure the amplitude of the voltage responses evoked by the
|
||||
sinusoidal inputs as the maximum of the last 900\,ms of the
|
||||
responses. Plot the amplitude of the response as a function of
|
||||
input frequency. This is the transfer function of the passive neuron.
|
||||
input frequency. This is the filter function of the passive
|
||||
neuron.
|
||||
|
||||
How does the transfer function depend on the membrane time
|
||||
constant?
|
||||
How does the filter function depend on the membrane time constant?
|
||||
|
||||
\part Leaky integrate-and-fire neuron.
|
||||
|
||||
|
@ -54,10 +54,10 @@ spikes = lifspikes(trials, current, tmax, Dnoise);
|
||||
|
||||
\begin{parts}
|
||||
\part First set the noise \texttt{Dnoise=0} (no noise). Compute
|
||||
and plot neuron's $f$-$I$ curve, i.e. the mean firing rate (number
|
||||
of spikes within the recording time \texttt{tmax} divided by
|
||||
\texttt{tmax} and averaged over trials) as a function of the input
|
||||
current for inputs ranging from 0 to 20.
|
||||
and plot the neuron's $f$-$I$ curve, i.e. the mean firing rate
|
||||
(number of spikes within the recording time \texttt{tmax} divided
|
||||
by \texttt{tmax} and averaged over trials) as a function of the
|
||||
input current for inputs ranging from 0 to 20.
|
||||
|
||||
How are different stimulus intensities encoded by the firing rate
|
||||
of this neuron?
|
||||
|
31
projects/project_pca_natural_images/solution/ConeResponse.m
Normal file
31
projects/project_pca_natural_images/solution/ConeResponse.m
Normal file
@ -0,0 +1,31 @@
|
||||
function Y = ConeResponse(X)
|
||||
|
||||
wl_r = 700;
|
||||
wl_g = 510;
|
||||
wl_b = 440;
|
||||
wl = [wl_r; wl_g; wl_b];
|
||||
|
||||
mu_s = 445;
|
||||
mu_m = 545;
|
||||
mu_l = 575;
|
||||
|
||||
sig_s = 20;
|
||||
sig_m = 40;
|
||||
sig_l = 45;
|
||||
|
||||
s = gauss(wl,mu_s,sig_s)/gauss(mu_s,mu_s,sig_s);
|
||||
m = gauss(wl,mu_m,sig_m)/gauss(mu_m,mu_m,sig_m);
|
||||
l = gauss(wl,mu_l,sig_l)/gauss(mu_l,mu_l,sig_l);
|
||||
|
||||
S = X'*s;
|
||||
M = X'*m;
|
||||
L = X'*l;
|
||||
|
||||
Y = [L, M, S]';
|
||||
%
|
||||
% close all
|
||||
% hold on
|
||||
% plot(lam,s,'b')
|
||||
% plot(lam,m,'g')
|
||||
% plot(lam,l,'r')
|
||||
% hold off
|
3
projects/project_pca_natural_images/solution/gauss.m
Normal file
3
projects/project_pca_natural_images/solution/gauss.m
Normal file
@ -0,0 +1,3 @@
|
||||
function Y = gauss(X,mu,sigma)
|
||||
Y = exp(-0.5*((X-mu)/sigma).^2)./sqrt(2*pi*sigma^2);
|
||||
% Y = Y/exp(-0.5*(mu/sigma).^2)./sqrt(2*pi*sigma^2);
|
65
projects/project_pca_natural_images/solution/main.m
Normal file
65
projects/project_pca_natural_images/solution/main.m
Normal file
@ -0,0 +1,65 @@
|
||||
clear all
|
||||
close all
|
||||
pic = imread('D:\Dokumente\MATLAB\Matlabkurs2018\pca\natimg.jpg');
|
||||
pic = pic(end:-1:1,:,:);
|
||||
|
||||
red = double(pic(:,:,1));
|
||||
green = double(pic(:,:,2));
|
||||
blue = double(pic(:,:,3));
|
||||
% mat = [red(:),green(:),blue(:)];
|
||||
|
||||
mat = reshape(double(pic),size(pic,1)*size(pic,2),size(pic,3))';
|
||||
cones = ConeResponse(mat);
|
||||
% [coeff, score, latent] = pca(mat,'Centered',false);
|
||||
% [coeff, score, latent] = pca(cones,'Centered',false);
|
||||
|
||||
% n = 10000;
|
||||
% cones = cones(:,randi([1,size(cones,2)],1,n));
|
||||
cones = mat;
|
||||
cv = cov(cones');
|
||||
[ev, ew] = eig(cv);
|
||||
[ew, ew_idx] = sort(diag(ew), 'descend');
|
||||
coeff = cones'*ev(:,ew_idx);
|
||||
% coeff = [coeff'; zeros(size(pic,1)*size(pic,2)-size(coeff,2),3)];
|
||||
|
||||
|
||||
c1 = reshape(coeff(:,1),size(pic,1),size(pic,2));
|
||||
c2 = reshape(coeff(:,2),size(pic,1),size(pic,2));
|
||||
c3 = reshape(coeff(:,3),size(pic,1),size(pic,2));
|
||||
|
||||
% score
|
||||
|
||||
figure
|
||||
subplot(221)
|
||||
contourf(red)
|
||||
axis('square')
|
||||
|
||||
subplot(222)
|
||||
contourf(green)
|
||||
axis('square')
|
||||
|
||||
subplot(223)
|
||||
contourf(blue)
|
||||
axis('square')
|
||||
colormap('gray')
|
||||
|
||||
subplot(224)
|
||||
imshow('D:\Dokumente\MATLAB\Matlabkurs2018\pca\natimg.jpg')
|
||||
axis('square')
|
||||
|
||||
figure
|
||||
subplot(221)
|
||||
contourf(c1)
|
||||
axis('square')
|
||||
|
||||
subplot(222)
|
||||
contourf(c2)
|
||||
axis('square')
|
||||
colormap('gray')
|
||||
|
||||
subplot(223)
|
||||
contourf(c3)
|
||||
axis('square')
|
||||
colormap('gray')
|
||||
|
||||
% score
|
@ -39,7 +39,7 @@
|
||||
\begin{parts}
|
||||
\part Illustrate the spiking activity of the V1 cells in response
|
||||
to different orientation angles of the bars by means of spike
|
||||
raster plots (of one unit).
|
||||
raster plots (of a single unit).
|
||||
|
||||
\part Plot the firing rate of each of the 6 neurons as a function
|
||||
of the orientation angle of the bar. As the firing rate compute
|
||||
@ -48,7 +48,7 @@
|
||||
of the neurons.
|
||||
|
||||
\part Fit the function \[ r(\varphi) =
|
||||
g(1+\cos(\varphi-\varphi_0))/2 \] to the measured tuning curves in
|
||||
g(1+\cos(2(\varphi-\varphi_0)))/2 \] to the measured tuning curves in
|
||||
order to estimated the orientation angle at which the neurons
|
||||
respond strongest. In this function $\varphi_0$ is the position of
|
||||
the peak and $g$ is a gain factor that sets the maximum firing
|
||||
@ -69,7 +69,7 @@
|
||||
data, and estimate the orientation angle of the bar from single
|
||||
trial data by the two different methods.
|
||||
|
||||
\part Compare, illustrate and discuss the performance of your two
|
||||
\part Compare, illustrate and discuss the performance of the two
|
||||
decoding methods by using all of the recorded responses (all
|
||||
\texttt{population*.mat} files). How exactly is the orientation of
|
||||
the bar encoded? How robust is the estimate of the orientation
|
||||
|
@ -0,0 +1,21 @@
|
||||
\documentclass[a4paper,12pt,pdftex]{exam}
|
||||
|
||||
\newcommand{\ptitle}{Project title}
|
||||
\input{../header.tex}
|
||||
\firstpagefooter{Supervisor: Jan Benda}{phone: 29 74573}%
|
||||
{email: jan.benda@uni-tuebingen.de}
|
||||
%\firstpagefooter{Supervisor: Jan Grewe}{phone: 29 74588}%
|
||||
%{email: jan.grewe@uni-tuebingen.de}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\input{../instructions.tex}
|
||||
|
||||
|
||||
%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\begin{questions}
|
||||
\question What was the questions for 42?
|
||||
\end{questions}
|
||||
|
||||
\end{document}
|
Reference in New Issue
Block a user