CIBERSORT包:洞悉細(xì)胞免疫浸潤(rùn)的神奇工具!
免疫細(xì)胞是我們身體的護(hù)衛(wèi)軍,它們?cè)隗w內(nèi)巡游,尋找并清除病原體,保護(hù)我們免受感染。當(dāng)我們感染或出現(xiàn)其他異常情況時(shí),免疫細(xì)胞會(huì)被引導(dǎo)到相應(yīng)的組織中,形成免疫浸潤(rùn)。免疫浸潤(rùn)是免疫系統(tǒng)響應(yīng)的重要表現(xiàn),對(duì)于疾病的發(fā)展和治療具有重要影響。在腫瘤中,免疫細(xì)胞的浸潤(rùn)情況尤其重要。一方面,免疫細(xì)胞的浸潤(rùn)可以幫助清除腫瘤細(xì)胞,起到抗腫瘤作用。另一方面,某些腫瘤可能通過(guò)操縱免疫系統(tǒng),逃避免疫細(xì)胞的攻擊,從而促進(jìn)腫瘤的生長(zhǎng)和轉(zhuǎn)移。因此,準(zhǔn)確了解免疫細(xì)胞在腫瘤組織中的分布和作用,對(duì)于腫瘤治療和預(yù)后評(píng)估非常重要。 CIBERSORT是一個(gè)強(qiáng)大的生物信息學(xué)工具,由斯坦福大學(xué)的研究團(tuán)隊(duì)開發(fā)。它利用RNA測(cè)序數(shù)據(jù),通過(guò)解析免疫基因表達(dá)譜,估算不同免疫細(xì)胞在樣本中的比例。使用CIBERSORT,我們可以精準(zhǔn)地了解組織中不同類型免疫細(xì)胞的分布情況,洞悉免疫浸潤(rùn)的奧秘。CIBERSORTx來(lái)自官網(wǎng)(https://cibersortx.stanford.edu/)的分析流程如圖所示:
CIBERSORTx分析流程
如何使用CIBERSORT?使用CIBERSORT非常簡(jiǎn)單!讓我為大家展示一下: 代碼具體包括: Step1 分析患者和對(duì)照樣本的浸潤(rùn)程度
這里的LM22.txt??是CIBERSORT官方下載的文件,CIBERSORT_exp.txt是本地準(zhǔn)備的基因表達(dá)文件,sampleName.csv是本地準(zhǔn)備的樣本信息文件,小果給大家附在最后。 ########分析患者和對(duì)照樣本的浸潤(rùn)程度 #加載包 library(dplyr) library(tibble) library(tidyr) library(ggplot2) library(ggpubr) library(ggsci) library(reshape2) setwd("D:/wanglab/life/ziyuan/20230718/") # devtools::install_github("Moonerss/CIBERSORT") library(CIBERSORT) ? # 設(shè)置分析依賴的基礎(chǔ)表達(dá)文件 # 每類免疫細(xì)胞的標(biāo)志性基因及其表達(dá) # 基因名字為Gene symbol LM22.file <- read.delim2("./LM22.txt",header = T) LM22.file[,-1] = lapply(LM22.file[,-1], FUN = function(y){as.numeric(y)}) row.names(LM22.file) <- LM22.file$Gene.symbol LM22.file <- LM22.file[,-1] LM22.file <- as.matrix(LM22.file) #加載自己的數(shù)據(jù)用于分析計(jì)算免疫細(xì)胞 load("GSE105450_raw.Rdata") #加載自己的數(shù)據(jù)用于分析計(jì)算免疫細(xì)胞 # df <- express[,-c(1,2,4)] # #colnames(df)[1] <- "Gene symbol" # rownames(df) <- df$ORF # df <- df[,-1] df <- as.data.frame(express) write.table(df,"CIBERSORT_exp.txt",sep = "\t",col.names = T,quote = F) df <- df[row.names(LM22.file),] TCGA_TME.results <- CIBERSORT::cibersort(LM22.file ,df, perm = 1000, QN = F) #perm置換次數(shù)=1000,QN分位數(shù)歸一化=TRUE # perm置換次數(shù)=1000 #輸出結(jié)果 write.csv(TCGA_TME.results, "./CIBERSORT_Results_fromRcode.csv") results <- TCGA_TME.results ? Step2 箱線圖展示
#########箱線圖展示 library(stringr) group <- sampleName$group[match(str_sub(colnames(df),1,10),sampleName$geo_accession)] group <- na.omit(group) res <- data.frame(results[,1:22])%>% ??dplyr::mutate(group = group)%>% ??tibble::rownames_to_column("sample")%>% ??tidyr::pivot_longer(cols = colnames(.)[2:23], ???????????????names_to = "cell.type", ???????????????values_to = 'value') head(res,n=6)
pdf(file = "CIBERSORT_psignif.pdf") ggplot(res,aes(cell.type,value,fill = group)) + ??geom_boxplot(outlier.shape = 21,color = "black",outlier.color = "black") + ??#theme_bw() + ???scale_fill_manual(values = c("#00BFC4","#F8766D"))+#設(shè)置顏色 ??labs(x = "Cell Type", y = "Estimated Proportion") + ??theme(legend.position = "top") + ??theme(axis.text.x = element_text(angle=90,vjust = 0.5,size = 14,face = "italic",colour = 'black'), ????????axis.text.y = element_text(face = "italic",size = 14,colour = 'black'))+ ??#scale_fill_nejm()+ ??stat_compare_means(aes(group = group),label = "p.signif",size=3,method = "kruskal.test")# p.format;p.signif dev.off()
免疫浸潤(rùn)結(jié)果箱線圖比較
Step3 熱圖展示
library(pheatmap) #選擇具有差異性的免疫細(xì)胞 deCell <- c("B.cells.naive","Dendritic.cells.activated","Macrophages.M0","Macrophages.M2", "Mast.cells.activated","Monocytes","Neutrophils","NK.cells.activated","NK.cells.resting", ????????????"T.cells.CD4.memory.resting","T.cells.CD4.naive","T.cells.CD8","T.cells.regulatory..Tregs.") TME.results <- TCGA_TME.results re <- TME.results[,-(23:25)] #展示差異的免疫細(xì)胞類型 re2 <- as.data.frame(t(re[,deCell])) Group = group table(Group) an = data.frame(group = group,row.names = colnames(re2)) groupcolor=c("#00BFC4","#F8766D") names(groupcolor)<- c("Healthy person","RSV") pdf(file="差異免疫細(xì)胞豐度熱圖.pdf") pheatmap::pheatmap(re2,scale = "row", ???????????????????show_colnames = F, ???????????????????cluster_rows = F,cluster_cols = F, ???????????????????annotation_col = an, ???????????????????annotation_colors = list(group=groupcolor), ???????????????????color = colorRampPalette(c("navy", "white", "firebrick3"))(50)) dev.off()
差異免疫細(xì)胞豐度熱圖
希望通過(guò)這篇文章,你能對(duì)CIBERSORT有更深入的了解,并在生物信息學(xué)的世界里探索更多新奇的可能性。如果你對(duì)細(xì)胞組成的研究充滿熱情,那就趕快動(dòng)手嘗試一下CIBERSORT吧!