This repository was archived by the owner on Mar 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisualize_experimental_data.asv
More file actions
121 lines (115 loc) · 4.2 KB
/
visualize_experimental_data.asv
File metadata and controls
121 lines (115 loc) · 4.2 KB
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
close all
% % addpath('kmedoids');
% hall_data = SBmeasurement('datasets/Hall data for sbtoolbox.xls');
% data = {};
% data{1} = create_structure(hall_data);
% sdata = struct(hall_data);
% data{1}.name = sprintf('%s: %s',sdata.name,sdata.notes);
% data{1}.sdata = sdata;
% woolard_data = SBmeasurement('datasets/Woolard data for sbtoolbox.xls');
% data{2} = create_structure(woolard_data);
% sdata = struct(woolard_data);
% data{2}.name = sprintf('%s: %s',sdata.name,sdata.notes);
% data{2}.sdata = sdata;
% sharma_data = SBmeasurement('datasets/Sharma data for sbtoolbox.xls');
% data{3} = create_structure(sharma_data{2}); % WT
% sdata = struct(sharma_data{2});
% data{3}.name = sprintf('%s: %s',sdata.name,sdata.notes);
% data{3}.sdata = sdata;
% mares_data = SBmeasurement('datasets/Mares data for sbtoolbox.xls');
% data{4} = create_structure(mares_data{1});
% sdata = struct(mares_data{1});
% data{4}.name = sprintf('%s: %s',sdata.name,sdata.notes);
% data{5} = create_structure(mares_data{2});
% sdata = struct(mares_data{2});
% data{5}.name = sprintf('%s: %s',sdata.name,sdata.notes);
unique_notes = {};
ht_unique_notes = java.util.Hashtable();
for i = 1:length(data)
if ~ht_unique_notes.containsKey(data{i}.sdata.notes)
ht_unique_notes.put(data{i}.sdata.notes,i);
unique_notes{end+1} = data{i}.sdata.notes;
else
tmp = ht_unique_notes.get(data{i}.sdata.notes);
tmp = [tmp i];
ht_unique_notes.put(data{i}.sdata.notes,tmp);
end
end
ht = java.util.Hashtable();
keys = {};
for i = 1:length(data)
for j = 1:length(data{i}.componentNames)
if ~ht.containsKey(data{i}.componentNames{j})
ht.put(data{i}.componentNames{j},[i;j]);
keys{end+1} = data{i}.componentNames{j};
else
tmp = ht.get(data{i}.componentNames{j});
tmp = [tmp [i;j]];
ht.put(data{i}.componentNames{j},tmp);
end
end
end
% % Grouped by component
% set(0,'DefaultFigureWindowStyle','docked');
% new_hs = [];
% for k = 1:length(keys)
% new_hs(end+1) = figure;
% inxs = ht.get(keys{k});
% Y = [];
% E = [];
% names = {};
% axs = [];
% for ix = 1:size(inxs,2)
% axs(end+1) = subplot(size(inxs,2),1,ix);
% i = inxs(1,ix); j = inxs(2,ix);
% Y = data{i}.values(:,j);
% E = data{i}.maxvalues(:,j)-data{i}.values(:,j);
% [I,J] = ind2sub(size(E),find(isnan(E)));
% E(I,J) = 0;
% hs = barweb(Y,E,0.9,data{i}.time,[],[],[],[], [],names,'plot');
% title(data{i}.name);
% end
% set(new_hs(end),'name',keys{k});
% linkaxes(axs,'x');
% end
% set(0,'DefaultFigureWindowStyle','normal');
% Grouped by notes
set(0,'DefaultFigureWindowStyle','docked');
for k = 1:length(unique_notes)
inxs = ht_unique_notes.get(unique_notes{k});
heat_data = zeros(length(inxs),length(keys)); % rows are datasets, columns are variables
cnt = 0;
for i = 1:length(inxs)
for j = 1:length(keys)
if mod(cnt,2) == 0
heat_data(i,j) = 1;
end
cnt = cnt + 1;
end
end
xlabels = {};
for j = 1:length(keys)
xlabels{j} = keys{j};
ixs = ht.get(keys{j});
for i = 1:length(inxs)
if ~isempty(find(inxs(i) == ixs))
heat_data(i,j) = 1;
end
end
end
ylabels = {};
for i = 1:length(inxs)
ylabels{end+1} = data{inxs(i)}.sdata.name;
end
hm = heatmap(heat_data','columnlabels',ylabels,'rowlabels',xlabels,'columnlabelslocation','top','colormap','gray');
addTitle(hm,unique_notes{k});
end
set(0,'DefaultFigureWindowStyle','normal');
% E = [maxvalues_WT(1:end,i)-values_WT(1:end,i) maxvalues_mutant(1:end,i)-values_mutant(1:end,i)];
% hs = barweb(Y,E,0.9,times_WT(:,i),[],[],[],[], [],{'WT','Mutant'},'plot');
% % hs = plot(times_WT(:,i),values_WT(:,i),times_mutant(:,j),values_mutant(:,j));
% % set(hs,'marker','*');
% % legend('WT','Mutant');
% title(componentNames_WT{i},'interpreter','none');
% set(new_hs(end),'name',componentNames_WT{i});
% end