-
Notifications
You must be signed in to change notification settings - Fork 0
/
01-TCMSP.Rmd
143 lines (111 loc) · 3.36 KB
/
01-TCMSP.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
```{r}
my_packages <- c("tidyverse", "data.table",
"ggplot2", "ggpubr", "patchwork",
"ggvenn")
pacman::p_load(char = my_packages)
tmp <- list()
```
# Preparation
Shen Ling Bai Zhu San(SLBZS)
## Uniprot
```{r}
# gancao_drug <- fread("Input/TCMSP/gancao/chemical_attr.csv")
# gancao_target <- fread("Input/TCMSP/gancao/chemical_tar.csv")
```
Uniprot:
```{r}
uniprot_df <- fread("Input/uniprotkb_AND_model_organism_9606_AND_r_2024_01_22.tsv.gz")
# table(gancao_target$target_name %in% uniprot_df$`Protein names`)
```
```{r}
uniprot_df$ProteinNames <- gsub(" \\(.*", "",
uniprot_df$`Protein names`)
# table(gancao_target$target_name %in% uniprot_df$ProteinNames)
# gancao_target$target_name[!gancao_target$target_name %in% uniprot_df$ProteinNames] %>% head()
```
Discard unmapped targets.
```{r}
uniprot_df <- separate(uniprot_df, col = `Gene Names`, into = c("GeneNames", "others"),sep = " ")
```
```{r}
# gancao_target_sel <- gancao_target[!gancao_target$target_name %in% uniprot_df$ProteinNames,]
# gancao_target_sel_vec <- unique(gancao_target_sel$target_name)
#
# test <- lapply(gancao_target_sel_vec, function(target){
# grep(target, uniprot_df$ProteinNames)
# })
```
## TCMSP
```{r}
herbs <- dir("Input/TCMSP")
herbs <- herbs[!herbs %in% c("gancao")]
target_df <- lapply(herbs, function(x){
df <- fread(paste0("Input/TCMSP/", x, "/chemical_tar.csv"))
df$herb <- x
df
})
target_df <- do.call(rbind, target_df)
attr_df <- lapply(herbs, function(x){
df <- fread(paste0("Input/TCMSP/", x, "/chemical_attr.csv"))
df$herb <- x
df
})
attr_df <- do.call(rbind, attr_df)
```
# Filter chemicals
Ref: Gancao Nurish-Yin Decoction medicated serum inhibits growth and migration of ovarian cancer cells: Network pharmacology-based analysis and biological validation
with cut off values for oral bioavailability (OB) ≥ 30% and drug-like properties (DL) ≥ 0.18.
```{r}
attr_df2 <- attr_df[attr_df$ob >= 30 & attr_df$dl >= 0.18,]
```
```{r}
target_df2 <- target_df[target_df$MOL_ID %in% attr_df2$MOL_ID,]
table(unique(target_df2[,c("herb", "molecule_name")])$herb)
```
# Merge with uniprot
```{r}
uniprot_df3 <- uniprot_df[,c(3,5,7)]
target_df3 <- merge(target_df2, uniprot_df3,
by.x = "target_name", by.y = "ProteinNames")
```
```{r}
table(unique(target_df3[,c("herb", "molecule_name")])$herb)
```
# Merge with disease genes
genecard:
```{r}
genecard_df <- fread("Input/Target/GeneCards-SearchResults.csv")
genecard_df2 <- genecard_df[genecard_df$`Relevance score` > 35,]
```
DisGeNET:
```{r}
disgenet_df <- fread("Input/Target/C0919267__C0029925__C0677886_disease_gda_evidences.tsv")
disgenet_df2 <- disgenet_df[disgenet_df$Score_gda > .4,]
```
```{r}
ovarian_genes <- unique(c(genecard_df2$`Gene Symbol`, disgenet_df2$Gene))
target_df4 <- target_df3[target_df3$GeneNames %in% ovarian_genes,]
length(unique(target_df4$GeneNames))
table(unique(target_df4[,c("herb", "molecule_name")])$herb)
```
# ggVenn
```{r}
ovarian_genes_list <- list(
`SLBZS genes` = unique(target_df3$GeneNames),
`Ovarian cancer genes` = ovarian_genes
)
p1 <- ggvenn(ovarian_genes_list, set_name_size = 6)
p1
```
```{r}
ggsave(plot = p1,
filename = "Plot/p1.png",
width = 7,
height = 7,
units = "in",
dpi = 300)
```
# Save
```{r}
saveRDS(target_df4, file = "Output/01/target_df4.Rds")
```