-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path06-pkg-4-analyze.Rmd
436 lines (306 loc) · 20.3 KB
/
06-pkg-4-analyze.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# Molecular Data Analysis {#data-analysis}
1. For each function, we will introduce its basic use and example output. Users can check all analysis or visualization parameters available by clicking the corresponding title link.
2. Among most functions, their first parameter is molecular identifier of one data type. Users can also design a molecular signature comprised of multiple molecules (e.g. `TP53 + 2 * KRAS - 1.3 * PTEN`).
3. Users can also modify alternative datasets if available for one molecular type through the `opt_pancan` parameter. (see more via `str(.opt_pancan)`)
## TCGA analysis
```{r analyze-tcga-func, echo = FALSE}
data = readxl::read_excel("images/table_02.xlsx")
data = subset(data, Database == "TCGA")
# data = subset(data, Function !="vis_pancan_anatomy()")
knitr::kable(
data, caption = 'Specilized functions to analyze TCGA molecular data',
align = "l",
booktabs = TRUE
)
```
### Comparison analysis
#### [vis_toil_TvsN()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_toil_TvsN.html) {#vis-toil-TvsN}
Compare molecular value between tumor and normal samples across pan-cancer. ([Custom module](#m-vis_toil_TvsN))
- Basic use: `vis_toil_TvsN(Gene=, data_type=)`
```{r vis-toil-TvsN, message=FALSE, fig.cap='The difference of mRNA TP53 across pan-cancer', out.width='80%', fig.align='center', fig.height=6, fig.width=10, cache=TRUE}
vis_toil_TvsN(Gene="TP53", data_type = "mRNA")
```
#### [vis_toil_TvsN_cancer()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_toil_TvsN_cancer.html) {#vis-toil-TvsN-cancer}
Compare molecular value between tumor and normal samples in one cancer. ([Custom module](#m-vis_toil_TvsN))
- Basic use: `vis_toil_TvsN_cancer(Gene=, data_type=, Cancer=)`
```{r vis-toil-TvsN-cancer, message=FALSE, fig.cap='The difference of mRNA TP53 in ACC cancer', out.width='80%', fig.align='center', fig.height=6, fig.width=6, cache=TRUE}
vis_toil_TvsN_cancer(Gene="TP53", data_type = "mRNA", Cancer = "BRCA")
```
#### [vis_pancan_anatomy()](https://openbiox.github.io/UCSCXenaShiny/refervis_pancan_anatomy.html) {#vis-pancan-anatomy}
- Basic use: `vis_pancan_anatomy(Gene="TP53", Gender=, data_type="mRNA")`
```{r vis-pancan-anatomy, message=FALSE, warning=FALSE, fig.cap='The difference of mRNA TP53 in Pan-cancer', out.width='80%', fig.align='center', fig.height=6, fig.width=6, cache=TRUE}
vis_pancan_anatomy(Gene = "TP53", Gender = "Male", data_type= "mRNA")
```
#### [vis_toil_Mut()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_toil_Mut.html) {#vis-toil-Mut}
Compare molecular value between mutation and wild tumor samples across pan-cancer. ([Custom module](#m-vis-toil-Mut))
- Basic use: `vis_toil_Mut(mut_Gene=, Gene=, data_type=)`
```{r vis-toil-Mut, message=FALSE, fig.cap='The difference of mRNA TNF between TP53-mut and TP53-wild tumor samples across pan-cancer', out.width='80%', fig.align='center', fig.height=6, fig.width=10, cache=TRUE}
vis_toil_Mut(mut_Gene = "TP53", Gene = "TNF", data_type = "mRNA")
```
#### [vis_toil_Mut_cancer()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_toil_Mut_cancer.html) {#vis-toil-Mut-cancer}
Compare molecular value between mutation and wild tumor samples in one cancer. ([Custom module](#m-vis-toil-Mut))
- Basic use: `vis_toil_Mut_cancer(Gene=, data_type=, Cancer=)`
```{r vis-toil-Mut-cancer, message=FALSE, fig.cap='The difference of mRNA TNF between TP53-mut and TP53-wild tumor samples in BRCA cancer', out.width='80%', fig.align='center', fig.height=6, fig.width=6, cache=TRUE}
vis_toil_Mut_cancer(mut_Gene = "TP53", Gene = "TNF", data_type = "mRNA", Cancer = "BRCA")
```
### Correlation analysis
#### [vis_gene_cor()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_gene_cor.html) {#vis-gene-cor}
Calculate the correlation between two molecules value in tumor samples of pan-cancers. ([Custom module](#m-vis-gene-cor))
- Basic use: `vis_gene_cor(Gene1=, data_type1=, Gene2=, data_type2=)`
```{r vis-gene-cor, message=FALSE, fig.cap='The correlation between mRNA CSF1R and mRNA JAK3 in tumor samples of pan-cancers', out.width='80%', fig.align='center', cache=TRUE}
vis_gene_cor(Gene1 = "CSF1R", data_type1 = "mRNA", Gene2 = "JAK3", data_type2 = "mRNA")
```
#### [vis_gene_cor_cancer()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_gene_cor_cancer.html) {#vis-gene-cor-cancer}
Calculate the correlation between two molecules value in tumor samples of one cancer. ([Custom module](#m-vis-gene-cor))
- Basic use: `vis_gene_cor_cancer(Gene1=, data_type1=, Gene2=, data_type2=, cancer_choose=)`
```{r vis-gene-cor-cancer, message=FALSE, fig.cap='The correlation between mRNA CSF1R and mRNA JAK3 in tumor samples of ACC cancer', out.width='80%', fig.align='center', cache=TRUE}
vis_gene_cor_cancer(Gene1 = "CSF1R", data_type1 = "mRNA",
Gene2 = "JAK3", data_type2 = "mRNA",
cancer_choose = "ACC")
```
#### [vis_gene_TIL_cor()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_gene_TIL_cor.html) {#vis-gene-TIL-cor}
Calculate the correlation between one molecule and one type of TIL in tumor samples across pan-cancers. ([Custom module](#m-vis-gene-TIL-cor))
- Basic use: `vis_gene_TIL_cor(Gene= ,data_type= ,sig=)`
```{r cache=TRUE}
tcga_ids = load_data("pancan_identifier_help")
names(tcga_ids$id_TIL)
```
```{r vis-gene-TIL-cor, message=FALSE, fig.cap='The correlation between mRNA TP53 and TIMER TIL in tumor samples across pan-cancers', fig.align='center',fig.height=3, fig.width=12, cache=TRUE}
sig = paste(tcga_ids$id_TIL$TIMER$Level3,
tcga_ids$id_TIL$TIMER$Level2, sep = "_")
vis_gene_TIL_cor(Gene = "TP53", data_type = "mRNA",
sig = sig)
```
#### [vis_gene_immune_cor()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_gene_immune_cor.html) {#vis-gene-immune-cor}
Calculate the correlation between one molecule and one type of Immune signature in tumor samples across pan-cancers. ([Custom module](#m-vis-gene-immune-cor))
- Basic use: `vis_gene_immune_cor(Gene= ,data_type= ,sig=)`
```{r cache=TRUE}
tcga_pan_immune_signature <- load_data("tcga_pan_immune_signature")
table(tcga_pan_immune_signature$Source)
```
```{r vis-gene-immune-cor, message=FALSE,warning=FALSE, fig.cap='The correlation between mRNA TP53 and Cibersort signature in tumor samples across pan-cancers', fig.align='center',fig.height=6, fig.width=12, cache=TRUE}
vis_gene_immune_cor(Gene = "TP53", data_type = "mRNA",
Immune_sig_type = "Cibersort")
```
#### [vis_gene_tmb_cor()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_gene_tmb_cor.html) {#vis-gene-tmb-cor}
Calculate the correlation between one molecule and TMB score in tumor samples across pan-cancers. ([Custom module](#m-vis-gene-index))
- Basic use: `vis_gene_tmb_cor(Gene= , data_type= )`
```{r vis-gene-tmb-cor, message=FALSE, fig.cap='The correlation between mRNA TP53 and TMB score in tumor samples across pan-cancers', fig.align='center',fig.height=2, fig.width=12, cache=TRUE}
vis_gene_tmb_cor(Gene = "TP53", data_type = "mRNA")
```
#### [vis_gene_msi_cor()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_gene_msi_cor.html) {#vis-gene-msi-cor}
Calculate the correlation between one molecule and MSI score in tumor samples across pan-cancers. ([Custom module](#m-vis-gene-index))
- Basic use: `vis_gene_msi_cor(Gene= , data_type= )`
```{r vis-gene-msi-cor, message=FALSE, fig.cap='The correlation between mRNA TP53 and MSI score in tumor samples across pan-cancers', fig.align='center',fig.height=2, fig.width=12, cache=TRUE}
vis_gene_msi_cor(Gene = "TP53", data_type = "mRNA")
```
#### [vis_gene_stemness_cor()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_gene_stemness_cor.html) {#vis-gene-stemness-cor}
Calculate the correlation between one molecule and stemness score in tumor samples across pan-cancers. ([Custom module](#m-vis-gene-index))
- Basic use: `vis_gene_stemness_cor(Gene= , data_type= )`
```{r vis-gene-stemness-cor, message=FALSE, fig.cap='The correlation between mRNA TP53 and stemness score in tumor samples across pan-cancers', fig.align='center',fig.height=2, fig.width=12, cache=TRUE}
vis_gene_stemness_cor(Gene = "TP53", data_type = "mRNA")
```
#### [vis_gene_pw_cor()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_gene_pw_cor.html) {#vis-gene-pw-cor}
Calculate the correlation between one molecule and pathway score in tumor samples of one cancer. ([Custom module](#m-vis-gene-pw-cor))
- Basic use: `vis_gene_pw_cor(Gene= , data_type= )`
```{r vis-gene-pw-cor, message=FALSE, fig.cap='The correlation between mRNA TP53 and pathway score in tumor samples in ACC cancer', fig.align='center',fig.height=6, fig.width=6, cache=TRUE}
vis_gene_pw_cor(Gene = "TP53", data_type = "mRNA",
pw_name = "HALLMARK_ADIPOGENESIS",
cancer_choose = "ACC")
```
### Survival analysis
#### [tcga_surv_plot()](https://openbiox.github.io/UCSCXenaShiny/reference/tcga_surv_plot.html) {#tcga-surv-plot}
Perform the log-rank test of one molecule for one cancer. ([Custom module](#m-tcga-surv-plot))
- Basic use: `tcga_surv_plot(data=, time= , status= )`
```{r message=FALSE, cache=TRUE}
# Firstly, prepare the molecular value as well as survival data
data <- tcga_surv_get(item = "TP53",profile = "mRNA",
TCGA_cohort = "LUAD")
head(data)
```
```{r tcga-surv-plot, message=FALSE, fig.align='center', fig.cap='The log-rank test (DSS) of mRNA TP53 for LUAD cancer', fig.height=7, fig.width=6, message=FALSE, cache=TRUE}
tcga_surv_plot(data, time = "DSS.time", status = "DSS") # OS/DSS/DFI/PFI
```
> By default, the median data of molecular data is used to divided into two groups for log-rank test. It can be modified in corresponding paramters.
#### [vis_unicox_tree()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_unicox_tree.html) {#vis-unicox-tree}
Perform the Cox regression analysis of one molecule across pan-cancers. ([Custom module](#m-vis-unicox-tree))
- Basic use: `vis_unicox_tree(Gene= , data_type= , measure=)`
```{r vis-unicox-tree, message=FALSE, fig.cap='The Cox regression analysis (OS) of mRNA PTEN across pan-cancers', fig.align='center',fig.height=6, fig.width=6, cache=TRUE}
vis_unicox_tree(Gene = "PTEN", data_type = "mRNA", measure = "OS")
```
> By default, the median data of molecular data is used to divided into two groups for Cox regression analysis. It can be modified in corresponding paramters.
### Dimension reduction
#### [vis_dim_dist()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_dim_dist.html) {#vis-dim-dist}
Perform dimension reduction analysis of multiple molecules for samples in groups. ([Custom module](#m-vis-dim-dist))
- Basic use: `vis_dim_dist(ids=, data_type= ,group_info= )`
```{r}
# Firstly, prepare the grouping information of samples
group_info = tcga_clinical_fine %>%
dplyr::filter(Cancer=="BRCA") %>%
dplyr::select(Sample, Code) %>%
dplyr::rename(Group=Code)
head(group_info)
```
```{r vis-dim-dist, message=FALSE, fig.cap='The dimension reduction analysis (PCA) of 5 mRNA molcules in BRCA cancer samples grouped by tissue codes', fig.align='center',fig.height=6, fig.width=6, cache=TRUE}
ids = c("TP53", "KRAS", "PTEN", "MDM2", "CDKN1A")
vis_dim_dist(ids = ids, data_type = "mRNA",
group_info= group_info)
```
## PCAWG analysis
```{r analyze-pcawg-func, echo = FALSE}
data = readxl::read_excel("images/table_02.xlsx")
data = subset(data, Database == "PCAWG")
knitr::kable(
data, caption = 'Specilized functions to analyze PCAWG molecular data',
align = "l",
booktabs = TRUE
)
```
### Comparsion analysis
#### [vis_pcawg_dist()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_pcawg_dist.html) {#vis-pcawg-dist}
Compare molecular value between tumor and normal samples across pan-cancer. ([Custom module](#m-vis-pcawg-dist))
- Basic use: `vis_pcawg_dist(Gene= ,data_type= )`
```{r vis-pcawg-dist, message=FALSE, fig.capfig.cap='The difference of mRNA TP53 across pan-cancer', fig.align='center',fig.height=6, fig.width=12}
vis_pcawg_dist(Gene = "TP53", data_type = "mRNA")
```
### Correlation analysis
#### [vis_pcawg_gene_cor()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_pcawg_gene_cor.html) {#vis-pcawg-gene-cor}
Calculate the correlation between two molecules value in tumor samples of one cancer. ([Custom module](#m-vis-pcawg-gene-cor))
- Basic use: `vis_pcawg_gene_cor(Gene1= ,data_type1 = ,Gene2 = ,data_type2 = ,dcc_project_code_choose=)`
```{r vis-pcawg-gene_cor, message=FALSE, fig.capfig.cap='The correlation between mRNA CSF1R and mRNA JAK3 in tumor samples of BLCA-US cancer', fig.align='center',out.width='80%'}
vis_pcawg_gene_cor(Gene1 = "CSF1R", data_type1 = "mRNA",
Gene2 = "JAK3", data_type2 = "mRNA",
dcc_project_code_choose = "BLCA-US")
```
### Survival analysis
#### [vis_pcawg_unicox_tree()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_pcawg_unicox_tree.html) {#vis-pcawg-unicox-tree}
Perform the Cox regression analysis (OS) of one molecule across pan-cancers. ([Custom module](#m-vis-pcawg-unicox-tree))
- Basic use: `vis_pcawg_unicox_tree(Gene= , data_type= )`
```{r vis-pcawg-unicox-tree, warning=FALSE, message=FALSE, fig.cap='The Cox regression analysis (OS) of mRNA TP53 across pan-cancers', fig.align='center',fig.height=6, fig.width=6}
vis_pcawg_unicox_tree(Gene = "TP53", data_type = "mRNA")
```
> By default, the median data of molecular data is used to divided into two groups for Cox regression analysis. It can be modified in corresponding paramters.
## CCLE analysis
```{r analyze-ccle-func, echo = FALSE}
data = readxl::read_excel("images/table_02.xlsx")
data = subset(data, Database == "CCLE")
knitr::kable(
data, caption = 'Specilized functions to analyze CCLE molecular data',
align = "l",
booktabs = TRUE
)
```
### Comparsion analysis
#### [vis_ccle_tpm()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_ccle_tpm.html) {#vis-ccle-tpm}
Compare molecular value among different tissues of cancer cell lines. ([Custom module](#m-vis-ccle-tpm))
- Basic use: `vis_ccle_tpm(Gene= ,data_type= )`
```{r vis-ccle-tpm, message=FALSE, fig.capfig.cap='The difference of mRNA TP53 among different tissues of cancer cell lines', fig.align='center',fig.height=6, fig.width=12}
vis_ccle_tpm(Gene = "TP53", data_type = "mRNA")
```
### Correlation analysis
#### [vis_ccle_gene_cor()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_ccle_gene_cor.html) {#vis-ccle-gene-cor}
Calculate the correlation between two molecules value in one tissue type of cancer cell lines. ([Custom module](#m-vis-ccle-gene-cor))
- Basic use: `vis_ccle_gene_cor(Gene1= ,data_type1= ,Gene2= ,data_type2= ,SitePrimary= )`
```{r vis-ccle-gene_cor, message=FALSE, fig.capfig.cap='The correlation between mRNA CSF1R and mRNA JAK3 in prostate-related cancer cell lines', fig.align='center',fig.height=6, fig.width=6}
vis_ccle_gene_cor(Gene1 = "CSF1R", data_type1 = "mRNA",
Gene2 = "JAK3", data_type2 = "mRNA",
SitePrimary = "prostate")
```
> `vis_gene_drug_response_diff()` and `vis_gene_drug_response_asso()` are initially designed for drug pharmacogenomics analysis. In the updated shiny application, we have provided more comprehensive pharmacogenomics analysis.
## General analysis
```{r analyze-general-func, echo = FALSE}
data = readxl::read_excel("images/table_02.xlsx")
data = subset(data, Database == "General")
knitr::kable(
data, caption = 'Specilized functions to analyze General molecular data',
align = "l",
booktabs = TRUE
)
```
### Comparison analysis
#### [vis_identifier_grp_comparison()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_identifier_grp_comparison.html) {#vis-identifier-grp-comparison}
Compare molecular value between custom groups based on one genomics matrix UCSC Xena dataset. ([Custom module](#m-vis-identifier-grp-comparison))
- Basic use: `vis_identifier_grp_comparison(dataset= , id= ,grp_df= )`
```{r message=FALSE, cache=TRUE}
# Firstly, prepare custom groups of samples
library(UCSCXenaTools)
cli_df <- XenaGenerate(
subset = XenaDatasets == "TCGA.LUAD.sampleMap/LUAD_clinicalMatrix"
) %>%
XenaQuery() %>%
XenaDownload() %>%
XenaPrepare()
grp_df = cli_df[, c("sampleID", "pathologic_M")] %>%
dplyr::filter(pathologic_M %in% c("M0", "M1", "MX"))
head(grp_df) # col-1: sample; col-2: grouping info
```
```{r vis-identifier-grp-comparison, message=FALSE, fig.capfig.cap="The difference of mRNA TP53 among three pathologic_M groups for samples in TCGA.LUAD dataset", fig.align='center',fig.height=6, fig.width=8}
mol_dataset <- "TCGA.LUAD.sampleMap/HiSeqV2_percentile"
vis_identifier_grp_comparison(dataset = mol_dataset, id = "TP53",
grp_df = grp_df)
```
### Correlation analysis
#### [vis_identifier_cor()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_identifier_cor.html) {#vis-identifier-cor}
Calculate the correlation between two molecules value from genomics matrix UCSC Xena datasets. ([Custom module](#m-vis-identifier-cor))
- Basic use: `vis_identifier_cor(dataset= ,id1= ,dataset= ,id2= )`
```{r vis-identifier-cor, message=FALSE, fig.capfig.cap='The correlation between mRNA TP53 and mRNA KRAS in samples of one specific dataset', fig.align='center',fig.height=6, fig.width=6}
dataset <- "TcgaTargetGtex_rsem_isoform_tpm"
vis_identifier_cor(dataset1 = dataset, id1 = "TP53",
dataset2 = dataset, id2 = "KRAS")
```
#### [vis_identifier_multi_cor()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_identifier_multi_cor.html) {#vis-identifier-multi-cor}
Calculate the pairwise correlation among multiple molecules value from one genomics matrix UCSC Xena dataset. ([Custom module](#m-vis-identifier-multi-cor))
- Basic use: `vis_identifier_multi_cor(dataset= ,ids= )`
```{r vis-identifier-multi-cor, message=FALSE, fig.capfig.cap='The pairwise correlation among 3 mRNA molecules in samples of one specific dataset', fig.align='center',fig.height=6, fig.width=6}
dataset <- "TcgaTargetGtex_rsem_isoform_tpm"
vis_identifier_multi_cor(dataset = dataset,
ids = c("TP53", "KRAS", "PTEN"))
```
### Survival analysis
#### [vis_identifier_grp_surv()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_identifier_grp_surv.html) {#vis-identifier-grp-surv}
Perform the log-rank test of one molecule for one genomics matrix UCSC Xena dataset. ([Custom module](#m-vis-identifier-grp-surv))
- Basic use: `vis_identifier_grp_surv(dataset= , id= , surv_df= )`
```{r message=FALSE, cache=TRUE}
# Firstly, prepare survival data of samples
library(UCSCXenaTools)
cli_df <- XenaGenerate(
subset = XenaDatasets == "TCGA.LUAD.sampleMap/LUAD_clinicalMatrix"
) %>%
XenaQuery() %>%
XenaDownload() %>%
XenaPrepare()
surv_df <- cli_df[, c("sampleID", "days_to_death", "vital_status")]
surv_df$vital_status <- ifelse(surv_df$vital_status == "DECEASED", 1, 0)
surv_df = na.omit(surv_df)
head(surv_df) # col-1: sample; col-2: survival time; col-3: survival status
```
```{r vis-identifier-grp-surv, message=FALSE, fig.align='center', fig.cap='The log-rank test (DSS) of mRNA KRAS for ne specific dataset', fig.height=7, fig.width=6, message=FALSE}
mol_dataset <- "TCGA.LUAD.sampleMap/HiSeqV2_percentile"
vis_identifier_grp_surv(dataset = mol_dataset, id = "KRAS",
surv_df = surv_df)
```
> By default, the best cutoff is decided. User can change it through the `cutoff_mode` parameter.
### Dimension reduction
#### [vis_identifier_dim_dist()](https://openbiox.github.io/UCSCXenaShiny/reference/vis_identifier_dim_dist.html) {#vis-identifier-dim-dist}
Perform dimension reduction analysis of multiple molecules for samples in groups. ([Custom module](#m-vis-identifier-dim-dist))
- Basic use: `vis_identifier_dim_dist(dataset= ,ids= , grp_df= )`
```{r message=FALSE, cache=TRUE}
# Firstly, prepare the grouping information of samples
library(UCSCXenaTools)
cli_dataset <- "TCGA.LUAD.sampleMap/LUAD_clinicalMatrix"
cli_df <- XenaGenerate(
subset = XenaDatasets == cli_dataset
) %>%
XenaQuery() %>%
XenaDownload() %>%
XenaPrepare()
grp_df = cli_df[, c("sampleID", "gender")]
head(grp_df) # col-1: sample; col-2: grouping info
```
```{r vis-identifier-dim-dist, message=FALSE, fig.cap='The dimension reduction analysis (PCA) of 5 mRNA molcules in BRCA cancer samples grouped by tissue codes', fig.align='center',fig.height=6, fig.width=6, cache=TRUE}
mol_dataset <- "TCGA.LUAD.sampleMap/HiSeqV2_percentile"
ids = c("TP53", "KRAS", "PTEN", "MDM2", "CDKN1A")
vis_identifier_dim_dist(dataset = mol_dataset,
ids = ids,
grp_df = grp_df)
```