Browse Source

Spatiotemporal white noise data and code

Helene Schreyer 3 years ago
parent
commit
f884e462ce
36 changed files with 48 additions and 20 deletions
  1. BIN
      spatiotemporalWhiteNoise/1511240032Comp.mat
  2. 1 1
      spatiotemporalWhiteNoise/155200029Comp.mat
  3. 1 1
      spatiotemporalWhiteNoise/156120017Comp.mat
  4. BIN
      spatiotemporalWhiteNoise/157010033Comp.mat
  5. 1 1
      spatiotemporalWhiteNoise/157010049Comp.mat
  6. BIN
      spatiotemporalWhiteNoise/157300027Comp.mat
  7. BIN
      spatiotemporalWhiteNoise/15814007Comp.mat
  8. BIN
      spatiotemporalWhiteNoise/159020052Comp.mat
  9. BIN
      spatiotemporalWhiteNoise/159020060Comp.mat
  10. BIN
      spatiotemporalWhiteNoise/15o160041Comp.mat
  11. BIN
      spatiotemporalWhiteNoise/15o160054Comp.mat
  12. BIN
      spatiotemporalWhiteNoise/15o160072Comp.mat
  13. BIN
      spatiotemporalWhiteNoise/15o280044Comp.mat
  14. BIN
      spatiotemporalWhiteNoise/15o280063Comp.mat
  15. 1 0
      spatiotemporalWhiteNoise/164220027Comp.mat
  16. BIN
      spatiotemporalWhiteNoise/164220035Comp.mat
  17. 1 1
      spatiotemporalWhiteNoise/16422005Comp.mat
  18. BIN
      spatiotemporalWhiteNoise/166250029Comp.mat
  19. 1 1
      spatiotemporalWhiteNoise/166250034Comp.mat
  20. BIN
      spatiotemporalWhiteNoise/16d190022Comp.mat
  21. BIN
      spatiotemporalWhiteNoise/16d200015Comp.mat
  22. BIN
      spatiotemporalWhiteNoise/17127006Comp.mat
  23. BIN
      spatiotemporalWhiteNoise/17203003Comp.mat
  24. BIN
      spatiotemporalWhiteNoise/172220040Comp.mat
  25. BIN
      spatiotemporalWhiteNoise/189010032Comp.mat
  26. BIN
      spatiotemporalWhiteNoise/189010046Comp.mat
  27. BIN
      spatiotemporalWhiteNoise/189130041Comp.mat
  28. BIN
      spatiotemporalWhiteNoise/18d040016Comp.mat
  29. BIN
      spatiotemporalWhiteNoise/18d130035Comp.mat
  30. 13 0
      spatiotemporalWhiteNoise/ExampleCellIDs.txt
  31. BIN
      spatiotemporalWhiteNoise/LogInfo_SpatioTemporalWhiteNoise.xlsx
  32. 1 1
      spatiotemporalWhiteNoise/code spatiotemporal white noise/BC_NL.m
  33. 9 7
      spatiotemporalWhiteNoise/code spatiotemporal white noise/BC_STA.m
  34. 1 1
      spatiotemporalWhiteNoise/code spatiotemporal white noise/BC_mainWhiteNoise.m
  35. 15 3
      spatiotemporalWhiteNoise/code spatiotemporal white noise/BC_pred.m
  36. 3 3
      spatiotemporalWhiteNoise/code spatiotemporal white noise/avgPerFrame.m

BIN
spatiotemporalWhiteNoise/1511240032Comp.mat


+ 1 - 1
spatiotemporalWhiteNoise/155200029Comp.mat

@@ -1 +1 @@
-/annex/objects/MD5-s28741677--c7a340f36b7a201bf9ed9e73c7a2de5d
+/annex/objects/MD5-s28741677--f03f7e3448f806f69c0d92a154b7c2ba

+ 1 - 1
spatiotemporalWhiteNoise/156120017Comp.mat

@@ -1 +1 @@
-/annex/objects/MD5-s21060131--65f3c8101a55d74ff07d5d956c57d32e
+/annex/objects/MD5-s21060131--e3c819168a6a713ccccb69b7f6f0c5bd

BIN
spatiotemporalWhiteNoise/157010033Comp.mat


+ 1 - 1
spatiotemporalWhiteNoise/157010049Comp.mat

@@ -1 +1 @@
-/annex/objects/MD5-s24474494--1abdbffad8831381b825accfa74b40fa
+/annex/objects/MD5-s24474494--cac0409028a2f71e1d7e1d9ad64810ad

BIN
spatiotemporalWhiteNoise/157300027Comp.mat


BIN
spatiotemporalWhiteNoise/15814007Comp.mat


BIN
spatiotemporalWhiteNoise/159020052Comp.mat


BIN
spatiotemporalWhiteNoise/159020060Comp.mat


BIN
spatiotemporalWhiteNoise/15o160041Comp.mat


BIN
spatiotemporalWhiteNoise/15o160054Comp.mat


BIN
spatiotemporalWhiteNoise/15o160072Comp.mat


