-
Notifications
You must be signed in to change notification settings - Fork 1
/
GRCh38_Scripts_Figure_2_and_3.R
107 lines (90 loc) · 3.4 KB
/
GRCh38_Scripts_Figure_2_and_3.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
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
101
102
103
104
105
106
library(easyGgplot2)
library(ggplot2)
library(dplyr)
library(tidyverse)
library(devtools)
library(reshape2)
library(ggpubr)
theme_set(
theme_bw() +
theme(legend.position = "top")
)
setwd("/Users/behera/GRCh38_bug/GRCh38_bug") # change to directory that contains the files
#Masked Mapping: Figure 2A
data <- read.csv("duplicated_mapping_latest.csv", sep = "," , header = TRUE)
df1<-tibble(data)
head(df1)
colnames(df1) <- c("Gene", "Original mapping", "FixItFelix")
df1
print(df1)
dfm <- melt(df1[,c('Gene','Original mapping','FixItFelix')],id.vars = 1, variable.name='Mapping')
dfm
# bar plot
png(file="duplicated_mapping.png", height=1000, width=1500, res=150)
ggplot(dfm,aes(x = fct_inorder(Gene),y = value,color = Mapping)) +
geom_bar(aes(fill = Mapping),stat = "identity",position = "dodge") +
labs(title = "", x = "Gene(s)", y = "Average mapping quality") +
theme(axis.text.x = element_text(angle = 120, vjust = 0.5, hjust=1)) +
theme(text = element_text(size = 20)) +
theme(legend.position="top")
dev.off()
#Collapsed mapping: Figure 2B
data <- read.csv("collapsed_mapping_latest.csv", sep = "," , header = TRUE)
df1<-tibble(data)
head(df1)
colnames(df1) <- c("Gene", "Original mapping", "FixItFelix")
df1
print(df1)
dfm <- melt(df1[,c('Gene','Original mapping','FixItFelix')],id.vars = 1, variable.name='Mapping')
dfm
# bar plot
png(file="collapsed_mapping.png", height=1500, width=1500, res=150)
ggplot(dfm,aes(x = fct_inorder(Gene),y = value,color = Mapping)) +
geom_bar(aes(fill = Mapping),stat = "identity",position = "dodge") +
labs(title = "", x = "Gene", y = "Average mapping quality") +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
theme(text = element_text(size = 25)) +
theme(legend.position="top")
dev.off()
#HG002_dipcall_duplicated_regionwise: Figure 3B
setwd("/Users/behera/GRCh38_bug/GRCh38_bug")
data <- read.csv("HG002_dipcall_collapsed_Fscore_latest.csv", sep = "," , header = TRUE)
df1<-tibble(data)
df1
class(data)
df1<-tibble(data)
df1
colnames(df1) <- c("Gene", "Original mapping", "FixItFelix")
df1
print(df1)
dfm <- melt(df1[,c('Gene','Original mapping','FixItFelix')],id.vars = 1, variable.name='Mapping')
dfm
png(file="duplicated_fscore_regionwise.png", height=1000, width=1500, res=150)
ggplot(data = dfm)+
geom_point(aes(x = Gene, y = value, color=Mapping, shape=Mapping), size = 10) +
labs(title = "", x = "Gene(s)", y = "F-measure", color="Mapping:", shape="Mapping:") +
theme(axis.text.x = element_text(angle = 120, vjust = 0.5, hjust=1)) +
theme(text = element_text(size = 25)) +
theme(legend.position="top")
dev.off()
#HG002_dipcall_masked_regionwise: Figure 3B
setwd("/Users/behera/GRCh38_bug/GRCh38_bug")
data <- read.csv("HG002_dipcall_collapsed_Fscore_latest.csv", sep = "," , header = TRUE)
df1<-tibble(data)
df1
class(data)
df1<-tibble(data)
df1
colnames(df1) <- c("Gene", "Original mapping", "FixItFelix")
df1
print(df1)
dfm <- melt(df1[,c('Gene','Original mapping','FixItFelix')],id.vars = 1, variable.name='Mapping')
dfm
png(file="collapsed_fscore_regionwise.png", height=1000, width=1500, res=150)
ggplot(data = dfm)+
geom_point(aes(x = Gene, y = value, color=Mapping, shape=Mapping), size = 10) +
labs(title = "", x = "Gene", y = "F-measure", color="Mapping:", shape="Mapping:") +
theme(axis.text.x = element_text(angle = 120, vjust = 0.5, hjust=1)) +
theme(text = element_text(size = 25)) +
theme(legend.position="top")
dev.off()