-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_2D_plot_theory.m
131 lines (102 loc) · 3.51 KB
/
main_2D_plot_theory.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
%%%%
%%%% Init
%%%%
rmpath('./funcs');
clear;
addpath('./model');
addpath('./funcs');
addpath('./funcs2');
init_font;
fprintf('\n');
T1_2 = 0.5;
AC_basal = 0.3;
AC_dip = 0.7;
grey = [1,1,1]*0.5;
%%%
flag_competitive = 1;
flag_Gi_sequestrated_AC = 1;
flag_optoDA = 0;
flag_duration = -1;
[model, species, params, container] = ...
msn_setup(flag_competitive, flag_Gi_sequestrated_AC, flag_optoDA, flag_duration);
%%%
tmp = 10.^[-1:0.025:2];
targs = {'D2R', 'AC1' ,'RGS' ,'Gi_Gbc' ,'Golf'};
dim = [3,1];
targ = targs(dim);
conc = {};
mconc = {};
for i = 1:numel(dim);
mult_conc{i} = tmp;
default_conc = species{targ{i},'Obj'}.InitialAmount;
conc{i} = mult_conc{i} .* default_conc;
fprintf('Standard conc %s: %g uM \n', targ{i}, default_conc );
end
% Theory
targ_concs = init_concs_2D(species, targ, conc, targs);
[ AC_basal_th, AC_dip_th, AC_t_th ] = ...
theory(flag_competitive, targ_concs{1}, targ_concs{2}, targ_concs{3}, targ_concs{4}, targ_concs{5}, params);
%%
%% 2D plot
%%
xmconc = mult_conc{1} ;
ymconc = mult_conc{2} ;
[fig0, ax0] = fig_prep2(targ, xmconc, ymconc, 'AC dip');
[fig1, ax1] = fig_prep2(targ, xmconc, ymconc, 'AC basal');
[fig2, ax2] = fig_prep2(targ, xmconc, ymconc, 't1/2');
area = (AC_basal_th < AC_basal) .* (AC_dip_th > AC_dip);
plot_heatmap(fig2, ax2, xmconc, ymconc, area');
contour(ax0, xmconc, ymconc, AC_dip_th' , [1 1]*AC_dip , ':' , 'LineWidth', 4, 'Color', [0 0.5 1]);
contour(ax1, xmconc, ymconc, AC_basal_th' , [1 1]*AC_basal , 'b:', 'LineWidth', 4);
contour(ax2, xmconc, ymconc, AC_t_th' , [1 1]*T1_2 , 'r:', 'LineWidth', 4);
plot_standard_conc(ax0, xmconc, ymconc);
plot_standard_conc(ax1, xmconc, ymconc);
plot_standard_conc(ax2, xmconc, ymconc);
%%
%% Asymptote
%%
RGS = conc{1};
ACtot = species{'AC1','Obj'}.InitialAmount;
D2Rtot = species{'D2R','Obj'}.InitialAmount;
Golftot = species{'Golf','Obj'}.InitialAmount;
D2R = theory_asymptote(RGS, params, ACtot, Golftot, 'ACdip', flag_competitive);
D2R_1 = D2R(1,:);
D2R_2 = D2R(2,:);
plot(ax0, xmconc, D2R_1./D2Rtot ,'--','LineWidth',2, 'Color', grey);
plot(ax0, xmconc, D2R_2./D2Rtot ,'--','LineWidth',2, 'Color', grey);
D2R = theory_asymptote(RGS, params, ACtot, Golftot, 'ACbasal', flag_competitive);
D2R_1 = D2R(1,:);
D2R_2 = D2R(2,:);
plot(ax1, xmconc, D2R_1./D2Rtot ,'--','LineWidth',2, 'Color', grey);
plot(ax1, xmconc, D2R_2./D2Rtot ,'--','LineWidth',2, 'Color', grey);
D2R = theory_asymptote(RGS, params, ACtot, Golftot, 'T1_2', flag_competitive);
plot(ax2, xmconc, D2R./D2Rtot,'--','LineWidth',2 , 'Color', grey);
%%%
%%% Functions
%%%
function plot_heatmap(fig, ax, xmconcs, ymconcs, i_theory);
Io = [0.70, 0.98];
Io_line_color = 'None'; % [0, 0, 1];
Io_panel_color = [0.9, 0.9, 1;
0.85, 0.85, 1;
0.8, 0.8, 1];
xminmax = [ min(xmconcs) , max(xmconcs) ];
yminmax = [ min(ymconcs) , max(ymconcs) ];
colormap(fig, Io_panel_color);
caxis([min(Io), max(Io)]);
[M,c] = contourf(ax, xmconcs, ymconcs, i_theory, Io, 'EdgeColor', Io_line_color);
end
function [fig, ax] = fig_prep2(targs, xmconcs, ymconcs, t_title)
xminmax = [ min(xmconcs) , max(xmconcs) ];
yminmax = [ min(ymconcs) , max(ymconcs) ];
zminmax = [ 0, 1.0 ];
[fig, ax] = panel_prep4(xminmax, yminmax, zminmax, targs{1}, targs{2});
title(ax, t_title);
hold on;
end
function plot_standard_conc(ax, xmconcs, ymconcs);
xminmax = [ min(xmconcs) , max(xmconcs) ];
yminmax = [ min(ymconcs) , max(ymconcs) ];
plot(ax, xminmax, [ 1, 1 ], 'k:');
plot(ax, [ 1, 1 ], yminmax, 'k:');
end