-
Notifications
You must be signed in to change notification settings - Fork 0
/
tme-modeling.Rmd
70 lines (50 loc) · 2.88 KB
/
tme-modeling.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
# **TME Modeling**
Previous studies have shown that the tumour microenvironment is a complex ecosystem. No single cell or gene is sufficient to influence the phenotype. Therefore, machine learning models of the tumour microenvironment or models of tumour microenvironment typing are used to predict tumour phenotypes and treatment response. In the last section, we present common considerations and scenarios for constructing tumour microenvironment models.
## Loading packages
```{r, eval=TRUE, warning=FALSE, message=FALSE}
library(IOBR)
```
## Data prepare
Using data from IMvigor210, we demonstrate two common scenarios for building models of the tumour microenvironment: predicting survival and predicting treatment response (BOR, RECIEST 1.1).
```{r,message=FALSE,warning=FALSE}
data("imvigor210_sig", package = "IOBR")
data("imvigor210_pdata", package = "IOBR")
```
## Input data (overall survival) prepare
```{r,message=FALSE,warning=FALSE}
pdata_prog <- imvigor210_pdata %>%
dplyr::select(ID, OS_days, OS_status) %>%
mutate(OS_days = as.numeric(.$OS_days)) %>%
mutate(OS_status = as.numeric(.$OS_status))
head(pdata_prog)
```
## Constructing survival prediction models
```{r, message=FALSE, warning=FALSE}
prognostic_result <- PrognosticModel(x = imvigor210_sig,
y = pdata_prog,
scale = T,
seed = 123456,
train_ratio = 0.7,
nfold = 8,
plot = TRUE)
```
## Input data (Response) prepare
```{r,message=FALSE,warning=FALSE}
pdata_group <- imvigor210_pdata[!imvigor210_pdata$BOR_binary=="NA",c("ID","BOR_binary")]
pdata_group$BOR_binary <- ifelse(pdata_group$BOR_binary == "R", 1, 0)
head(pdata_group)
```
## Constructing prediction models for response
```{r, message=FALSE, warning=FALSE}
binom_res <- BinomialModel(x = imvigor210_sig,
y = pdata_group,
seed = 123456,
scale = TRUE,
train_ratio = 0.7,
nfold = 8,
plot = T)
```
## References
Cristescu, R., Lee, J., Nebozhyn, M. et al. Molecular analysis of gastric cancer identifies subtypes associated with distinct clinical outcomes. Nat Med 21, 449–456 (2015). https://doi.org/10.1038/nm.3850
[CIBERSORT](https://cibersort.stanford.edu/); Newman, A. M., Liu, C. L., Green, M. R., Gentles, A. J., Feng, W., Xu, Y., … Alizadeh, A. A. (2015). Robust enumeration of cell subsets from tissue expression profiles. Nature Methods, 12(5), 453–457. https://doi.org/10.1038/nmeth.3337;
Seurat: Hao and Hao et al. Integrated analysis of multimodal single-cell data. Cell (2021)