forked from Allen188/CVDSBA
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathCVDSBA_UMAP.Rmd
180 lines (136 loc) · 4.24 KB
/
CVDSBA_UMAP.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
172
173
174
175
176
177
178
179
180
```{r metabo}
rm(list=ls())
library(umap)
source("common.R")
source("datamining_library_ge20200306.R")
library(readr)
library(plyr)
library(readxl)
library(stringr)
library(magrittr)
library(Mfuzz)
df<-read.csv("meta_matrix_log2delectNA08anddrug36_NAmin20200329(1).csv" )
row.names(df)<-c(as.matrix(df$X))
df2<-data.frame(t(df[-1]))
df3<-data.frame(row.names(df2),df2)
df3$row.names.df2.<-gsub("\\d+","",df3$row.names.df2.,perl = T)
df1<-df3
names(df1)<-c("label",c(as.matrix(names(df1[,-c(1)]))))
set.seed(2020)
color<-c("firebrick1","forestgreen","dodgerblue","navyblue")
pdf("UMAP_2020_allprotein_meta_847feature.pdf")
drawUMAP(df1[,],ptColors = color,rowNormalization =F, colNormalization = T)
```
```{r proteome}
rm(list=ls())
library(umap)
source("common.R")
source("datamining_library_ge20200306.R")
library(readr)
library(plyr)
library(readxl)
library(stringr)
library(magrittr)
library(Mfuzz)
info <- read_xlsx("sampleinfo2.xlsx")
info$TMT <- gsub("^b","F",info$TMT)
################d
df2<-read.table("proteomic_matrix_ratio20200328.txt",header = T,sep = "\t",row.names = 1)
df3<-data.frame(names(df2),t(df2))
names(df3)<-c("TMT",as.matrix(names(df3[,-1])))
df4<-merge(info,df3,by.x = "TMT")
df1<-df4
names(df1)<-c('patient',"label",c(as.matrix(names(df1[,-c(1:2)]))))
df2<-data.frame(df1[-c(which(df1$label==c("NA"))),])
row.names(df2)<-c(as.matrix(df2$patient))
set.seed(2020)
color<-c("firebrick1","forestgreen","dodgerblue","navyblue")
pdf("UMAP_2020_allprotein.pdf")
drawUMAP(df2[,-1],ptColors = color,rowNormalization =F, colNormalization = T)
```
```{r proteome_severe_nonsevere_label}
rm(list=ls())
library(umap)
source("common_change_label.R")
source("datamining_library_ge20200306.R")
library(readr)
library(plyr)
library(readxl)
library(stringr)
protein<-read.csv("proteomic_training_severe_nonsevere.csv",row.names = 1)
color=c("#DA942C","#8D2926")
set.seed(2020)
pdf("proteomic_training_severe_nonsevereABCD.pdf")
drawUMAP(protein,ptColors = color,rowNormalization =F, colNormalization = T)
rm(list=ls())
library(umap)
source("common_change_label.R")
source("datamining_library_ge20200306.R")
library(readr)
library(plyr)
library(readxl)
library(stringr)
protein<-read.csv("proteomic_training_severe_nonsevere.csv",row.names = 1)
protein<-protein[1:18,]
color=c("#DA942C")
set.seed(2020)
pdf("proteomic_training_nonsevere.pdf")
drawUMAP(protein,ptColors = color,rowNormalization =F, colNormalization = T)
rm(list=ls())
# library(umap)
source("common_change_label.R")
source("datamining_library_ge20200306.R")
library(readr)
library(plyr)
library(readxl)
library(stringr)
protein<-read.csv("proteomic_training_severe_nonsevere.csv",row.names = 1)
protein<-protein[19:31,]
color=c("#8D2926","black")
set.seed(2020)
pdf("proteomic_training_severe.pdf")
drawUMAP(protein,ptColors = color,rowNormalization =F, colNormalization = T)
```
```{r metabo_severe_nonsevere_label}
rm(list=ls())
library(umap)
source("common_change_label.R")
source("datamining_library_ge20200306.R")
library(readr)
library(plyr)
library(readxl)
library(stringr)
protein<-read.csv("meta_training_severe_nonsevere.csv",row.names = 1)
color=c("#DA942C","#8D2926")
set.seed(2020)
pdf("meta_training_severe_nonsevere_ABCD.pdf")
drawUMAP(protein,ptColors = color,rowNormalization =F, colNormalization = T)
rm(list=ls())
library(umap)
source("common_change_label.R")
source("datamining_library_ge20200306.R")
library(readr)
library(plyr)
library(readxl)
library(stringr)
protein<-read.csv("meta_training_severe_nonsevere.csv",row.names = 1)
protein<-protein[1:18,]
color=c("#DA942C")
set.seed(2020)
pdf("meta_training_nonsevere.pdf")
drawUMAP(protein,ptColors = color,rowNormalization =F, colNormalization = T)
rm(list=ls())
# library(umap)
source("common_change_label.R")
source("datamining_library_ge20200306.R")
library(readr)
library(plyr)
library(readxl)
library(stringr)
protein<-read.csv("meta_training_severe_nonsevere.csv",row.names = 1)
protein<-protein[19:31,]
color=c("#8D2926","black")
set.seed(2020)
pdf("meta_training_severe.pdf")
drawUMAP(protein,ptColors = color,rowNormalization =F, colNormalization = T)
```