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
|
ttd_drug = fread("P1-02-TTD_drug_download.txt", skip = 29, header = F)
head(ttd_drug)
drug_DRUGCLAS = ttd_drug %>%
dplyr::filter(V2=="DRUGCLAS") %>%
dplyr::select(V1, V3) %>%
dplyr::rename(DrugID=V1,DRUGCLAS=V3)
head(drug_DRUGCLAS)
table(drug_DRUGCLAS$DRUGCLAS)
drug_THERCLAS = ttd_drug %>%
dplyr::filter(V2=="THERCLAS") %>%
dplyr::select(V1, V3) %>%
dplyr::rename(DrugID=V1,THERCLAS=V3)
head(drug_THERCLAS)
drug_DRUGTYPE = ttd_drug %>%
dplyr::filter(V2=="DRUGTYPE") %>%
dplyr::select(V1, V3) %>%
dplyr::rename(DrugID=V1,DRUGTYPE=V3)
head(drug_DRUGTYPE)
drug_DRUGINCH = ttd_drug %>%
dplyr::filter(V2=="DRUGINCH") %>%
dplyr::select(V1, V3) %>%
dplyr::rename(DrugID=V1,DRUGINCH=V3)
head(drug_DRUGINCH)
drug_DRUGINKE = ttd_drug %>%
dplyr::filter(V2=="DRUGINKE") %>%
dplyr::select(V1, V3) %>%
dplyr::rename(DrugID=V1,DRUGINKE=V3)
head(drug_DRUGINKE)
drug_DRUGSMIL = ttd_drug %>%
dplyr::filter(V2=="DRUGSMIL") %>%
dplyr::select(V1, V3) %>%
dplyr::rename(DrugID=V1,DRUGSMIL=V3)
head(drug_DRUGSMIL)
drug_HIGHSTAT = ttd_drug %>%
dplyr::filter(V2=="HIGHSTAT") %>%
dplyr::select(V1, V3) %>%
dplyr::rename(DrugID=V1,HIGHSTAT=V3)
head(drug_HIGHSTAT)
drug_info = drug_DRUGCLAS %>%
dplyr::full_join(drug_THERCLAS) %>%
dplyr::full_join(drug_DRUGTYPE) %>%
dplyr::full_join(drug_DRUGINCH) %>%
dplyr::full_join(drug_DRUGINKE) %>%
dplyr::full_join(drug_DRUGSMIL) %>%
dplyr::full_join(drug_HIGHSTAT)
drug_supp = fread("P1-03-TTD_crossmatching.txt", skip = 27, header = F)
head(drug_supp)
drug_DRUGNAME = drug_supp %>%
dplyr::filter(V2=="DRUGNAME") %>%
dplyr::select(V1, V3) %>%
dplyr::rename(DrugID=V1,DRUGNAME=V3)
head(drug_DRUGNAME)
drug_CASNUMBE = drug_supp %>%
dplyr::filter(V2=="CASNUMBE") %>%
dplyr::select(V1, V3) %>%
dplyr::rename(DrugID=V1,CASNUMBE=V3) %>%
dplyr::mutate(CASNUMBE=sub("CAS ","",CASNUMBE))
head(drug_CASNUMBE)
drug_D_FOMULA = drug_supp %>%
dplyr::filter(V2=="D_FOMULA") %>%
dplyr::select(V1, V3) %>%
dplyr::rename(DrugID=V1,D_FOMULA=V3)
head(drug_D_FOMULA)
drug_PUBCHCID = drug_supp %>%
dplyr::filter(V2=="PUBCHCID") %>%
dplyr::select(V1, V3) %>%
dplyr::rename(DrugID=V1,PUBCHCID=V3)
head(drug_PUBCHCID)
drug_info = drug_info %>%
dplyr::full_join(drug_DRUGNAME) %>%
dplyr::full_join(drug_CASNUMBE) %>%
dplyr::full_join(drug_D_FOMULA) %>%
dplyr::full_join(drug_PUBCHCID)
head(drug_info)
write.csv(drug_info, file = "TTD_drug_info_v8101.csv")
|