-
Notifications
You must be signed in to change notification settings - Fork 1
/
EDA.Rmd
172 lines (134 loc) · 6.47 KB
/
EDA.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
title: "Chemical Space"
author: "Chuleeporn Phanus-umporn, Saw Simeon, Watshara Shoombuatong and Chanin Nantasenamat"
date: "July 13, 2559 BE"
output: pdf_document
---
## Chemical space of anti-sickling
```{r, warning=FALSE, message=FALSE, error=FALSE, cache = TRUE}
library(cowplot)
data <- read.csv("Linpiski_Descriptors.csv")
descriptors_name <- c("ALogP", "nHBAcc", "nHBDon", "MW")
descriptors <- data[, descriptors_name]
Activity <- data$Activity
data_2 <- cbind(Activity, descriptors)
data_plot <- data.frame(data_2)
p <- ggplot(data_plot, aes(MW, ALogP))
p <- p + geom_point(aes(colour = factor(Activity)), size = 3, alpha = 0.7)
p <- p + theme(legend.position = ("none"),
panel.border = element_rect(linetype = "solid",
colour = "black", fill = NA, size = 1),
axis.text.x = element_text(colour = "black", size = 10),
axis.text.y = element_text(colour = "black", size = 10),
plot.margin = grid::unit(c(1, 1, 1, 1), "cm"),
axis.title.x = element_text(colour = "black", size = 15, face = "bold"),
axis.title.y = element_text(colour = "black", size = 15, face = "bold"))
print(p)
```
\pagebreak
## Visualization of Lipinski's descriptors
### Chemical space of AChE inhibitors are shown as active (green), inactive (red) and intermediate (blue)
```{r, warning= FALSE, message=FALSE, cache = TRUE}
library(ggplot2)
library(cowplot)
data_2 <- cbind(Activity, descriptors)
data_2 <- na.omit(data_2)
data_plot <- data.frame(data_2)
p <- ggplot(data_plot, aes(MW, ALogP))
p <- p + geom_point(aes(colour = factor(Activity)), size = 3, alpha = 0.3)
p <- p + theme(legend.position = ("none"),
panel.border = element_rect(linetype = "solid",
colour = "black", fill = NA, size = 1),
axis.text.x = element_text(colour = "black", size = 10),
axis.text.y = element_text(colour = "black", size = 10),
plot.margin = unit(c(1, 1, 1, 1), "cm"),
axis.title.x = element_text(colour = "black", size = 15, face = "bold"),
axis.title.y = element_text(colour = "black", size = 15, face = "bold")
)
print(p)
```
\pagebreak
### Boxplot of Lipinski's rule-of-five descriptors (ALogP)
```{r, warning= FALSE, message=FALSE, cache = TRUE}
p_1 <- ggplot(data_plot, aes(factor(Activity), ALogP))
p_1 <- p_1 + geom_boxplot(aes(fill = factor(Activity)), alpha = 0.7)
p_1 <- p_1 + theme(legend.position = ("none"),
panel.border = element_rect(linetype = "solid",
colour = "black", fill = NA, size = 1),
axis.text.x = element_text(colour = "black", size = 15),
axis.text.y = element_text(colour = "black", size = 15),
plot.margin = unit(c(1, 1, 1, 1), "cm"),
axis.title.y = element_text(size = 20, face = "bold"),
axis.title.x = element_blank())
print(p_1)
```
\pagebreak
### Boxplot of Lipinski's rule-of-five descriptors (nHBAcc)
```{r, warning= FALSE, message=FALSE, cache = TRUE}
p_2 <- ggplot(data_plot, aes(factor(Activity), nHBAcc))
p_2 <- p_2 + geom_boxplot(aes(fill = factor(Activity)), alpha = 0.7)
p_2 <- p_2 + theme(legend.position = ("none"),
panel.border = element_rect(linetype = "solid",
colour = "black", fill = NA, size = 1),
axis.text.x = element_text(colour = "black", size = 15),
axis.text.y = element_text(colour = "black", size = 15),
plot.margin = unit(c(1, 1, 1, 1), "cm"),
axis.title.y = element_text(size = 20, face = "bold"),
axis.title.x = element_blank())
print(p_2)
```
\pagebreak
### Boxplot of Lipinski's rule-of-five descriptors (nHBDon)
```{r, warning= FALSE, message=FALSE, cache = TRUE}
p_3 <- ggplot(data_plot, aes(factor(Activity), nHBDon))
p_3 <- p_3 + geom_boxplot(aes(fill = factor(Activity)), alpha = 0.7)
p_3 <- p_3 + theme(legend.position = ("none"),
panel.border = element_rect(linetype = "solid",
colour = "black", fill = NA, size = 1),
axis.text.x = element_text(colour = "black", size = 15),
axis.text.y = element_text(colour = "black", size = 15),
plot.margin = unit(c(1, 1, 1, 1), "cm"),
axis.title.y = element_text(size = 20, face = "bold"),
axis.title.x = element_blank())
print(p_3)
```
\pagebreak
### Boxplot of Lipinski's rule-of-five descriptors (MW)
```{r, warning= FALSE, message=FALSE, cache = TRUE}
p_4 <- ggplot(data_plot, aes(factor(Activity), MW))
p_4 <- p_4 + geom_boxplot(aes(fill = factor(Activity)), alpha = 0.7)
p_4 <- p_4 + theme(legend.position = ("none"),
panel.border = element_rect(linetype = "solid",
colour = "black", fill = NA, size = 1),
axis.text.x = element_text(colour = "black", size = 15),
axis.text.y = element_text(colour = "black", size = 15),
plot.margin = unit(c(1, 1, 1, 0.4), "cm"),
axis.title.y = element_text(size = 20, face = "bold"),
axis.title.x = element_blank())
print(p_4)
```
\pagebreak
# Arranging boxplot of Lipinski's rule-of-file descriptors (ALogP, nHBAcc, nHBDon, MW)
```{r, fig.width = 10, fig.height= 10, warning=FALSE, message=FALSE, cache = TRUE}
library(cowplot)
plot_grid(p_1, p_2, p_3, p_4)
```
## EDA of feature important analysis
```{r, fig.width = 20, fig.height = 10, warning = FALSE, message = FALSE, fig.align = 'center', cache = TRUE}
library(caret)
library(reshape2)
df <- read.csv("data.csv")
names <- c("Activity", "SubFPC171", "SubFPC5", "SubFPC1", "SubFPC298", "SubFPC2", "SubFPC16", "SubFPC173", "SubFPC18", "SubFPC275",
"SubFPC100")
df <- df[, names]
data_melt <- melt(df)
ggplot(aes(y = value, x = variable, fill = Activity), data = data_melt) + geom_boxplot() +
ylab("Substructure Count") + theme(
legend.position = "none",
axis.text.y = element_text(size = 20, colour = "black"),
axis.text.x = element_text(size = 20, colour = "black"),
plot.margin = unit(c(1,1, 1, 1),"cm"),
panel.border = element_rect(linetype = "solid", colour = "black", fill = NA, size = 1),
axis.title = element_text(size = 25, face = "bold", colour = "black")
)
```