Professional Documents
Culture Documents
-----------------------
d=readtable(‘fiberphotometrydata.csv’);
d2=table2array(d(:,1:3));
d3=str2double(d2); ##this command takes a lot of time (~2min)
d4=timeseries(d3(2:end,2:3),d3(2:end,1));
resv=[0:0.05:220]’;
##0 to 220 or the last second within the data.
d5=resample(d4,resv);
P=polyfit(d5.data(3:end,1),d5.data(3:end,2),1) ##you will get a,b ## Remember to
exclude first NaN values and eliminate eventual NaN in the end
d6=P(1)*d5.data(:,1)+P(2); ##get fitted control using y=ax+b formula
d7=d5.data(:,2)-d6; #Signal465-Fittedcontrl405
d8=d7./d6 #Needs “a period .” ## d8 = dF
dF=[d5.time d8];
writematrix(dF,'dF.csv')
---------------------
The above code is used for the original fiber photometry data csv.
Then, we obtain the csv from which the dF is derived. d5 is the data every 0.05
sec.
step2. extract median values over 3 epochs and calculate z score. Excel.
---------------
a. =median(Q4:Q6)
b. =(AE5-AVERAGE(AE$5:AE$4206))/STDEV.S(AE$5:AE$4206)
---------------
step5. extract the data for each of the avo and mid int zones.