-
Notifications
You must be signed in to change notification settings - Fork 1
/
metabolismR01_extrapolate_burst_probability.m
executable file
·83 lines (64 loc) · 2.77 KB
/
metabolismR01_extrapolate_burst_probability.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
function [aDrugBurstProbNullValue, aDrugBurstProbAltValue, burstProbStdev] = ...
metabolismR01_extrapolate_burst_probability
%% Extrapolates burst probability values for A-Drug from GAT1 data
%
% Requires:
% cd/argfun.m
% File History:
% 2020-02-26 Created by Adam Lu
% Paths
grantDir = '/media/shareX/2020marchR01';
powerDir = fullfile(grantDir, 'Power_Analysis');
% Files
gatStatsFile = 'gat_blockade_pharm_1-4_gincr_200_stats.mat';
aDrugOscFile = 'adrug_oscDurationSec_chevron.csv';
gat1OscFile = 'gat1_oscDurationSec_chevron.csv';
% Strings
controlStr = 'Con';
gat1Str = 'GAT1';
burstProbStr = 'burstProbability';
allValuesStr = 'allValues';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Load GAT Blocker stats
m = matfile(fullfile(powerDir, gatStatsFile));
statsTable = m.statsTable;
pharmLabels = m.pharmLabels;
% Determine Control vs. GAT1 index
[idxCon, idxGat1] = ...
argfun(@(str) find(contains(pharmLabels, str)), controlStr, gat1Str);
% Extract Control vs. GAT1 burst probabilities
burstProbAll = statsTable{burstProbStr, allValuesStr};
burstProbAll = burstProbAll{1};
[conBurstProbValues, gat1BurstProbValues] = ...
argfun(@(idx) burstProbAll{idx}, idxCon, idxGat1);
% Compute Control vs. GAT1 mean burst probabilities
[conBurstMeanProb, gat1BurstMeanProb] = ...
argfun(@(allValues) nanmean(allValues), ...
conBurstProbValues, gat1BurstProbValues);
% Read oscillation table
[aDrugOscTable, gat1OscTable] = ...
argfun(@(file) readtable(fullfile(powerDir, file)), ...
aDrugOscFile, gat1OscFile);
% Calculate oscillation duration effect sizes
[aDrugOscEffect, gat1OscEffect] = ...
argfun(@(table) nanmean(table{:, 2} - table{:, 1}), ...
aDrugOscTable, gat1OscTable);
% Estimate A-Drug burst probability null value
aDrugBurstProbNullValue = conBurstMeanProb;
% Estimate A-Drug burst probability alt value
aDrugBurstProbAltValue = conBurstMeanProb + ...
(gat1BurstMeanProb - conBurstMeanProb) * ...
(aDrugOscEffect / gat1OscEffect);
% Estimate burst probability difference standard deviation
burstProbStdev = nanstd(gat1BurstProbValues - conBurstProbValues);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%{
OLD CODE:
% Compute Control vs. GAT1 burst probability standard deviations
[conBurstStdProb, gat1BurstStdProb] = ...
argfun(@(allValues) nanstd(allValues), ...
conBurstProbValues, gat1BurstProbValues);
% Estimate burst probability standard deviation
burstProbStdev = sqrt(conBurstStdProb^2 + gat1BurstStdProb^2);
%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%