泛癌—CCLE数据库

叉叉滴同学 叉叉滴同学的生信笔记 2024-05-06 09:00

👇点关注不迷路👇

👆点关注不迷路👆

图片

Cancer Cell Line Encyclopedia即癌症细胞系百科全书,其数据库内包含对上千种癌细胞系的多组学图谱深度解析。在泛癌分析中,我们也经常会使用该数据库分析目标基因在不同组织肿瘤中及其对应的肿瘤细胞系中的表达。以丰满泛癌分析中基因表达这一块内容。

接下来就跟着我一步一步地将目标基因在各组织中的表达量目标基因在目标组织肿瘤细胞中的表达量进行可视化


1.访问官网
https://sites.broadinstitute.org/ccle/

图片




2.数据准备
这里我们需要准备两个数据
①基因表达矩阵
②细胞注释信息

图片1)官网首页点击DATASETS进入数据界面

图片


图片2)再点击CCLE data

图片


图片3)随后找到文件下载入口File Downloads

图片

图片4)下载必须的两个文件

图片

图片


3.利用R进行可视化
图片1)R包加载
library(xml2)library(rvest)library(ggplot2)library(Hmisc)library(ggplot2)library(RColorBrewer)
图片2)读取表达矩阵并处理
dat = data.table::fread("OmicsExpressionProteinCodingGenesTPMLogp1.csv",data.table = F)rownames(dat) <- dat[,1]dat <- dat[,-1]exp <- t(dat)

图片

图片3)读取细胞注释文件
clinical = fread("Model.csv",data.table = F)ModelID = intersect(colnames(exp),clinical$ModelID)exp = exp[,ModelID]clinical = clinical[match(ModelID,clinical$ModelID),]

图片


图片4)提取目标基因表达信息
gene="TP53"pdat <- data.frame(Expression = as.numeric(exp[grep(gene,rownames(exp)),]),clinical)

图片

图片5)记录原发组织信息并剔除无肿瘤数据
pdat$SampleCollectionSite <- gsub("_"," ",pdat$SampleCollectionSite)pdat$SampleCollectionSite <- capitalize(pdat$SampleCollectionSite) pdat$OncotreePrimaryDisease = factor(pdat$OncotreePrimaryDisease,levels = sort(unique(pdat$OncotreePrimaryDisease)))pdat$SampleCollectionSite = factor(pdat$SampleCollectionSite,levels = sort(unique(pdat$SampleCollectionSite)))pdat=pdat[!pdat$OncotreePrimaryDisease=="Non-Cancerous",]
图片6)可视化——目标基因在各组织中的表达情况
pdf("All_tissue_CCLE.pdf",width = 15,height = 10)ggplot(pdat,aes(x = SampleCollectionSite,y = Expression,fill = SampleCollectionSite))+  geom_boxplot()+  labs(title="Sample Collection Site", y = paste0(gene," Expression (Log TPM)"),hjust = 0.5,size=16)+  theme_bw()+   theme(axis.text.x = element_text(vjust = 1,hjust = 1,angle = 45,size = 14),        axis.text.y = element_text(size = 14),         axis.title.x = element_blank(),         axis.title.y = element_text(size = 16),         axis.line = element_line(size = 1),        plot.title = element_text(hjust = 0.5,size =  18),        legend.position="none")dev.off()

图片

图片7)可视化——目标基因在目标肿瘤细胞系中的表达情况
这里以乳腺癌为例
tissue="Breast"#以乳腺为例pdat2 <- pdat[pdat$SampleCollectionSite ==tissue,]pdf(paste0(tissue,"CCLE.pdf"),width = 15,height = 10)ggplot(pdat2,aes(x = CellLineName,y = Expression,fill = CellLineName))+  geom_bar(stat = "identity", position = "dodge") +   labs(title=paste0(tissue," Cell"), y = paste0(gene," Expression (Log TPM)"),hjust = 0.5,size=16) +  scale_y_continuous(expand = c(0,0),limits = c(0,6))+  scale_fill_manual(values = randomColors[1:50])+theme_bw()+   theme(axis.text.x = element_text(vjust = 1,hjust = 1,angle = 45,size = 14),        axis.text.y = element_text(size = 14),         axis.title.x = element_blank(),         axis.title.y = element_text(size = 16),         axis.line = element_line(size = 1),        plot.title = element_text(hjust = 0.5,size =  18),        legend.position="none")dev.off()

图片


OK,最后得到的就是这两张图
快去给你的泛癌文章添砖加瓦吧
————文末获取代码
👇👇点关注不迷路👇👇

👆👆点关注不迷路👆👆

#
👇代码及示例文件👇
代码获取须知:

不是通用代码

②需要一定的R语言基础

不推荐R语言零基础者单独获取运行

不提供答疑及报错修改

⑤获取代码后请认真按照推文流程操作

图片

微信扫一扫
关注该公众号