-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsupp6_ABC.R
49 lines (46 loc) · 1.85 KB
/
supp6_ABC.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());
options(stringsAsFactors = F);
source("supp_func.R");
pdf("supp6_ABC.pdf", 15,5);
layout(matrix(c(1,2,3), nrow = 1 , ncol = 3, byrow = TRUE))
par("mar"=c(5, 5, 5, 5))
## Equation
eq = function(x){80*(1250*x - 140823)/1700}
plot(eq(100:500), type='l',,main = 'range(xy) = 112.65840 + 0.01799 * cell number',ylab = '', xlab = 'range of xy coordinates')
fig_label('A', pos='topleft',cex=3)
## Compution Time for 5967 single cells
out.s <- read.table("../data/supp/01clust1_out.txt", header=T);
clu.u <- unique(out.s[,1]);
y.max <- max(out.s[,3]);
cols <- rainbow(length(clu.u), alpha=0.8);
o.i <- which(out.s[,1]==10);
out <- out.s[o.i,];
plot(out[,2], out[,3], xlab="range of xy coordinates", ylab="Time (minute)",
type="l", col=cols[1], lwd=2, main="cutoff = 4", ylim=c(0, y.max));
for (i in 2:length(clu.u)){
o.i <- which(out.s[,1]==clu.u[i]);
out <- out.s[o.i,];
points(out[,2], out[,3], type="l", col=cols[i], lwd=2);
}
legend(20, 170, legend=clu.u[1:10], lwd=2, col=cols[1:10], bty="n");
legend(150, 170, legend=clu.u[10:19], lwd=2, col=cols[10:19], bty="n");
fig_label('B', pos='topleft',cex=3)
## Compution Time for 15973 single cells
out.s <- read.table("../data/supp/02clust2_out.txt", header=T);
clu.u <- unique(out.s[,1]);
y.max <- max(out.s[,3]);
clu.u <- unique(out.s[,1]);
cols <- rainbow(length(clu.u), alpha=0.8);
o.i <- which(out.s[,1]==10);
out <- out.s[o.i,];
plot(out[,2], out[,3], xlab="range of xy coordinates", ylab="Time (minute)",
type="l", col=cols[1], lwd=2, main="cutoff = 4", ylim=c(0, y.max));
for (i in 2:length(clu.u)){
o.i <- which(out.s[,1]==clu.u[i]);
out <- out.s[o.i,];
points(out[,2], out[,3], type="l", col=cols[i], lwd=2);
}
legend(200, 550, legend=clu.u[1:10], lwd=2, col=cols[1:10], bty="n");
legend(350, 550, legend=clu.u[10:19], lwd=2, col=cols[10:19], bty="n");
fig_label('C', pos='topleft',cex=3)
dev.off();