-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path01_EFG.R
48 lines (42 loc) · 1.76 KB
/
01_EFG.R
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
rm(list=ls());
pdf("1_EFG.pdf", 24, 8);
source('supp_func.R');
load("../data/01/00zero_dist.RData")
layout(matrix(c(1,2,3), nrow = 1, ncol = 3, byrow = TRUE));
par("mar"=c(7, 7, 7, 7));
f.s <- c(1000, 4000, 7000, 10000, 13000, 15973);
## gene number from 14do_simulation_num.R
num <- c(15719, 18612, 19775, 20488, 21014, 21430);
cols <- rainbow(10, alpha=0.8);
col2 <- cols[c(1,2,7,3,9,6)];
boxplot(out.f$out.s, col=cols[7], border=cols[7], cex.axis=2.3);
title(font.main = 1,main="21430 full genes", xlab="", ylab = "",pch=19, cex.main=3,cex.lab=2, cex.axis= 2.5);
title(ylab="% of Zero Value", line=4, cex.lab=4, family = "sans");
title(xlab="Number of Cells", line=4.5, cex.lab=4, family = "sans");
fig_label('E', pos='topleft',cex=5)
boxplot(out.f$out2, col=cols[7], border=cols[7], cex.axis=2.3);
title(font.main = 1,main="347 pathway genes", xlab="", ylab = "",pch=19, cex.main=3,cex.lab=2, cex.axis= 2.5);
title(ylab="% of Zero Value", line=4, cex.lab=4, family = "sans");
title(xlab="Number of Cells", line=4.5, cex.lab=4, family = "sans");
fig_label('F', pos='topleft',cex=5)
for (i in 1:length(f.s)){
n <- f.s[i];
inff <- paste0("../data/01/n", n, ".RData");
load(inff);
dat <- t(out.s);
dat <- dat/num[i];
v <- apply(dat, 2, mean);
colnames(dat) <- 1:200;
main <- paste0("Single cell #:", n)
if (i == 1){
plot(v, type="l", col=col2[i], lwd=6, main="",
xlab="", ylab="",cex.main=3, cex.axis=2.5);
title(ylab="% of Zero Value", line=4, cex.lab=4, family = "sans")
title(xlab="Number of Merged Cells", line=4.5, cex.lab=4, family = "sans")
legend("topright", legend=f.s, lwd=6, title="Cell Number", bty="n", col=col2, cex = 3.5);
} else {
points(v, type="l", col=col2[i], lwd=6)
}
}
fig_label('G', pos='topleft',cex=5)
dev.off();