当前位置: 首页 > news >正文

怎么做网站赚钱网站优化价格

怎么做网站赚钱,网站优化价格,wordpress yeti主题,国内做app软件开发最好的公司多组差异火山图复现 参考文章: A Spatiotemporal Organ-Wide Gene Expression and Cell Atlas of the Developing Human Heart Figure 2. H 图里主要是单细胞数据不同cluster之间的差异火山图, 所以说白了就是散点图和柱状图的结合, 散点图用差异基因绘制, 柱状图利用logFC最…

多组差异火山图复现

参考文章: A Spatiotemporal Organ-Wide Gene Expression and Cell Atlas of the Developing Human Heart Figure 2. H
Figure 2. H
图里主要是单细胞数据不同cluster之间的差异火山图, 所以说白了就是散点图和柱状图的结合, 散点图用差异基因绘制, 柱状图利用logFC最大最小值绘制就完了.

加载包

> library(tidyverse)
> library(ggplot2)
> library(ggpubr)
> library(RColorBrewer)
> library(openxlsx)
> library(ggsci)
> library(ggrepel)
> # Create color parameters
> qual_col_pals = brewer.pal.info[brewer.pal.info$category == 'qual',]
> col_vector = unlist(mapply(brewer.pal, qual_col_pals$maxcolors, rownames(qual_col_pals)))
> 

读取数据

> deg <- read.csv("./Differentially_Expressed_Markers_Each_Cluster.csv", header = T)
> deg$cluster <- as.factor(deg$cluster)
> head(deg)X p_val avg_log2FC pct.1 pct.2 p_val_adj cluster       gene
1 1     0   2.558924 0.982 0.289         0       0      DEFB1
2 2     0   2.365316 0.963 0.220         0       0     HMGCS2
3 3     0   2.317304 0.991 0.513         0       0     ATP1B1
4 4     0   2.207154 0.963 0.231         0       0 AC015522.1
5 5     0   2.153153 0.912 0.244         0       0    HSD11B2
6 6     0   2.125726 0.811 0.209         0       0     PAPPA2
> deg <- deg %>% dplyr::filter(p_val_adj < 0.05) %>% 
+   dplyr::filter(abs(avg_log2FC) > 0.75) %>% 
+   dplyr::select(avg_log2FC, p_val_adj, cluster, gene)  # filter and tidy the matrix
> 

添加一些注释信息, 例如legend, 上下调, 需要显示名称的基因等

> deg <- deg %>% 
+   mutate(label = ifelse(p_val_adj < 0.01, "adjusted P-val < 0.01", "adjusted P-val >= 0.01")) %>% 
+   mutate(Change = ifelse(avg_log2FC > 0.75, "UP", "DOWN"))
> 
> bardata <- deg %>% dplyr::select(cluster, avg_log2FC ) %>% 
+   group_by(cluster) %>% 
+   summarise_all(list(tail = min, top = max)) # 
> head(bardata)
# A tibble: 6 × 3cluster  tail   top<fct>   <dbl> <dbl>
1 0       -5.61  2.56
2 1       -5.13  4.32
3 2       -5.46  2.53
4 3       -4.84  4.81
5 4       -5.60  3.97
6 5       -4.59  2.96
>
> tagedgene <- deg %>% group_by(cluster) %>% 
+   slice_max(abs(avg_log2FC), n = 3)
> head(tagedgene)
# A tibble: 6 × 6
# Groups:   cluster [2]avg_log2FC p_val_adj cluster gene   label                 Change<dbl>     <dbl> <fct>   <chr>  <chr>                 <chr> 
1      -5.61  0        0       ALDOB  adjusted P-val < 0.01 DOWN  
2      -5.46  0        0       HSPA1A adjusted P-val < 0.01 DOWN  
3      -5.09  0        0       GPX3   adjusted P-val < 0.01 DOWN  
4      -5.13  0        1       DEFB1  adjusted P-val < 0.01 DOWN  
5      -4.61  0        1       CRYAB  adjusted P-val < 0.01 DOWN  
6      -4.36  1.07e-43 1       ALDOB  adjusted P-val < 0.01 DOWN  
> 

绘制图形

  • 利用bardata绘制背景柱状图
ggplot(deg, aes(x = cluster, y = avg_log2FC ))+geom_col(data = bardata, mapping = aes(x = cluster, y = tail),fill = "grey", width = 0.8) +geom_col(data = bardata, mapping = aes(x = cluster, y = top),fill = "grey", width = 0.8)

在这里插入图片描述

  • 添加上散点图, 黑色点有点少了, 不过无所谓能看到就行
ggplot(deg, aes(x = cluster, y = avg_log2FC ))+geom_col(data = bardata, mapping = aes(x = cluster, y = tail),fill = "grey", width = 0.8) +geom_col(data = bardata, mapping = aes(x = cluster, y = top),fill = "grey", width = 0.8) +geom_jitter(aes(color = label), size = 1,position = position_jitter(seed = 0328)) +scale_color_manual(values = c("#db5a6b", "black"))

