-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfig23_plot.m
146 lines (132 loc) · 4.52 KB
/
fig23_plot.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
% Plotting
% comparing fit vs zero initial mig-1
% comparing fit vs less regulator
clear all
dd = './';
load([dd 'fig23_processed1.mat']); % activator fit
load([dd 'fig23_processed2.mat']); % repressor fit
% regulators
% sample values of bare parameters
KA = 20;
KR = 5;
HR = Hopt;
% infer parameters for regulator dynamics
k = KA/etaopt;
r0 = KR*betaopt^(1/HR);
mu = gammaopt/HR;
% regulator dynamics
a = k*tA;
r = r0*exp(-mu*tR);
% zero initial mig-1
mA1 = exp(-nuopt*tA).*(0 + ...
alphaoptA*dt*cumsum(exp(nuopt*tA)./(1+(etaopt./tA).^Hopt)));
mR1 = exp(-nuopt*tR).*(0 + ...
alphaoptR*dt*cumsum(exp(nuopt*tR)...
./(1+betaopt*exp(-gammaopt*tR))));
% less activator: decrease k
ka = .85*k; etaa = KA/ka;
mA2a = exp(-nuopt*tA).*(m0opt + ...
alphaoptA*dt*cumsum(exp(nuopt*tA)./(1+(etaa./tA).^Hopt)));
kb = .7*k; etab = KA/kb;
mA2b = exp(-nuopt*tA).*(m0opt + ...
alphaoptA*dt*cumsum(exp(nuopt*tA)./(1+(etab./tA).^Hopt)));
mA2c = m0opt*exp(-nuopt*tA);
% less repressor: decrease r0
r0a = .7*r0; betaa = (r0a/KR)^HR;
mR2a = exp(-nuopt*tR).*(m0opt + ...
alphaoptR*dt*cumsum(exp(nuopt*tR)...
./(1+betaa*exp(-gammaopt*tR))));
r0b = .4*r0; betab = (r0b/KR)^HR;
mR2b = exp(-nuopt*tR).*(m0opt + ...
alphaoptR*dt*cumsum(exp(nuopt*tR)...
./(1+betab*exp(-gammaopt*tR))));
mR2c = exp(-nuopt*tR).*(m0opt + alphaoptR*(exp(nuopt*tR)-1));
% plot properties
lw = 3; lw2 = 2;
fs = 14; fs2 = 14;
dc = .5*[0 1 1];
dr = .5*[1 0 0];
gr = .85*[1 1 1];
% Fig 1: comparing fit vs zero initial mig-1
figure(1); clf
Y = 20;
subplot(Y,4,[1:4:Y*2+1 2:4:Y*2+2])
hold on
hA1(1) = plot(tA,a,'-','linewidth',lw,'color',gr);
hA1(2) = plot(tA,mA,'c-','linewidth',lw);
hA1(3) = plot(tA,mA1,'--','linewidth',lw,'color',dc);
xlim([-.2 3.8])
ylim([-2 45])
xlabel(' ← Time (AU)')
ylabel('Molecule number')
set(gca,'xdir','reverse','ytick',0:10:40,'fontsize',fs)
legend(hA1,{'Activator','{\it mig-1}, fit',...
'{\it mig-1}, {\it m}(0) = 0'},...
'fontsize',fs2,'location','ne')
a = gca; set(a,'box','off','color','none');
b = axes('position',get(a,'position'),'box','on','xtick',[],'ytick',[]);
axes(a);
subplot(Y,4,[3:4:Y*2+3 4:4:Y*2+4])
hold on
hR1(1) = plot(tR,r,'-','linewidth',lw,'color',gr);
hR1(2) = plot(tR,mR,'r-','linewidth',lw);
hR1(3) = plot(tR,mR1,'--','linewidth',lw,'color',dr);
xlim([-.2 3.8])
ylim([-2 45])
%xlabel('← Time, t (AU)')
%ylabel('mig-1 mRNAs, m')
set(gca,'xdir','reverse','ytick',0:10:40,'fontsize',fs)
legend(hR1,{'Repressor','{\it mig-1}, fit',...
'{\it mig-1}, {\it m}(0) = 0'},...
'fontsize',fs2,'location','ne')
a = gca; set(a,'box','off','color','none');
b = axes('position',get(a,'position'),'box','on','xtick',[],'ytick',[]);
axes(a);
fd = './';
print(gcf,'-depsc',[fd 'fig2D.eps'])
% Fig 2: comparing fit vs less regulator
figure(2); clf
subplot(Y,4,[1:4:Y*2+1 2:4:Y*2+2])
hold on
%hA2(1) = plot(tA,tA*0,'-','linewidth',lw,'color',gr);
plot(tA,mA,'c-','linewidth',lw);
plot(tA,mA2a,'-','linewidth',lw,'color',5/6*[0 1 1]);
plot(tA,mA2b,'-','linewidth',lw,'color',2/3*[0 1 1]);
plot(tA,mA2c,'-','linewidth',lw,'color',dc);
% P1 = [2.5 20]; P2 = [3.5 2]; dP = P2-P1;
% quiver(P1(1),P1(2),dP(1),dP(2),0);
annotation('arrow',[.21 .15],[.61 .53],'linewidth',lw2)
text(2.7,13,{'Less','activator'},'fontsize',fs)
xlim([-.2 3.8])
ylim([-2 45])
xlabel(' ← Time (AU)')
ylabel('{\it mig-1} mRNAs')
set(gca,'xdir','reverse','ytick',0:10:40,'fontsize',fs)
% legend(hA2(2:3),{'mig-1 (fit to Control data)',...
% 'mig-1 (with no activator)'},...
% 'fontsize',fs2,'position',[.25 .1 eps eps])
a = gca; set(a,'box','off','color','none');
b = axes('position',get(a,'position'),'box','on','xtick',[],'ytick',[]);
axes(a);
subplot(Y,4,[3:4:Y*2+3 4:4:Y*2+4])
hold on
%hR2(1) = plot(tR,tR*0,'-','linewidth',lw,'color',gr);
plot(tR,mR,'r-','linewidth',lw);
plot(tR,mR2a,'-','linewidth',lw,'color',5/6*[1 0 0]);
plot(tR,mR2b,'-','linewidth',lw,'color',2/3*[1 0 0]);
plot(tR,mR2c,'-','linewidth',lw,'color',dr);
annotation('arrow',[.625 .87],[.61 .83],'linewidth',lw2)
text(3.65,10,{'Less','repressor'},'fontsize',fs)
xlim([-.2 3.8])
ylim([-2 45])
% xlabel('← Time, t (AU)')
% ylabel('mig-1 mRNAs, m')
set(gca,'xdir','reverse','ytick',0:10:40,'fontsize',fs)
% legend(hR2(2:3),{'mig-1 (fit to Control data)',...
% 'mig-1 (with no repressor)'},...
% 'fontsize',fs2,'position',[.75 .1 eps eps])
a = gca; set(a,'box','off','color','none');
b = axes('position',get(a,'position'),'box','on','xtick',[],'ytick',[]);
axes(a);
fd = './';
print(gcf,'-depsc',[fd 'fig3A.eps'])