BIN
spatiotemporalWhiteNoise/15o280044Comp.mat


BIN
spatiotemporalWhiteNoise/15o280063Comp.mat


+ 1 - 0
spatiotemporalWhiteNoise/164220027Comp.mat

@@ -0,0 +1 @@
+/annex/objects/MD5-s28083519--9792e1a90289237abccca8d4bc002c8a

BIN
spatiotemporalWhiteNoise/164220035Comp.mat


+ 1 - 1
spatiotemporalWhiteNoise/16422005Comp.mat

@@ -1 +1 @@
-/annex/objects/MD5-s29429308--b49ba206af9a922e9fd6542e6014c9e0
+/annex/objects/MD5-s29429308--99db83f8e7a5064d469c458ec33144ab

BIN
spatiotemporalWhiteNoise/166250029Comp.mat


+ 1 - 1
spatiotemporalWhiteNoise/166250034Comp.mat

@@ -1 +1 @@
-/annex/objects/MD5-s27215836--94d4b15ee307c0b69deb39ebafe3bacf
+/annex/objects/MD5-s27215836--65e8a719a5c2cca8e4590059efd8d49d

BIN
spatiotemporalWhiteNoise/16d190022Comp.mat


BIN
spatiotemporalWhiteNoise/16d200015Comp.mat


BIN
spatiotemporalWhiteNoise/17127006Comp.mat


BIN
spatiotemporalWhiteNoise/17203003Comp.mat


BIN
spatiotemporalWhiteNoise/172220040Comp.mat


BIN
spatiotemporalWhiteNoise/189010032Comp.mat


BIN
spatiotemporalWhiteNoise/189010046Comp.mat


BIN
spatiotemporalWhiteNoise/189130041Comp.mat


BIN
spatiotemporalWhiteNoise/18d040016Comp.mat


BIN
spatiotemporalWhiteNoise/18d130035Comp.mat


+ 13 - 0
spatiotemporalWhiteNoise/ExampleCellIDs.txt

@@ -0,0 +1,13 @@
+Filename	 Date	Retina Number	Cell Number
+%Higher prediction
+155200029Comp	150520	1	2
+15o160041Comp	151016	2	3
+166250034Comp	160625	2	2
+
+%medium and lower prediction
+15o280063Comp	151028	2	4
+16422005Comp	160422	1	2
+15o280044Comp	151028	2	2
+1511240032Comp	151124	1	3
+16d190022Comp	161219	1	4
+

BIN
spatiotemporalWhiteNoise/LogInfo_SpatioTemporalWhiteNoise.xlsx


+ 1 - 1
spatiotemporalWhiteNoise/code spatiotemporal white noise/BC_NL.m

@@ -27,7 +27,7 @@ stimulus=STA_output.stimulus2D_zoom;
 %do the convolution with the stimulus signal
 generator_signal=filter2(linearFiler,stimulus,'valid');
 %%IMPORTANT: if you have a best spatial and temporal component as described in Point 7
-%in the function BC_STA.m, this part hast to be done in two lines, e.g.:
+%in the function BC_STA.m (see Method of Manuscript), this part hast to be done in two lines, e.g.:
 %NL_PredXaxis2=filter2(sp_bestnorm,stimulus,'valid'); %first
 %convolve the spatial dimension
 %generator_signal=filter2(temp_bestnorm,NL_PredXaxis2,'valid'); %then the

+ 9 - 7
spatiotemporalWhiteNoise/code spatiotemporal white noise/BC_STA.m

@@ -1,9 +1,9 @@
 function [STA_output]=BC_STA(loadData,filename,pixelSize,seed,Hz)
-%[STA_output]=BC_STA(loadData,filename,pixelSize,seed)
+%[STA_output]=BC_STA(loadData,filename,pixelSize,seed,Hz)
 %this function loads the voltage trace of the selected bipolar cell (BC)
 %and perorms a response-weighted average analysis analogous to the commonn
 %spike-triggered average (STA). For simplicity we refer to the analysis
-%STA,even though we work with a continous voltage signal and not spikes. 
+%STA,even though we work with a continous voltage signal and not spikes.
 %Inputs:        
 %               loadData = the folder path of the white noise files
 %               filename = the filename of the BC of interest
@@ -75,9 +75,10 @@ STA_3D=reshape(STA_2D,Ny,Nx, ...
 
 %-------------------------------------------------------------------------------
 %% 5. Make a zoom-in of the STA
-%cut a window of around 100 micrometer on each side from the maximum. The
-%zoom-in of the STA is better to avoid overfitting for the NL and
-%prediction.
+%For simplification and to keep the code simple, I cut a window of around 
+%100 micrometer on each side from the maximum. A zoom-in of the STA is better
+%to avoid overfitting for the NL and prediction.See Methods part of the 
+%manuscript and comment-section 7 below for how it is done in the manuscript.
 oneCheckInMicron=pixelSize*microPerPix;
 zoom_RF=ceil(100/oneCheckInMicron);
 
@@ -133,12 +134,13 @@ STA_output.pixelSize=pixelSize;
 %the highest-ranked spatial and temporal component has to be defined e.g. by manually looking
 %at the components.
 %From here, I fitted a 2D Gaussian to the best spatial component.
-%Important for nonlinearity calculation:
+%Important for nonlinearity and prediction calculation:
 %To avoid noise contributions from pixels outside the receptive field, I reduced 
 %the number of elements in the STA by setting pixel values of the STA outside 
 %the 3-sigma contour of the Gaussian fit to zero and re-separating the spatiotemporal 
 %receptive field within this window into the highest-ranked spatial and temporal components 
-%by singular-value decomposition. Each component was then normalized to unit Euclidean norm. E.g. 
+%by singular-value decomposition. To compute the nonlinearity, each component 
+%was normalized to unit Euclidean norm. E.g. 
 %sp_bestnorm=normSTA(sp_best);
 %temp_bestnorm=normSTA(temp_best);
 

+ 1 - 1
spatiotemporalWhiteNoise/code spatiotemporal white noise/BC_mainWhiteNoise.m

@@ -15,7 +15,7 @@ loadData='Z:\spatiotemporalWhiteNoise\'; %path of the BC files for spatiotempora
 filename='155200029Comp.mat'; %BC file to analyse: for example here we use file 155200029Comp from cell 2, recorded in retina 1 on 150520
 pixelSize=12; %is given in the excel file LogInfo_SpatioTemporalWhiteNoise.xlsx for the corresponding cell
 seed=-10000; %see also documention_data.pdf
-Hz=10; % given in the excel file LogInfo_SpatioTemporalWhiteNoise.xlsx for the corresponding cell
+Hz=10; % given in the excel file LogInfo_SpatioTemporalWhiteNoise.xlsx for the corresponding cell (update rate)
 [STA_output]=BC_STA(loadData,filename,pixelSize,seed,Hz);%example code receptive field analysis=linear filter
 
 %% Second LN-Model Component: Output nonlinearity

+ 15 - 3
spatiotemporalWhiteNoise/code spatiotemporal white noise/BC_pred.m

@@ -21,13 +21,22 @@ function [pred_output]=BC_pred(STA_output)
 %%build the model (filter and nonlinearity). Therefore we have to redo the
 %%filter(STA) and nonlinearity without the stimulus-sequence that we want 
 %to predict the response(see Methods of Schreyer&Gollisch,2021).
+%In the Manuscript we predict 200 sequences of 300 frames long that where
+%randomly chosen (see Method section). Every time we rebuilt the STA and
+%NL. The overall prediction performance is then the average R^2 over all
+%200 sequences. Here, for simplicity I only show the prediction to one
+%sequence. Note however, to get a good estimate of how well the LN-model can predict
+%the response of the cell it is important to run it over multiple
+%sequences.
 %If we recorded Frozen frames, we predict the response to the frozen
 %frames from the model (filter and nonlinearity) we build from the running
 %frames.
 
 %% 1.1 STA
-%E.g. to make it easy: we want to predict the response to the last 300frames of the white
-%noise stimulus
+%to keep the code easy: I here show the principal idea, by predicting the 
+%response to the last 300frames of the white noise stimulus. 
+%(in the manuscript we randomly choose 200 sequences and redo this part 200 times)
+
 %take out the stimulus sequence you want to predict
 stimPred=STA_output.stimulus2D_zoom(:,end-299:end); %the last 300frames
 %voltage trace to predict
@@ -41,7 +50,10 @@ STA3D_norm=reshape(STA_norm,size(STA_output.rangeY_zoom,2),size(STA_output.range
 
 %% 1.2 Nonlinearity
 %build the NL from the data without the last 300 frames
-generator_signal=filter2(STA_norm,STA_output.stimulus2D_zoom(:,1:end-300),'valid');
+generator_signal=filter2(STA_norm,STA_output.stimulus2D_zoom(:,1:end-300),'valid'); %see also Point 7
+%in the function BC_STA.m and BC_NL of how you do it when you have a best
+%spatial and temporal component and reduce noice by cutting 3-sigma
+%contour around the receptive field region.
 %get the corresponding membrane potential responses
 y_axisNL_unsorted=STA_output.membranPotAVG(STA_output.STA_fnbr:end-300); %the first value is at the length of the filter
 

+ 3 - 3
spatiotemporalWhiteNoise/code spatiotemporal white noise/avgPerFrame.m

@@ -1,10 +1,10 @@
 function [membranPotAVG]=avgPerFrame ...
         (membranePot,ttls_ms)
-%function [membranPotAVG]=sharpEL_buildAveragePerFrame ...
-%         (membranePot,ttls_ms_correctedPulse)
+%function [membranPotAVG]=avgPerFrame ...
+%         (membranePot,ttls_ms)
 %builds the average membrane potential between frames for the white noise
 % -> same principle for frozen frames
-% INPUT:        membranePos -> membrane Potential
+% INPUT:        membranePot -> membrane Potential
 %               ttls_ms -> pulses in ms
 % OUTPUT:       membranPotAVG -> average membrane potential per frames