在这里插入图片描述

  • 添加注释方块
ggplot(deg, aes(x = cluster, y = avg_log2FC ))+geom_col(data = bardata, mapping = aes(x = cluster, y = tail),fill = "grey", width = 0.8) +geom_col(data = bardata, mapping = aes(x = cluster, y = top),fill = "grey", width = 0.8) +geom_jitter(aes(color = label), size = 1,position = position_jitter(seed = 0328)) +scale_color_manual(values = c("#db5a6b", "black")) +geom_tile(aes(y = 0, fill = cluster), show.legend = F, color = "black", width = 1) +scale_fill_manual(values = col_vector)

在这里插入图片描述

  • 给想要展示的基因和注释方块添加文字
    • 看着有点挤, 点击zoom放大就好了
ggplot(deg, aes(x = cluster, y = avg_log2FC ))+geom_col(data = bardata, mapping = aes(x = cluster, y = tail),fill = "grey", width = 0.8) +geom_col(data = bardata, mapping = aes(x = cluster, y = top),fill = "grey", width = 0.8) +geom_jitter(aes(color = label), size = 1,position = position_jitter(seed = 0328)) +scale_color_manual(values = c("#db5a6b", "black")) +geom_tile(aes(y = 0, fill = cluster), show.legend = F, color = "black", width = 1) +scale_fill_manual(values = col_vector) +geom_text(aes(y = 0, label = cluster)) +geom_text_repel(data = deg %>% filter(gene %in% unique(tagedgene$gene)),aes(label = gene), position = position_jitter(seed = 0328),arrow = arrow(angle = 30, length = unit(0.05, "inches"),ends = "last", type = "open"))

在这里插入图片描述

  • 最后处理一下背景啥的
ggplot(deg, aes(x = cluster, y = avg_log2FC ))+geom_col(data = bardata, mapping = aes(x = cluster, y = tail),fill = "grey", width = 0.8) +geom_col(data = bardata, mapping = aes(x = cluster, y = top),fill = "grey", width = 0.8) +geom_jitter(aes(color = label), size = 1,position = position_jitter(seed = 0328)) +scale_color_manual(values = c("#db5a6b", "black")) +geom_tile(aes(y = 0, fill = cluster), show.legend = F, color = "black", width = 1) +scale_fill_manual(values = col_vector) +geom_text(aes(y = 0, label = cluster)) +geom_text_repel(data = deg %>% filter(gene %in% unique(tagedgene$gene)),aes(label = gene), position = position_jitter(seed = 0328),arrow = arrow(angle = 30, length = unit(0.05, "inches"),ends = "last", type = "open")) +theme_minimal() +theme(axis.line.y = element_line(color = "black", linewidth = 1),axis.line.x = element_blank(),axis.text.x = element_blank(),panel.grid = element_blank(),legend.title = element_blank())

在这里插入图片描述
是不是很简单啊 😃
其实不只是单细胞, RNAseq等技术的差异基因也可以组合成类似的矩阵之后绘制相同的多组差异火山图. 理解这个图是柱状图和散点图的结合就可以灵活的绘制类似的图啦 😃

http://www.hkea.cn/news/516090/

相关文章:

  • 瓮安建设局网站google play三件套
  • 大型门户网站模板营销神器
  • 学设计的网站都有哪些seo和sem
  • 如何做网站流量买卖营销型网站的特点
  • 装修设计网站哪个平台最好软文推广多少钱一篇
  • 怎么做微信里的网页网站链接网站设计平台
  • 长宁专业做网站网络营销案例分享
  • 哈尔滨专业建网站哪家好码迷seo
  • 涞水县住房和城乡建设局网站厦门seo专业培训学校
  • 网站建设销售招聘德阳seo
  • 平台网站建设的公司seozou是什么意思
  • wordpress 相册 主题seo整站优化技术培训
  • 做窗帘网站图片百度自动点击器下载
  • 飘雪影视大全免费观看视频快推达seo
  • 做网站的装饰标语seo宣传网站
  • 国外 平面设计 网站百度收录
  • 做网站话术简述搜索引擎的工作原理
  • 现在建设网站赚钱吗seo外链论坛
  • 青海网站建设企业海南百度竞价推广
  • 南京做网站yuanmus电脑突然多了windows优化大师
  • 美国做deals的网站软文营销经典案例优秀软文
  • 招标网站怎么做吴江seo网站优化软件
  • 苏州建设工程协会网站seo去哪里学
  • 上海正规网站制作价格可口可乐软文营销案例
  • 番禺网站 建设信科网络站长之家ping
  • 建筑工程施工承包合同关键词优化报价推荐
  • 网站可以免费看企业网站系统
  • 中华人民共和国建设部网站seo怎么快速提高排名
  • 南宁做网站的有几家东莞网络营销网站建设
  • 苏州知名网站建设开发新区seo整站优化公司