-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCost.Rmd
executable file
·99 lines (76 loc) · 3.48 KB
/
Cost.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
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)
```
##Purpose:
Figure 2e -- Cost
#Protocol:
###1. Load the following packages:
```{r packages}
library(tidyverse)
library(ggsignif)
library(ggrepel)
library(edgeR)
library(genefilter)
library(grid)
library(gridExtra)
library(ggsci)
fig_path<-"/data/share/htp/prime-seq_Paper/Fig_cost/"
#prevent scientific notation
options(scipen=999)
```
###2. Load following functions:
```{r functions}
theme_pub <- theme_bw() + theme(
plot.title = element_text(hjust = 0.5, size=18, face="bold"),
axis.text = element_text(colour="black", size=14),
axis.title=element_text(size=16,face="bold"),
legend.text=element_text(size=14),
legend.position="right",
axis.line.x = element_line(colour = "black"),
axis.line.y = element_line(colour = "black"),
strip.background=element_blank(),
strip.text=element_text(size=16))
```
## Price Plots
###3. Lysis Plot
```{r load_counts}
method_colors<-c("gray20","gray30","gray40","gray50","gray60","gray70","gray80","#008080")
names(method_colors)<-c("SMARTer Stranded Total RNA",
"SMART-Seq v4",
"TruSeq",
"TruSeq Stranded",
"Illumina Stranded",
"brb-seq (Nextera)",
"brb-seq (custom)",
"prime-seq")
possiblesamples <- read.csv(paste0(fig_path,"method_cost.csv"), header = T, stringsAsFactors = F)
#factor
possiblesamples$Method<-factor(possiblesamples$Method,levels=(c("SMARTer Stranded Total RNA",
"SMART-Seq v4",
"TruSeq",
"TruSeq Stranded",
"Illumina Stranded",
"brb-seq (Nextera)",
"brb-seq (custom)",
"prime-seq")))
possiblesamples_bar <- ggplot(possiblesamples, aes(x=Method, y=Samples))+
geom_bar(aes(fill=Method), stat = "identity", width=0.6)+
geom_label(aes(x= Method, y = Samples+25, label = Samples), data = possiblesamples)+
ylab("Number of Samples") +
scale_fill_manual(values = method_colors)+
scale_x_discrete(name = 'RNA-seq Method',
breaks = c('SMARTer Stranded Total RNA', 'SMART-Seq v4', 'TruSeq', 'TruSeq Stranded', 'Illumina Stranded', 'brb-seq (Nextera)','brb-seq (custom)','prime-seq'),
labels = c('SMARTer\nStranded\nTotal RNA', 'SMART-Seq\n(v4)', 'TruSeq', 'TruSeq\nStranded', 'Illumina\nStranded','brb-seq\n(Nextera)','brb-seq\n(custom)','prime-seq'))+
theme_pub+
ggtitle("Experiment Sample Size with a Set Budget ($500)")+
theme(legend.position= "none",
panel.grid.major.x = element_blank())
ggsave(possiblesamples_bar,
device = "pdf",
path = fig_path,
width = 300,
height = 150,
units = "mm",
filename = "Fig6A.pdf"
)
```