-
Notifications
You must be signed in to change notification settings - Fork 0
/
ssDNA.R
36 lines (24 loc) · 939 Bytes
/
ssDNA.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
library(openxlsx)
library(reshape2)
wb <- loadWorkbook("/Users/mar/BIO/PROJECTS/STUDENTS/DENISOVA/FinalResultsBDNA/ss_bg_08.xlsx")
wb2 <- loadWorkbook("/Users/mar/BIO/PROJECTS/STUDENTS/DENISOVA/FinalResultsBDNA/structure_BDNA.xlsx")
data <- read.xlsx(wb, sheet=1)
data <- data.table(data)
data2 <- read.xlsx(wb2, sheet=1)
data2 <- data.table(data2)
dt <- data[X1 == "All"]
dt2 <- data2[X1 == "all"]
dt[,X1 := NULL]
dt2[,X1 := NULL]
dtm <- melt(dt)
dt2m <- melt(dt2)
final <- merge(dtm,dt2m,by="variable")
final <- data.table(final)
final[,ratio := value.x/value.y]
ggplot(final,aes(x=variable,y=ratio)) + geom_bar(stat="identity",fill="lightblue") +
theme(panel.background = element_blank(),
axis.text.x = element_text(angle=90),
axis.title.x = element_blank(),
axis.line = element_line(color="black"),
legend.position = "bottom") +
scale_y_continuous(expand = c(0, 0), limits = c(0, NA))