R语言 |展示差异基因,不一定非要用火山图

Paper: CD177 modulates the function and homeostasis of tumor-infiltrating regulatory T cells

2021 NC: https://pubmed.ncbi.nlm.nih.gov/34599187/

在这里插入图片描述
有以下呈现方式,

  • 横坐标使用cluster/celltype间的pct差值,
  • 纵坐标使用log2FC ,
  • P值可以使用颜色来表示。

文献阈值参数:

  • Genes labeled have logfold change > 1,
  • Δ Percentage Difference > 20% and adjusted P-value <0.05.

使用ggplot2 点图绘制方式

  • https://github.com/ncborcherding/
  • https://github.com/ncborcherding/scTregs
library(ggrepel)
cluster1.markers <- cluster1.markers %>%
  mutate(Difference = pct.1 - pct.2) %>% 
  rownames_to_column("gene")
  
ggplot(cluster1.markers, aes(x=Difference, y=avg_log2FC, color = threshold)) + 
  geom_point(size=0.5) + 
  scale_color_manual(values=c( "blue","grey","red") ) + 
  geom_label_repel(data=subset(cluster1.markers, avg_log2FC >= 1 & Difference >= 0.2 & p_val_adj <= 0.05), 
                   aes(label=gene),  #添加label
                   color="black", #设置label中标签的颜色
                   segment.colour = "black",#设置label框的颜色
                   label.padding = 0.1, 
                   #max.overlaps = 200,
                   segment.size = 0.3,  #框的大小
                   size=4)+
  geom_label_repel(data=subset(cluster1.markers, avg_log2FC <= -1 & Difference <= -0.2 & p_val_adj <= 0.05), 
                   aes(label=gene), label.padding = 0.1, 
                   color="black",
                   segment.colour = "black",
                   segment.size = 0.3, size=4)+
  geom_vline(xintercept = 0.0,linetype=2)+
  geom_hline(yintercept = 0,linetype=2)+
  theme_classic()
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值