-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathREADME.Rmd
91 lines (70 loc) · 3.21 KB
/
README.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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures",
out.width = "100%"
)
```
# TMEscore
### 1.Introduction
TME infiltration patterns were determined and systematically correlated with TME cell phenotypes, genomic traits, and patient clinicopathological features to establish the [TMEscore](https://cancerimmunolres.aacrjournals.org/content/7/5/737): *Tumor Microenvironment Characterization in Gastric Cancer Identifies Prognostic and Immunotherapeutically Relevant Gene Signatures*.
![TMEscore logo](./man/TMEscore-honors.png)
TMEscore is an R package to estimate tumor microenvironment score. Provides functionality to calculate Tumor microenvironment (TME) score using PCA or z-score.
### 2.Installation
The package is not yet on CRAN. You can install from Github:
```{r}
# install.packages("devtools")
if (!requireNamespace("TMEscore", quietly = TRUE))
devtools::install_github("DongqiangZeng0808/TMEscore")
```
### 3.Usage
Main documentation is on the `tmescore` function in the package:
```{r}
library('TMEscore')
library("ggplot2")
library("patchwork")
```
Example
```{r}
tmescore<-tmescore(eset = eset_stad, #expression data
pdata = pdata_stad, #phenotype data
method = "PCA", #default
classify = T) #if true, survival data must be provided in pdata
head(tmescore)
```
```{r,fig.height=5.5, fig.width= 10, dpi=300}
#remove observation with missing value
tmescore<-tmescore[!is.na(tmescore$subtype),]
p<-ggplot(tmescore,aes(x= subtype,y=TMEscore,fill=subtype))+
geom_boxplot(notch = F,outlier.shape = 1,outlier.size = 0.5)+
scale_fill_manual(values= c('#374E55FF', '#DF8F44FF', '#00A1D5FF', '#B24745FF'))
comparision<-combn(unique(as.character(tmescore$subtype)), 2, simplify=F)
p1<-p+theme_light()+
stat_compare_means(comparisons = comparision,size=2.5)+
stat_compare_means(size=2.5)
# survival analysis
colnames(tmescore)[which(colnames(tmescore)=="TMEscore_binary")]<-"score"
fit<- survfit(Surv(time, status) ~ score, data = tmescore)
p2<-ggsurvplot(fit,
conf.int = FALSE,
palette = c('#374E55FF', '#DF8F44FF'),
risk.table = TRUE,
pval = TRUE,
risk.table.col = "strata")
p2<-list(p2)
p2 <- arrange_ggsurvplots(p2, print = FALSE, ncol = 1, nrow = 1)
# print plots
(p1|p2)+plot_layout(ncol = 2, widths = c(1,2))
```
### Citation
If you use TMEscore in published research, please cite:
1. [Tumor microenvironment evaluation promotes precise checkpoint immunotherapy of advanced gastric cancer](https://jitc.bmj.com/content/9/8/e002467).
*Journal for ImmunoTherapy of Cancer*, 2021, 9(8), e002467. DOI: 10.1136/jitc-2021-002467, PMID: 34376552
2. [Tumor microenvironment characterization in gastric cancer identifies prognostic and imunotherapeutically relevant gene signatures](https://cancerimmunolres.aacrjournals.org/content/7/5/737). *Cancer Immunology Research*, 2019, 7(5), 737-750. DOI: 10.1158/2326-6066.CIR-18-0436, PMID: 30842092
### Contact
E-mail any questions to dongqiangzeng0808@gmail.com or interlaken0808@163.com