单基因作图学习软件

单基因的肿瘤细胞系表达怎么看?CCLE告诉你

2021-08-03  本文已影响0人  欧阳松

泛癌的基因表达量一般可以用TCGA和GTEx实现,但是肿瘤细胞系一般用CCLE
临床生信之家是一个很好的在线工具,目前上架了CCLE的功能,出的图见下,可以实现单基因在泛癌和单病种的可视化,但是这个网址什么都好,就是有次数限制,后面使用要加钱,而且价钱不菲,学生党望而却步。。。

泛癌 膀胱癌
会R语言,当然可以省掉这笔巨款,而且可以DIY,乐趣无穷

首先去CCLE官网下载数据,目前网页更新了,功能也多了
比如TP53,访问这个网址TP53 DepMap Gene Summary就行,在CharacterizationExpression 21Q2 Public右边有个下载标志,基因单位是Log2(TPM+1),很科学
下载后的数据是: TP53 Expression 21Q2 Public.csv

image.png
把数据读进R里面
TP53_Expression_21Q2_Public <- read.csv("~/Desktop/TP53 Expression 21Q2 Public.csv")
image.png

可以看到很多有用信息,包括基因表达量、细胞系名、原发病、器官和亚型,这样我们就可以跑代码了

library(ggplot2)
library(ggpubr)
ggplot(TP53_Expression_21Q2_Public, 
       aes(x = reorder(`Primary Disease`,`Expression 21Q2 Public`, FUN = median),  #按中位数自动排序
           y =`Expression 21Q2 Public`,color=`Primary Disease`)) + #y也可以是Lineage
    geom_boxplot()+ #添加boxplot
    geom_point() + #添加点
    theme_classic(base_size = 12)+ #主题和字体大小
    rotate_x_text(45)+ #X轴45度倾斜一下
    theme(legend.position="none")+ #不需要显示标签
    xlab(NULL)+ylab("TP53 expression \nLog2(TPM+1)")+ #改下坐标名称
    stat_summary(fun.data = 'mean_sd', geom = "errorbar", width = 0.5,position = position_dodge(0.9))+ #自动计算均数标准差,加个误差棒
    geom_hline(yintercept = mean(TP53_Expression_21Q2_Public$`Expression 21Q2 Public`), lty = 2)
#自动计算均值,标个虚线
pancancer

当然也可以统计一下差异,再加一句+stat_compare_means(method = "anova")就行。

data<-TP53_Expression_21Q2_Public[TP53_Expression_21Q2_Public$`Primary Disease` == 'Kidney Cancer',]

我是这样设计图片的,以点的大小代表基因表达量,按颜色表达程度,颜色从蓝到红,可以从大到小排序,也可以从小到大排列,然后用均数隔开

ggplot(data, aes(x=reorder(`Cell Line Name`,`Expression 21Q2 Public`), y=`Expression 21Q2 Public`)) + 
    geom_point(aes(size=`Expression 21Q2 Public`,color=`Expression 21Q2 Public`),stat='identity') +scale_color_continuous(low='blue' ,high='red') +
    geom_segment(aes(y = mean(data$`Expression 21Q2 Public`), 
                     x = `Cell Line Name`, 
                     yend = `Expression 21Q2 Public`, 
                     xend = `Cell Line Name`), 
                 color = "black") +
    theme_classic(base_size = 12) + 
    coord_flip() + 
    xlab(NULL)+ylab("TP53 expression")+
    geom_hline(yintercept = mean(data$`Expression 21Q2 Public`), lty = 2)
image.png

从小到大再来一次,reorder里加个-就行

ggplot(data, aes(x=reorder(`Cell Line Name`,-`Expression 21Q2 Public`), y=`Expression 21Q2 Public`)) + 
    geom_point(aes(size=`Expression 21Q2 Public`,color=`Expression 21Q2 Public`),stat='identity') +scale_color_continuous(low='blue' ,high='red') +
    geom_segment(aes(y = mean(data$`Expression 21Q2 Public`), 
                     x = `Cell Line Name`, 
                     yend = `Expression 21Q2 Public`, 
                     xend = `Cell Line Name`), 
                 color = "black") +
    theme_classic(base_size = 12) + 
    coord_flip() + 
    xlab(NULL)+ylab("TP53 expression")+
    geom_hline(yintercept = mean(data$`Expression 21Q2 Public`), lty = 2)
image.png

不要钱的,不香吗?

上一篇下一篇

猜你喜欢

热点阅读