-
Notifications
You must be signed in to change notification settings - Fork 0
/
figures.m
69 lines (59 loc) · 2.78 KB
/
figures.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
addpath(genpath('../'));
load('./time_series_data.mat');
num_hctsa = 7873; % The number of hctsa features. Any above this are custom
%% Figure 4
scatterScript
%% Remove the custom features
for r = 1:length(time_series_data)
time_series_data(r).TS_DataMat = time_series_data(r).TS_DataMat(:, 1:num_hctsa);
time_series_data(r).Operations = time_series_data(r).Operations(1:num_hctsa, :);
idxs = time_series_data(r).Correlation(:, 2) <= num_hctsa;
time_series_data(r).Correlation = time_series_data(r).Correlation(idxs, :);
end
%% Feature score tables
tbl = get_combined_feature_stats(time_series_data, {'Absolute_Correlation'}, {'Absolute_Correlation_Mean', 'Aggregated_Absolute_Correlation'}, [], 1);
%% Figure 2
histogramStat(time_series_data, 'Absolute_Correlation', 'Absolute_Correlation_Mean');
xlim([0, 1])
set(gcf, 'visible', 'off');
set(gcf, 'Units', 'Inches', 'Position', [0, 0, 6, 5], 'PaperUnits', 'points');
exportgraphics(gcf, 'fig2a.pdf')
tbl = sortrows(tbl, 'Absolute_Correlation_Mean', 'Descend', 'ComparisonMethod', 'abs', 'MissingPlacement', 'last');
[pmat, ps, pnums] = pairwiseFeatureSimilarity(time_series_data, tbl.Operation_ID(1:100), 'spearman');
set(gcf, 'visible', 'off');
set(gcf, 'Units', 'Inches', 'Position', [0, 0, 13, 13], 'PaperUnits', 'points');
exportgraphics(gcf, 'fig2b.pdf')
[~, ~, idxs] = intersect(pnums, tbl.Operation_ID, 'stable');
writetable(tbl(idxs, :), 'fixedNoiseClusters.xls')
%% Figure 3
histogramStat(time_series_data, 'Aggregated_Absolute_Correlation');
xlim([0, 1])
set(gcf, 'visible', 'off');
set(gcf, 'Units', 'Inches', 'Position', [0, 0, 6, 5], 'PaperUnits', 'points');
exportgraphics(gcf, 'fig3a.pdf')
tbl = sortrows(tbl, 'Aggregated_Absolute_Correlation', 'Descend', 'ComparisonMethod', 'abs', 'MissingPlacement', 'last');
[pmat, ps, pnums] = pairwiseFeatureSimilarity(time_series_data, tbl.Operation_ID(1:20), 'spearman');
set(gcf, 'visible', 'off');
set(gcf, 'Units', 'Inches', 'Position', [0, 0, 13, 13], 'PaperUnits', 'points');
exportgraphics(gcf, 'fig3b.pdf')
[~, ~, idxs] = intersect(pnums, tbl.Operation_ID, 'stable');
writetable(tbl(idxs, :), 'variableNoiseClusters.xls')
%% Figure 5
systemSchematic
%% A feature matrix from the schematic
% F = arrayfun(@(x) time_series_data(x, :).TS_DataMat', 1:size(time_series_data, 1), 'un', 0);
% F = [F{:}]';
F = time_series_data(end, :).TS_DataMat;
F = BF_NormalizeMatrix(F);
F(isnan(F)) = 0;
idxs = BF_ClusterReorder(F');
F = F(:, idxs);
colormap(BF_getcmap('redyellowblue'))
imagesc(F)
%% Supplementary figure 1
ops = [19, 93, 1763, 3332, 3535, 6275];
time_series_data = normalise_time_series_data(time_series_data, [-1, 0]);
visualise_feature_fit(time_series_data, ops, 101)
set(gcf, 'visible', 'off');
set(gcf, 'Units', 'Inches', 'Position', [0, 0, 8, 8], 'PaperUnits', 'points');
exportgraphics(gcf, 'figs1.pdf')