Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 306 lines (252 sloc) 8.434 kB
ad43822 Rearranged code folders following final submission
Alistair Boettiger authored
1
2 %% Plotting Commands
3
4 fout = '/Users/alistair/Documents/Berkeley/Levine_Lab/Projects/Markov Modeling/Results/'
5
6 %% Original Version
7 load Markov_simp_dist;
8
9
10 % Plotting parameters
11 xmin = -5; % min log difference
12 xmax = 20; % max log difference
13 offset = .1; % little buffer on the axis
14 xs = linspace(xmin,xmax,50); % xaxis and number of bins
15 F = 10; % Fontesize
16
17
18 % convert ratios of parameters into
19 m = log2(dM);
20 s = log2(dV);
21 n = log2(dN);
22
23
24 % Figure comparing ratio of values over all parameter space.
25 f1 = figure(1); clf;
26 subplot(1,3,1);
27 mp = m(m>0);
28 mn = m(m<0);
29 hist(mn,xs);
30 h = findobj(gca,'Type','patch');
31 set(h,'EdgeColor','none','FaceColor','r'); hold on;
32 hist(mp,xs);
33 xlim([xmin-offset,xmax+offset]);
34 xlabel('log_{2}(\mu_{IR}/\mu_{ER})'); set(gca,'YTickLabel',' ');
35 ylabel('frequency'); set(gca,'FontSize',F);
36 title('Mean Expression Speed, \mu','FontSize',F);
37
38 subplot(1,3,2);
39 sp = s(s>0);
40 sn = s(s<0);
41 hist(sn,xs);
42 h = findobj(gca,'Type','patch');
43 set(h,'EdgeColor','none','FaceColor','r'); hold on;
44 hist(sp,xs);
45 xlim([xmin-offset,xmax+offset]);
46 xlabel('log_{2}(\sigma^2_{IR}/\sigma^2_{ER})'); set(gca,'YTickLabel',' ');
47 title('Variance in Expression Timing, \sigma^2','FontSize',F); set(gca,'FontSize',F);
48
49
50 subplot(1,3,3);
51 np = n(n>0);
52 nn = n(n<0);
53 hist(nn,xs); hold on;
54 h = findobj(gca,'Type','patch');
55 set(h,'EdgeColor','none','FaceColor','r');
56 hist(np,xs);
57 xlim([xmin-offset,xmax+offset]);
58 xlabel('log_{2}(\eta_{IR}/\eta_{ER})'); set(gca,'YTickLabel',' ');
59 title('Noise in transcript number, \eta','FontSize',F);
60 set(gcf,'color','w'); set(gca,'FontSize',F);
61
62
63
64
65 % Plot parameter skews when IR is smaller.
66 var_names = {'K12','K21','K23','K34','Kab','Kba'};
67 xx = linspace(0,1,6);
68 figure(3); clf; set(gcf,'color','w');
69 kk = 0;
70 IR_better = log2(dM)<-.5;
71 for k=1:6
72 kk = kk+1;
73 subplot(3,6,kk); hist(vars(IR_better,k),xx); xlim([0,1]); xlim([xmin,xmax]);
74 title(['\mu ', var_names{k}]); xlim([-.05,1.05]);
75 end
76 IR_better = log2(dV)<-.5;
77 for k=1:6
78 kk = kk+1;
79 subplot(3,6,kk); hist(vars(IR_better,k),xx); xlim([0,1]); xlim([xmin,xmax]);
80 title(['\sigma^2 ', var_names{k}]); xlim([-.05,1.05]);
81 end
82 IR_better = log2(dN)<-.3;
83 for k=1:6
84 kk = kk+1;
85 subplot(3,6,kk); hist(vars(IR_better,k),xx); xlim([0,1]); xlim([xmin,xmax]);
86 title(['\eta ', var_names{k}]); xlim([-.05,1.05]);
87 end
88
89 %% Regulate k32
90 %
91 %
92 % % Model Definition:
93 % % Simple Initiation Regulated Model
94 % GI{1} = zeros(3);
95 % GI{2} =[[-kab,kab,0,0,0];
96 % [kba,-k12-kba,k12,0,0];
97 % [0,k21,-k21-k23,k23,0];
98 % [0,0,0,-k34,k34];
99 % [0,0,0,0,0 ]];
100 %
101 % % Revised Elongation model: regulat k23 instead of k34
102 % % Implies state 3A is inaccesable
103 % GE{1} = zeros(3);
104 % % 1A 2A 3A 1B 2B 3B 4
105 % GE{2} = [[-k12-kab, k12, kab, 0, 0, 0]; % 1A
106 % [k21, -k21-kab, 0, kab, 0, 0]; % 2A
107 % [kba,0,-kba-k12,k12,0,0]; % 1B
108 % [0,kba,k21,-kba-k21-k23,k23,0]; % 2B
109 % [0,0,0,0,-k34,k34] ; % 3B
110 % [0,0,0,0,0,0]]; % 4
111
112
113 % load data for plotting:
114 load plotdata_regk23
115
116
117
118 % Plotting parameters
119 xmin = -3; % min log difference
120 xmax = 3; % max log difference
121 offset = .1; % little buffer on the axis
122 xs = linspace(xmin,xmax,50); % xaxis and number of bins
123 F = 10; % Fontesize
124
125
126 % convert ratios of parameters into
127 m = log2(dM);
128 s = log2(dV);
129 n = log2(dN);
130
131
132 % Figure comparing ratio of values over all parameter space.
133 f1 = figure(1); clf;
134 subplot(1,3,1);
135 mp = m(m>0);
136 mn = m(m<0);
137 hist(mn,xs);
138 h = findobj(gca,'Type','patch');
139 set(h,'EdgeColor','none','FaceColor','r'); hold on;
140 hist(mp,xs);
141 xlim([xmin-offset,xmax+offset]);
142 xlabel('log_{2}(\mu_{IR}/\mu_{ER})'); set(gca,'YTickLabel',' ');
143 ylabel('frequency'); set(gca,'FontSize',F);
144 title('Mean Expression Speed, \mu','FontSize',F);
145
146 subplot(1,3,2);
147 sp = s(s>0);
148 sn = s(s<0);
149 hist(sn,xs);
150 h = findobj(gca,'Type','patch');
151 set(h,'EdgeColor','none','FaceColor','r'); hold on;
152 hist(sp,xs);
153 xlim([xmin-offset,xmax+offset]);
154 xlabel('log_{2}(\sigma^2_{IR}/\sigma^2_{ER})'); set(gca,'YTickLabel',' ');
155 title('Variance in Expression Timing, \sigma^2','FontSize',F); set(gca,'FontSize',F);
156
157
158 subplot(1,3,3);
159 np = n(n>0);
160 nn = n(n<0);
161 hist(nn,xs); hold on;
162 h = findobj(gca,'Type','patch');
163 set(h,'EdgeColor','none','FaceColor','r');
164 hist(np,xs);
165 xlim([xmin-offset,xmax+offset]);
166 xlabel('log_{2}(\eta_{IR}/\eta_{ER})'); set(gca,'YTickLabel',' ');
167 title('Noise in transcript number, \eta','FontSize',F);
168 set(gcf,'color','w'); set(gca,'FontSize',F);
169
170
171
172
173 % Plot parameter skews when IR is smaller.
174 var_names = {'K12','K21','K23','K34','Kab','Kba'};
175 xx = linspace(0,1,6);
176 figure(3); clf; set(gcf,'color','w');
177 kk = 0;
178 IR_better = log2(dM)<-.5;
179 for k=1:6
180 kk = kk+1;
181 subplot(3,6,kk); hist(vars(IR_better,k),xx); xlim([0,1]); xlim([xmin,xmax]);
182 title(['\mu ', var_names{k}]); xlim([-.05,1.05]);
183 end
184 IR_better = log2(dV)<-.5;
185 for k=1:6
186 kk = kk+1;
187 subplot(3,6,kk); hist(vars(IR_better,k),xx); xlim([0,1]); xlim([xmin,xmax]);
188 title(['\sigma^2 ', var_names{k}]); xlim([-.05,1.05]);
189 end
190 IR_better = log2(dN)<-.3;
191 for k=1:6
192 kk = kk+1;
193 subplot(3,6,kk); hist(vars(IR_better,k),xx); xlim([0,1]); xlim([xmin,xmax]);
194 title(['\eta ', var_names{k}]); xlim([-.05,1.05]);
195 end
196
197
198
199 %% Add k32
200 % % Simple Initiation Regulated Model
201 % GI{1} = zeros(3);
202 % GI{2} =[[-kab,kab,0,0,0];
203 % [kba,-k12-kba,k12,0,0];
204 % [0,k21,-k21-k23,k23,0];
205 % [0,0,k32,-k34-k32,k34];
206 % [0,0,0,0,0 ]];
207 %
208 % [m1I, m2I] = SeriesDecomp(GI);
209 %
210 % % Simple Elongation model
211 % GE{1} = zeros(3);
212 % % 1A 2A 3A 1B 2B 3B 4
213 % GE{2} = [[-k12-kab,k12,0,kab,0,0,0]; % 1A
214 % [k21,-k21-kab-k23,k23,0,kab,0,0]; % 2A
215 % [0,k32,-kab-k32,0,0,kab,0 ]; % 3A
216 % [kba,0,0,-kba-k12,k12,0,0]; % 1B
217 % [0,kba,0,k21,-kba-k21-k23,k23,0]; % 2B
218 % [0,0,kba,0,k32,-k32-k34-kba,k34] ; % 3B
219 % [0,0,0,0,0,0,0]];
220
221 clear all;
222 load plotdata_addk32
223
224
225
226 % Plotting parameters
227 xmin = -3; % min log difference
228 xmax = 3; % max log difference
229 offset = .1; % little buffer on the axis
230 xs = linspace(xmin,xmax,50); % xaxis and number of bins
231 F = 10; % Fontesize
232
233
234 % convert ratios of parameters into
235 m = log2(dM);
236 s = log2(dV);
237 n = log2(dN);
238
239
240 % Figure comparing ratio of values over all parameter space.
241 figure(1); clf;
242 subplot(1,3,1);
243 mp = m(m>0);
244 mn = m(m<0);
245 hist(mn,xs);
246 h = findobj(gca,'Type','patch');
247 set(h,'EdgeColor','none','FaceColor','r'); hold on;
248 hist(mp,xs);
249 xlim([xmin-offset,xmax+offset]);
250 xlabel('log_{2}(\mu_{IR}/\mu_{ER})'); set(gca,'YTickLabel',' ');
251 ylabel('frequency'); set(gca,'FontSize',F);
252 title('Mean Expression Speed, \mu','FontSize',F);
253
254 subplot(1,3,2);
255 sp = s(s>0);
256 sn = s(s<0);
257 hist(sn,xs);
258 h = findobj(gca,'Type','patch');
259 set(h,'EdgeColor','none','FaceColor','r'); hold on;
260 hist(sp,xs);
261 xlim([xmin-offset,xmax+offset]);
262 xlabel('log_{2}(\sigma^2_{IR}/\sigma^2_{ER})'); set(gca,'YTickLabel',' ');
263 title('Variance in Expression Timing, \sigma^2','FontSize',F); set(gca,'FontSize',F);
264
265
266 subplot(1,3,3);
267 np = n(n>0);
268 nn = n(n<0);
269 hist(nn,xs); hold on;
270 h = findobj(gca,'Type','patch');
271 set(h,'EdgeColor','none','FaceColor','r');
272 hist(np,xs);
273 xlim([xmin-offset,xmax+offset]);
274 xlabel('log_{2}(\eta_{IR}/\eta_{ER})'); set(gca,'YTickLabel',' ');
275 title('Noise in transcript number, \eta','FontSize',F);
276 set(gcf,'color','w'); set(gca,'FontSize',F);
277
278
279
280
281 % Plot parameter skews when IR is smaller.
282 var_names = {'K12','K21','K23','K34','Kab','Kba'};
283 xx = linspace(0,1,6);
284 figure(3); clf; set(gcf,'color','w');
285 kk = 0;
286 IR_better = log2(dM)<-.5;
287 for k=1:6
288 kk = kk+1;
289 subplot(3,6,kk); hist(vars(IR_better,k),xx); xlim([0,1]); xlim([xmin,xmax]);
290 title(['\mu ', var_names{k}]); xlim([-.05,1.05]);
291 end
292 IR_better = log2(dV)<-.5;
293 for k=1:6
294 kk = kk+1;
295 subplot(3,6,kk); hist(vars(IR_better,k),xx); xlim([0,1]); xlim([xmin,xmax]);
296 title(['\sigma^2 ', var_names{k}]); xlim([-.05,1.05]);
297 end
298 IR_better = log2(dN)<-.3;
299 for k=1:6
300 kk = kk+1;
301 subplot(3,6,kk); hist(vars(IR_better,k),xx); xlim([0,1]); xlim([xmin,xmax]);
302 title(['\eta ', var_names{k}]); xlim([-.05,1.05]);
303 end
304
305
306
Something went wrong with that request. Please try again.