首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >相对丰富图的Phyloseq代码修改

相对丰富图的Phyloseq代码修改
EN

Stack Overflow用户
提问于 2020-11-12 16:10:10
回答 1查看 104关注 0票数 0

我正在沿着这个管道(https://www.nicholas-ollberding.com/post/introduction-to-the-statistical-analysis-of-microbiome-data-in-r/)在盒子图图像中寻找相对丰富的内容(https://www.nicholas-ollberding.com/post/2019-07-28-introduction-to-the-statistical-analysis-of-microbiome-data-in-r_files/figure-html/box%20plot-1.png)。

我已经尝试过以下代码

代码语言:javascript
复制
ps_phylum <- phyloseq::tax_glom(ps, "Phylum")
phyloseq::taxa_names(ps_phylum) <- phyloseq::tax_table(ps_phylum)[, "Phylum"]

phyloseq::psmelt(ps_phylum) %>%
ggplot(data = ., aes(x = Status, y = Abundance)) +
  geom_boxplot(outlier.shape  = NA) +
  geom_jitter(aes(color = OTU), height = 0, width = .2) +
  labs(x = "", y = "Abundance\n") +
  facet_wrap(~ OTU, scales = "free")

但我想修改一下图,就像门级别图一样,但在这里,点将指示属/科/种。

EN

回答 1

Stack Overflow用户

发布于 2020-11-12 19:42:06

我很幸运地解决了这个问题,

代码语言:javascript
复制
ps_phylum <- phyloseq::tax_glom(ps, "class/order/family/genus")
phyloseq::taxa_names(ps_phylum) <- phyloseq::tax_table(ps_phylum)[, "class/order/family/genus"]

phyloseq::psmelt(ps_phylum) %>%
ggplot(data = ., aes(x = Status, y = Abundance)) +
  geom_boxplot(outlier.shape  = NA) +
  geom_jitter(aes(color = OTU), height = 0, width = .2) +
  labs(x = "", y = "Abundance\n") +
  facet_wrap(~ Phylum, scales = "free")
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64800077

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档