ixxmu / mp_duty

抓取网络文章到github issues保存
https://archives.duty-machine.now.sh/
108 stars 30 forks source link

为什么要拼图 #3216

Closed ixxmu closed 1 year ago

ixxmu commented 1 year ago

https://mp.weixin.qq.com/s/4cQIzoBCbQRn5v14B8mpEQ

ixxmu commented 1 year ago

为什么要拼图 by 生信技能树

常见期刊其实都有图表数量的限制,比如:

JournalImpact FactorNumber of Figures
Nature Cancer60.725-8
Science47.736
Cancer Cell31.748
Journal of Clinical Oncology44.546
JAMA Oncology31.785
Cell Host and Microbe21.027

虽然说一图胜千言,但是成百上千张图就是另外一种啰嗦了,尤其是单细胞时代,很容易跑出来成百上千个图,这个时候首先需要继续汇总信息,其次需要把关键图表拼接起来,这样的话虽然期刊只允许我们给七八张图,但是每个图里面还是可以有十几个小图。

比如2022的一个卵巢癌单细胞文章就是如此:

2022的一个卵巢癌单细胞文章

同样的,我们做常规的表达量差异分析,比如芯片或者转录组数据,都是会有起码三张图, 我在生信技能树的教程:《你确定你的差异基因找对了吗?》提到过,必须要对你的转录水平的全局表达矩阵做好质量控制,最好是看到标准3张图

  • 左边的热图,说明我们实验的两个分组,normal和npc的很多基因表达量是有明显差异的
  • 中间的PCA图,说明我们的normal和npc两个分组非常明显的差异
  • 右边的层次聚类也是如此,说明我们的normal和npc两个分组非常明显的差异

如果分组在3张图里面体现不出来,实际上后续差异分析是有风险的。这个时候需要根据你自己不合格的3张图,仔细探索哪些样本是离群点,自行查询中间过程可能的问题所在,或者检查是否有其它混杂因素,都是会影响我们的差异分析结果的生物学解释。比如发表于2021年9月27日,美国康奈尔医学院周乔课题组在Cell Stem Cell 期刊,文章标题是:《SATB2 preserves colon stem cell identity and mediates ileum-colon conversion via enhancer remodeling》,在线阅读链接 是:https://doi.org/10.1016/j.stem.2021.09.004 在附件就提到了这样的三张图:

表达量矩阵分析一定要三张图

每个子图都是独立的绘图代码,然后就可以拼接

Using cowplot to arrange figures

The main function to combine figures using cowplot is plot_grid(). Let's check out the help documentation using ?plot_grid(). The first and most important parameter is the list of plots we want to combine, plotlist.

Let's check out the basic use of this function by calling the plots we want to combine and by providing labels using the labels argument.

plot_grid(pca,volcano,hmap,sc, labels="AUTO")

或者复杂一点的 In general, there seem to be more options for plot customization (without adding ggplot2 layers) with cowplot.

plot_grid(pca,volcano,hmap,sc, labels="AUTO",
           label_size = 14, 
          label_fontface  = "bold.italic", label_colour  ="blue",
          label_fontfamily ="Times New Roman",
                   label_y=0.25)

拼图效果如下所示:

 

强烈推荐 patchwork

The goal of patchwork is to make it ridiculously simple to combine separate ggplots into the same graphic. As such it tries to solve the same problem as gridExtra::grid.arrange() and cowplot::plot_grid but using an API that incites exploration and iteration, and scales to arbitrily complex layouts. ---Thomas Lin Pederson, Patchwork documentation.

Patchwork allows users to combine plots using simple mathematic operations such as + and /.

所以,上面的4个图拼接起来,也是超级简单的语法:pca + volcano + hmap + sc

文末友情宣传

强烈建议你推荐给身边的博士后以及年轻生物学PI,多一点数据认知,让他们的科研上一个台阶: