forked from aleung15/AMPKmTOR2022
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbifurcfig6_28jun22.m
160 lines (139 loc) · 4.17 KB
/
bifurcfig6_28jun22.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
%Plot 3D bifurcation diagrams for pmTORC1 and pmTORC2 varying V_IR
%and AMPK from saved matrices from simulation
%need to run bifurcation_2 first
%Import saved data for plotting
%inform user to run bifurcationAnalysis1_3D.m
data = open('bifVIR_Khyd_1.mat'); %Import saved simulation data
ypar = 'K_{HYD}';
%parval =data.kHYD;
Abundance =data.Abundance; %Define AMPK abundance
max_val = data.output_max_val; %Get matrix containing the maximum values
min_val = data.output_min_val; %Get matrix containing the minimum values
sum_val = data.output_sum; %Get matrix containing the sum
product_val = data.output_product; %Get matrix containing the product
div_val = data.output_div; %Get matrix containing the quotient
dim = size(max_val); %Find the dimensions of the matrix
%Define parameter range for V_IR
param_range = data.param_range;
V_IR = data.param_range;
lim = [0 max(V_IR)]; %Define limit of V_IR to display
view_angle = [-30, 45]; %Define view angle of plot
%Define mesh for plotting scatter plots
[X, Y] = meshgrid(V_IR, Abundance);
X = reshape(X, [dim(1)*dim(2), 1]);
Y = reshape(Y, [dim(1)*dim(2), 1]);
%Reshape matrices
max_val_new = reshape(max_val, [dim(1)*dim(2), 2]);
min_val_new = reshape(min_val, [dim(1)*dim(2), 2]);
sum_val_new = reshape(sum_val, [dim(1)*dim(2), 2]);
product_val_new = reshape(product_val, [dim(1)*dim(2), 2]);
div_val_new = reshape(div_val, [dim(1)*dim(2), 2]);
yrange = [min(Abundance), max(Abundance) ] ;
%Plot 3D surface plots
%pmTORC1
figure(1)
subplot(3,2,5)
surf(V_IR,Abundance,reshape(max_val(:, 1:length(V_IR), 1), [dim(1), dim(2)]), 'LineStyle','none','edgecolor','none')
hold on
surf(V_IR,Abundance,reshape(min_val(:, 1:length(V_IR), 1), [dim(1), dim(2)]), 'LineStyle','none','edgecolor','none')
scatter3(X, Y, max_val_new(:,1), 1, 'k.')
scatter3(X, Y, min_val_new(:,1), 1, 'k.')
hold off
xlabel('V\_IR')
ylabel(ypar)
zlabel('pmTORC1')
xlim(lim)
view(view_angle)
plotformat
%pmTORC2
subplot(3,2,6)
surf(V_IR,Abundance,reshape(max_val(:, 1:length(V_IR), 2), [dim(1), dim(2)]), 'LineStyle','none')
hold on
surf(V_IR,Abundance,reshape(min_val(:, 1:length(V_IR), 2), [dim(1), dim(2)]), 'LineStyle','none')
scatter3(X, Y, max_val_new(:,2), 1, 'k.')
scatter3(X, Y, min_val_new(:,2), 1, 'k.')
hold off
xlabel('V\_IR')
ylabel(ypar)
zlabel('pmTORC2')
xlim(lim)
view(view_angle)
plotformat
xticklabels({0,5,10,15,20})
subplot(3,2,3)
plot1 = min_val(1,:,1);
plot2 = max_val(1,:,1);
plot(param_range,plot1,'b')
hold on
plot(param_range,plot2,'b')
plot1 = min_val(150,:,1);
plot2 = max_val(150,:,1);
plot(param_range,plot1,'r')
hold on
plot(param_range,plot2,'r')
ylabel('Steady State [\muM]')
xlabel('V\_IR')
title('mTORC1')
plotformat
subplot(3,2,4)
plot1 = min_val(1,:,2);
plot2 = max_val(1,:,2);
plot(param_range,plot1,'b')
hold on
plot(param_range,plot2,'b')
ylabel('Steady State [\muM]')
xlabel('V\_IR')
title('mTORC2')
plotformat
plot1 = min_val(150,:,2);
plot2 = max_val(150,:,2);
plot(param_range,plot1,'r')
hold on
plot(param_range,plot2,'r')
plotformat
legend(num2str(Abundance(1)),'',num2str(Abundance(150)),'');
leg=legend('show');
subplot(3,2,1)
hold on
plot1 = min_val(:,30,1);
plot2 = max_val(:,30,1);
plot(Abundance,plot1,'Color',[0.9290 0.6940 0.1250])
hold on
plot(Abundance,plot2,'Color',[0.9290 0.6940 0.1250])
ylabel('Steady State [\muM]')
xlabel('k_{hyd}')
title('mTORC2')
plotformat
plot1 = min_val(:,1,1);
plot2 = max_val(:,1,1);
plot(Abundance,plot1,'Color',[0.4940 0.1840 0.5560])
hold on
plot(Abundance,plot2, 'Color',[0.4940 0.1840 0.5560])
ylabel('Steady State [\muM]')
xlabel('k_{hyd}')
title('mTORC2')
plotformat
legend(num2str(param_range(30)),'',num2str(param_range(1)),'');
leg=legend('show');
subplot(3,2,2)
hold on
plot1 = min_val(:,30,1);
plot2 = max_val(:,30,1);
plot(Abundance,plot1,'Color',[0.9290 0.6940 0.1250])
hold on
plot(Abundance,plot2,'Color',[0.9290 0.6940 0.1250])
ylabel('Steady State [\muM]')
xlabel('k_{hyd}')
title('mTORC1')
plotformat
plot1 = min_val(:,1,2);
plot2 = max_val(:,1,2);
plot(Abundance,plot1,'Color',[0.4940 0.1840 0.5560])
hold on
plot(Abundance,plot2, 'Color',[0.4940 0.1840 0.5560])
ylabel('Steady State [\muM]')
xlabel('k_{hyd}')
title('mTORC2')
plotformat
legend(num2str(param_range(30)),'',num2str(param_range(1)),'');
leg=legend('show');