-
Notifications
You must be signed in to change notification settings - Fork 5
/
DD1_12_SupplementFigures.m
99 lines (88 loc) · 3.26 KB
/
DD1_12_SupplementFigures.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
clear; clc; close all; tic;
% customize wf to local environment
wf = 'd:\job\del\ms'; addpath(genpath(wf)); cd(wf);
% read supplementary dataset D6
D6 = readtable('data\supplementaryDataset6.csv','TextType','string');
x = D6.ap1_baseline;
% histogram of counts per number of sequencing reads
xe = 0:5:max(x);
[hc,il] = histcounts(x,xe);
figure('Units','inches','Position',[2 2 6.5 3.35]);
bar(hc,'FaceColor',[0 0 1],'EdgeColor',[0 0 1],'LineWidth',0.5);
bc = numel(il);
bcf = ceil(bc/8);
bci = 1:bcf:bc;
set(gca,'XTick',bci,'XTickLabel',il(bci));
xlabel('sequencing reads');
ylabel('count');
% histograms of counts per individual diversity element
ct = crosstab(x,D6.scaffold);
ct = sum(ct.*repmat((1:size(ct,1))',1,max(D6.scaffold)));
ct = sort(numel(ct).*ct./sum(ct),'descend');
figure('Units','inches','Position',[2 2 6.5 3.35]);
bar(ct,'FaceColor',[0 0 1],'EdgeColor',[0 0 1],'LineWidth',0.5);
xlabel('scaffold rank');
ylabel('relative abundance');
ct = crosstab(x,D6.BB1);
ct = sum(ct.*repmat((1:size(ct,1))',1,max(D6.BB1)));
ct = sort(numel(ct).*ct./sum(ct),'descend');
figure('Units','inches','Position',[2 2 6.5 3.35]);
bar(ct,'FaceColor',[0 0 1],'EdgeColor',[0 0 1],'LineWidth',0.5);
xlabel('BB1 rank');
ylabel('relative abundance');
ct = crosstab(x,D6.BB2);
ct = sum(ct.*repmat((1:size(ct,1))',1,max(D6.BB2)));
ct = sort(numel(ct).*ct./sum(ct),'descend');
figure('Units','inches','Position',[2 2 6.5 3.35]);
bar(ct,'FaceColor',[0 0 1],'EdgeColor',[0 0 1],'LineWidth',0.5);
xlabel('BB2 rank');
ylabel('relative abundance');
% position in enrichment rank of duplicate building blocks (BB2: 70 & 77)
load data\chigramHitListDepthCA9.mat F*;
cF5a = 1*ones(119,3);
cF5a(70,:) = [0 0 1];
cF5a(77,:) = [0 0 1];
[schi,sBBC] = sort(F(4).chi,'descend'); % sort order for BB_C
cF5a = cF5a(sBBC,:);
figure('Units','inches','Position',[2 2 6.5 3.35]);
cF5b = bar(log2(schi.*schi),'EdgeColor',[0 0 1],'LineWidth',0.25);
cF5b.FaceColor = 'flat';
cF5b.CData(:,:) = cF5a;
xlabel('BB2 rank');
ylabel('enrichment, log_2(\chi^2)');
clear F*;
load data\chigramHitListDepthHRP.mat F*;
cF5a = 1*ones(119,3);
cF5a(70,:) = [0 0 1];
cF5a(77,:) = [0 0 1];
[schi,sBBC] = sort(F(4).chi,'descend'); % sort order for BB2
cF5a = cF5a(sBBC,:);
figure('Units','inches','Position',[2 2 6.5 3.35]);
cF5b = bar(log2(schi.*schi),'EdgeColor',[0 0 1],'LineWidth',0.25);
cF5b.FaceColor = 'flat';
cF5b.CData(:,:) = cF5a;
xlabel('BB2 rank');
ylabel('enrichment, log_2(\chi^2)');
% position in enrichment rank (BB1: 88)
cF5a = 1*ones(119,3);
cF5a(88,:) = [0 0 1];
[schi,sBBC] = sort(F(5).chi,'descend'); % sort order for BB1
cF5a = cF5a(sBBC,:);
figure('Units','inches','Position',[2 2 6.5 3.35]);
cF5b = bar(log2(schi.*schi),'EdgeColor',[0 0 1],'LineWidth',0.25);
cF5b.FaceColor = 'flat';
cF5b.CData(:,:) = cF5a;
xlabel('BB1 rank');
ylabel('enrichment, log_2(\chi^2)');
% position in enrichment rank (BB2: 98)
cF5a = 1*ones(119,3);
cF5a(98,:) = [0 0 1];
[schi,sBBC] = sort(F(4).chi,'descend'); % sort order for BB2
cF5a = cF5a(sBBC,:);
figure('Units','inches','Position',[2 2 6.5 3.35]);
cF5b = bar(log2(schi.*schi),'EdgeColor',[0 0 1],'LineWidth',0.25);
cF5b.FaceColor = 'flat';
cF5b.CData(:,:) = cF5a;
xlabel('BB2 rank');
ylabel('enrichment, log_2(\chi^2)');
toc;