0

我在使用 ggplot2 绘制 phyloseq 对象的 beta 多样性时遇到错误,您能否建议我如何解决这个问题?

R code
 phyloseq_prop = transform_sample_counts(physeq, function(x) 1E6 * x/sum(x))
 expt1.ord <- ordinate(phyloseq_prop, "PCoA", "bray")


# melt the phyloseq object

p1 <- psmelt(expt1.ord)
pdf("PcoASampleType.pdf", width = 10, height = 8)
p2 <- p1 + geom_point(aes(colour = Season), size = 3,alpha=0.8) +
   scale_color_manual(values = c("#E78AC3", "#A6D854")) +
  geom_vline(xintercept = 0, linetype = 2) +
  geom_hline(yintercept = 0, linetype = 2) +
  theme_bw() +
  theme(text = element_text(size = 18),
        legend.position = "bottom") +
  guides(colour = guide_legend(title.position = "top", title.hjust = 0.5)) 

print(p2)
dev.off()

Error
   
Error in access(object, "otu_table", errorIfNULL) :
  otu_table slot is empty.
Calls: psmelt -> otu_table -> otu_table -> .local -> access
Execution halted

非常感谢

4

0 回答 0