-
Notifications
You must be signed in to change notification settings - Fork 3
/
1cdef.Rmd
100 lines (85 loc) · 4.2 KB
/
1cdef.Rmd
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
---
title: "Figure 1"
output:
html_document:
df_print: paged
---
```{r}
suppressPackageStartupMessages(source("scripts/themes.R"))
```
## Figure 1b
```{r, warning=FALSE}
df.1bc <- read.table("data/fig1bc.csv", sep = ",", header = T, stringsAsFactors = F)
df.1bc$atlas <- factor(df.1bc$atlas, levels = legend_order)
p.1b <- ggplot(df.1bc, aes(x = total_cells, y = uncompressed/compressed, colour = atlas)) +
main +
xlab('Number of cells') + ylab("Compression fold") +
scale_color_brewer(palette = colorcode) +
geom_point(size = dotsize)
```
## Figure 1c
```{r, warning=FALSE}
p.1c.left <- ggplot(df.1bc, aes(x = total_cells, y = total_compressed/1024^2, colour = atlas)) +
main +
xlab('Number of cells') + ylab("Index size (MB)") +
scale_color_brewer(palette = colorcode) +
geom_point(size = dotsize)
p.1c.right <- ggplot(df.1bc, aes(x = sparsity, y = uncompressed/compressed, colour = atlas)) +
main +
xlab("Sparsity") + ylab("Compression fold") +
scale_color_brewer(palette = colorcode) +
geom_point(size = dotsize) + geom_smooth(method=lm, size = linesize)
```
## Figure 1d
```{r, warning=FALSE}
df.1d <- read.table("data/fig1d.csv", sep = ",", header = T, stringsAsFactors = F)
df.1d$atlas <- factor(df.1d$atlas, levels = legend_order)
p.1d <- ggplot(df.1d, aes(x = atlas, y = as.numeric(rho), fill = atlas)) +
main + theme(axis.text.x = element_blank()) + guides(col = guide_legend(ncol = 2)) +
ylab("rho")+ xlab("Atlas") +
scale_fill_brewer(palette = colorcode) +
geom_violin(trim = T) + geom_boxplot(width=0.1, fill="white")
```
## Figure 1e
```{r, warning=FALSE}
df.1e <- read.table("data/fig1e.csv", sep = ",", header = T, stringsAsFactors = F)
df.1e$atlas <- factor(df.1e$atlas, levels = legend_order)
p.1e <- ggplot(df.1e, aes(x = gene_number, y = as.numeric(x), colour = atlas)) +
main +
xlab("Number of genes") + ylab("Mean time (sec)") + labs(colour = "Atlas") +
scale_color_brewer(palette = colorcode) +
geom_point(size = dotsize) + geom_line(size = linesize) + geom_ribbon(aes(ymin=df.1e$x + df.1e$se, ymax = df.1e$x - df.1e$se), linetype = 1, alpha = 0.1)
```
## Figure 1f
```{r, warning=FALSE}
df.1f <- read.table("data/fig1f.csv", sep = ",", header = T, stringsAsFactors = F)
df.1f$method <- factor(df.1f$method, levels = c('scfind', 'sce', 'sce-sparseMatrix', 'seurat', 'seurat-sparseMatrix', 'loom', 'loom-1000', 'loom-5000'))
p.1f <- ggplot(df.1f, aes(x = no_of_markers, y = query_time, colour = method)) + geom_jitter(size = dotsize, alpha = 0.8) + main + labs(x = "Number of genes", y = "Query time (sec)") +
scale_colour_manual(
values = tritPalette[c(3,1,2,4,6,9,8)],
labels = c("SCfind", "SCE", "SCE-Sparse", "Seurat", "Seurat-Sparse", "Loom-1000", "Loom-5000")) +
scale_y_log10(limits = c(0.01, 15)) +
guides(colour = guide_legend(title = "File format"))
```
### Figure 1
```{r echo=FALSE, fig.height=5, fig.retina=10, fig.width=8, message=FALSE, warning=FALSE}
plot_grid(NULL,
NULL,
plot_grid(get_legend(p.1b + guides(col = guide_legend(ncol = 2)) + labs(colour = "Atlas") + theme(legend.key.size = unit(.5, "cm"))),
get_legend(p.1e + guides(col = guide_legend(ncol = 2)) + theme(legend.title=element_blank(), legend.key.size = unit(.5, "cm"))),
nrow = 2, align = "v"),
NULL,
NULL,
p.1b + theme(legend.position = "none") + scale_x_log10(breaks = trans_breaks("log10", function(x) 10^x), labels = trans_format("log10", math_format(10^.x))),
labels=c('A', '', '', 'B'),
align="h", ncol = 3, nrow = 2)
plot_grid(p.1c.left + theme(legend.position = "none") + scale_x_log10(breaks = trans_breaks("log10", function(x) 10^x), labels = trans_format("log10", math_format(10^.x))),
p.1c.right + theme(legend.position = "none"),
p.1d + theme(legend.position = "none"),
p.1e + theme(legend.position = "none") + scale_y_log10(limits = c(0.01, 3)),
p.1f + theme(legend.position = "none") + scale_y_log10(limits = c(0.01, 15)),
plot_grid(get_legend(p.1f),
ncol = 2, nrow = 1),
labels=c('C','', 'D','E', 'F'),
align="v", ncol = 3, nrow = 2)
```