【R>>IMvigor210CoreBiologies】免疫反应

2018年的Nature 上公开了一份尿路上皮癌(BLCA)的免疫治疗队列数据,而这份数据就储存在IMvigor210CoreBiologies包中。下面就来学习下吧

1.IMvigor210CoreBiologies包安装

从(http://research-pub.gene.com/IMvigor210CoreBiologies/packageVersions/)下载后本地安装。注意:安装过程中需要很多依赖包,逐步安装即可。

rm(list = ls())
library(pacman)
# p_load(DESeq, lsmeans, spatstat)
# install.packages("D:/Database/IMvigor210/IMvigor210CoreBiologies_1.0.0.tar.gz",repos = NULL)
# install.packages("D:/Database/IMvigor210/DESeq_1.38.0.tar.gz",repos = NULL)
library(IMvigor210CoreBiologies)

2.数据预处理

2.1 表达矩阵

library(IMvigor210CoreBiologies)
data(cds)
expMatrix <- counts(cds)
eff_length2 <- fData(cds)[,c("entrez_id","length","symbol")]
rownames(eff_length2) <- eff_length2$entrez_id
head(eff_length2)
feature_ids <- rownames(expMatrix)
expMatrix <- expMatrix[feature_ids %in% rownames(eff_length2),]
mm <- match(rownames(expMatrix),rownames(eff_length2))
eff_length2 <- eff_length2[mm,]

x <- expMatrix/eff_length2$length
eset <- t(t(x)/colSums(x))*1e6
summary(duplicated(rownames(eset)))

eset <- IOBR::anno_eset(eset = eset,
                        annotation = eff_length2,
                        symbol = "symbol",
                        probe = "entrez_id",
                        method = "mean")
tumor_type <- "blca"
if(max(eset)>100) eset <- log2(eset+1)

2.2 表型文件

pdata <- pData(cds)
colnames(pdata) <- gsub(colnames(pdata),pattern = " ",replacement = "_")
pdata <- rownames_to_column(pdata[,c("binaryResponse",
                                     "FMOne_mutation_burden_per_MB",
                                     "Neoantigen_burden_per_MB",
                                     "censOS","os")],var = "ID")
colnames(pdata)<-c("ID","BOR_binary","TMB","TNB","status","time")
pdata<-pdata[!is.na(pdata$BOR_binary),]
pdata$BOR_binary<-ifelse(pdata$BOR_binary=="CR/PR","R","NR")
save(expMatrix,pdata,file = "expcli_IMvigor210.Rdata")

最后得到表达矩阵和表型文件:


3.文章实战

有了表达矩阵,预后数据,可以像下面这篇文章来展示分型、riskScore等结果对免疫反应的影响。


备注:IMvigor210CoreBiologies数据的处理过程参考自IOBR包的说明文档,大家使用时注意引用。
参考文献:
1.IOBR: Immuno-Oncology Biological Research
2.Characterization of the Immune Cell Infiltration Landscape in Head and Neck
Squamous Cell Carcinoma to Aid Immunotherapy

你可能感兴趣的:(【R>>IMvigor210CoreBiologies】免疫反应)