Skip to content

Commit f750a41

Browse files
committed
AntVsPost: added section to calculate off/on ratio, PreIndent: added section to make re-loading data easy with updated filtering code.
1 parent 1a77d0d commit f750a41

6 files changed

Lines changed: 87 additions & 21 deletions

File tree

Analysis/SK/AnalyzePatchData.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@
5757
stimPosition = {'anterior'};
5858

5959
wormPrep = {'dissected'};
60-
cellDist = [40 200];
60+
cellDist = [40 100];
6161
resistCutoff = '<250';
62-
extFilterFreq = 2.5;
62+
extFilterFreq = [2.5 5];
6363
includeFlag = 1;
6464

65-
anteriorDistCells = FilterRecordings(ephysData, ephysMetaData,...
65+
anteriorStepCells = FilterRecordings(ephysData, ephysMetaData,...
6666
'strain', strainList, 'internal', internalList, ...
6767
'stimLocation', stimPosition, 'wormPrep', wormPrep, ...
6868
'cellStimDistUm',cellDist, 'RsM', resistCutoff, ...
@@ -72,7 +72,7 @@
7272

7373
%% Run sweep selection GUI
7474

75-
ExcludeSweeps(ephysData, protList, anteriorDistCells, 'matchType', matchType);
75+
ExcludeSweeps(ephysData, protList, anteriorStepCells, 'matchType', matchType);
7676

7777
clear protList matchType;
7878

@@ -109,7 +109,7 @@
109109
protList = {'WC_Probe','NoPre'};
110110
sortSweeps = {'magnitude','magnitude','magnitude','magnitude'};
111111
matchType = 'first';
112-
anteriorMRCs = IdAnalysis(ephysData,protList,anteriorDistCells,'num','matchType',matchType, ...
112+
anteriorMRCs = IdAnalysis(ephysData,protList,anteriorStepCells,'num','matchType',matchType, ...
113113
'tauType','thalfmax', 'sortSweepsBy', sortSweeps, 'integrateCurrent',1 , ...
114114
'recParameters', ephysMetaData,'sepByStimDistance',1);
115115
clear protList sortSweeps matchType

Analysis/SK/AnnotatedScripts/AntVsPost_VoltageAttenuation_180803.m

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
whichMRCs = anteriorMRCs;
9191
thisAtt = attenuationData(:,[2 8 10]);
9292
distCol = 12;
93-
peakCol = 8; % 6 for peak current, 11 for integrated current/charge
93+
peakCol = 6; % 6 for peak current, 11 for integrated current/charge
9494
distVPeak = [];
9595
stepSize = 10;
9696

@@ -195,6 +195,9 @@
195195
xlim([-100 200]);ylim([0 200]);
196196
vline(0,'k:');
197197

198+
199+
200+
198201
%% Correct all sizes and export for Igor fitting of Boltzmann to each recording
199202

200203
eachSize = [0.5 1 1.5 3 4 5 6 7 8 9 10 11 12]';
@@ -287,6 +290,23 @@
287290

288291
clear iCell thisCell Iact whichMRCs whichStep hasAtt thisAtt Vc Ena thisName
289292

293+
%% Calculate ratios
294+
% re-save ant_Out as antOff/antOnCurr for the corresponding cases
295+
on = antOnCurr;
296+
off = antOffCurr;
297+
out = on(1,:);
298+
299+
onVel = [on{2:end,1}];
300+
offVel = -[off{2:end,1}];
301+
302+
303+
for i = 1:length(onVel)
304+
out{i+1,1} = onVel(i);
305+
out(i+1,2:end) = cellfun(@(x,y) x./y, off(i+1,2:end), on(i+1,2:end),'un',0);
306+
end
307+
308+
out = out(~cellfun(@isempty,out(:,1)),:);
309+
out(1,:) = cellfun(@(x) regexprep(x,'stim1','ratio'),out(1,:),'un',0);
290310

291311
%% Renormalize
292312

Analysis/SK/AnnotatedScripts/Velocity_VoltageAtt_180913.m

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646

4747
clear cellDist strainList internalList cellTypeList stimPosition resistCutoff ans wormPrep excludeCells;
4848

49-
% This results in a file with three columns: cell ID, series, and sweeps
50-
% that have been approved for analysis use.
5149

5250
%% Visual/manual exclusion of bad sweeps
5351
% This is mainly based on excluding sweeps with leak > 10pA, but also
@@ -59,14 +57,17 @@
5957

6058
ExcludeSweeps(ephysData, protList, velocityCells, 'matchType', matchType);
6159

60+
% This results in a file with three columns: cell ID, series, and sweeps
61+
% that have been approved for analysis use.
62+
6263
%% Find MRCs
6364
% antTraps_allFreq(180913).xls
6465
protList ={'TrapRate'};
6566
matchType = 'first';
6667

6768
sortSweeps = {'velocity','velocity','magnitude','magnitude'};
6869

69-
[velocityMRCs velocityStim] = IdAnalysis(ephysData,protList,velocityCells,'num','matchType',matchType, ...
70+
[velocityMRCs, velocityStim] = IdAnalysis(ephysData,protList,velocityCells,'num','matchType',matchType, ...
7071
'tauType','thalfmax', 'sortSweepsBy', sortSweeps, 'integrateCurrent',1 , ...
7172
'recParameters', ephysMetaData,'sepByStimDistance',1);
7273

@@ -152,7 +153,7 @@
152153
whichMRCs = velocityMRCs;
153154
thisAtt = attenuationData(:,[2 8 10]);
154155
distCol = 12;
155-
peakCol = 6; % 6 for peak current, 11 for integrated current/charge
156+
peakCol = 11; % 6 for peak current, 11 for integrated current/charge
156157
distVPeak = [];
157158
stepVel = 11360;
158159

@@ -257,14 +258,14 @@
257258
%% Correct all velocities and export for Igor fitting of Boltzmann to each recording
258259

259260
% Set the filename
260-
fname = 'PatchData/attCorrectedVel(181004).xls';
261+
fname = 'PatchData/attCorrectedVel(181022).xls';
261262
noCorr = 0;
263+
normFlag = 0; %normalize to 40mm/s ramp (highest velocity "step")
264+
peakCol = 11; % 6 for peak current, 11 for integrated current/charge
265+
% 8 for tauAct, 9 for tauDecay
262266

263267
for i = 1:2
264268
whichRamp = i; % 1 for on currents, 2 for off currents
265-
normFlag = 0; %normalize to 40mm/s ramp (highest velocity "step")
266-
peakCol = 6; % 6 for peak current, 11 for integrated current/charge
267-
% 8 for tauAct, 9 for tauDecay
268269
switch peakCol
269270
case 6
270271
dType = 'peak';
@@ -368,8 +369,8 @@
368369
%% Calculate ratios
369370
% re-save vel_Out as on/offVelChrg and on/offVelPeak for the corresponding
370371
% cases
371-
on = onVelPeak;
372-
off = offVelPeak;
372+
on = antOnCurr;
373+
off = antOff_Curr;
373374
out = on(1,:);
374375

375376
onVel = [on{2:end,1}];
@@ -388,7 +389,7 @@
388389
out = out(~cellfun(@isempty,out(:,1)),:);
389390
out(1,:) = cellfun(@(x) regexprep(x,'stim1','ratio'),out(1,:),'un',0);
390391

391-
xlswrite(fname,out,sprintf('velPeak_ratio'));
392+
xlswrite(fname,out,sprintf('velChrg_ratio'));
392393

393394

394395
%% Renormalize

Analysis/SK/Scripts-in-progress/PreIndentIgorExport.m

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,41 @@
11
% PreIndentIgorExport.m
22

3+
%% Load data
34
% load prepulseFatData(180108).mat
45

6+
% or run this section to re-load the data given ephysData and
7+
% ephysMetaData.
8+
strainList = {'TU2769'};
9+
internalList = {'IC2'};
10+
resistCutoff = '<210'; % Rs < 210 MOhm
11+
12+
wtCells = FilterRecordings(ephysData, ephysMetaData,...
13+
'strain', strainList, 'internal', internalList, 'RsM', resistCutoff);
14+
15+
clear strainList internalList resistCutoff ans;
16+
17+
18+
19+
protList ={'NoPrePulse'};
20+
sortSweeps = {'position','position','position','position'};
21+
matchType = 'full';
22+
wtNoPreMRCs = IdAnalysis(ephysData,protList,wtCells,'num','matchType',matchType, ...
23+
'tauType','thalfmax', 'sortSweepsBy', sortSweeps, 'integrateCurrent',1,...
24+
'sortStimBy','time','recParameters',ephysMetaData);
25+
26+
clear protList sortSweeps matchType
27+
28+
protList ={'PrePulse'};
29+
sortSweeps = {'position','position','position','position'};
30+
matchType = 'full';
31+
wtPreMRCs = IdAnalysis(ephysData,protList,wtCells,'num','matchType',matchType, ...
32+
'tauType','thalfmax', 'sortSweepsBy', sortSweeps, 'integrateCurrent',1,...
33+
'sortStimBy','time','recParameters',ephysMetaData);
34+
35+
clear protList sortSweeps matchType
36+
37+
%% Export to Igor
38+
539
% Get traces and associated recording names
640
noPreTraces = vertcat(wtNoPreMRCs{:,2})';
741
preTraces = vertcat(wtPreMRCs{:,2})';

Analysis/SK/Scripts-in-progress/TrapNoiseAnalysis.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
'strain', strainList, 'internal', internalList, ...
1515
'stimLocation', stimPosition, 'wormPrep', wormPrep, ...
1616
'cellStimDistUm',cellDist, 'RsM', resistCutoff, ...
17-
'stimFilterFrequencykHz', extFilterFreq);
17+
'stimFilterFrequencykHz', extFilterFreq, 'included', 1);
1818

1919
%% Exclusion
20-
protList ={'NoiseTrap','WCProbe8'};
20+
protList ={'WCProbe1','WCProbe3'};
2121

2222
matchType = 'first';
2323

Analysis/SK/Scripts-in-progress/prepulse.m

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,22 @@
66
protList ={'NoPrePulse'};
77
sortSweeps = {'position','position','position','position'};
88
matchType = 'full';
9-
fatNoPreMRCs = IdAnalysis(ephysData,protList,fatCells,'num','matchType',matchType, ...
10-
'tauType','thalfmax', 'sortSweepsBy', sortSweeps, 'integrateCurrent',1);
9+
wtNoPreMRCs = IdAnalysis(ephysData,protList,wtCells,'num','matchType',matchType, ...
10+
'tauType','thalfmax', 'sortSweepsBy', sortSweeps, 'integrateCurrent',1,...
11+
'sortStimBy','time','recParameters',ephysMetaData);
1112

1213
clear protList sortSweeps matchType
1314

15+
protList ={'PrePulse'};
16+
sortSweeps = {'position','position','position','position'};
17+
matchType = 'full';
18+
wtPreMRCs = IdAnalysis(ephysData,protList,wtCells,'num','matchType',matchType, ...
19+
'tauType','thalfmax', 'sortSweepsBy', sortSweeps, 'integrateCurrent',1,...
20+
'sortStimBy','time','recParameters',ephysMetaData);
21+
22+
clear protList sortSweeps matchType
23+
24+
1425
%% load prepulseFatData/get rid of empty cells
1526
wtPreMRCs = wtPreMRCs(~cellfun('isempty',wtPreMRCs(:,1)),:);
1627
wtNoPreMRCs = wtNoPreMRCs(~cellfun('isempty',wtNoPreMRCs(:,1)),:);

0 commit comments

Comments
 (0)