0

我需要绘制样本分类丰度的热图。我已经毫无问题地创建了我的 phyloseq 对象,但是在尝试生成热图时出现错误:

“phyloseqin.species”是我的phyloseq-class实验级对象

otu_table()   OTU Table:         [ 325 taxa and 101 samples ]
sample_data() Sample Data:       [ 101 samples by 5 sample variables ]
tax_table()   Taxonomy Table:    [ 325 taxa by 7 taxonomic ranks ]

我的 OTU 表中自然有一些 NA。

当我跑

plot_heatmap(phyloseqin.species,  sample.label="Sample", title = 'Relative abundance data - NMDS - Bray', 
+              taxa.label='Species', method = "NMDS", distance = "bray")

我收到此错误:

Error in cmdscale(dist, k = k) : NA values not allowed in 'd'
In addition: Warning messages:
1: In distfun(comm, method = distance, ...) :
  you have empty rows: their dissimilarities may be meaningless in method “bray”
2: In distfun(comm, method = distance, ...) : missing values in results

这个错误是因为我没有一棵树作为我的 phyloseq 对象的一部分吗?

预先感谢您的帮助!

4

1 回答 1

0

这不是因为您没有树 - 将 OTU 丰度表中的 NA 更改为 0。您可以将样本记录为 NA 的物种 - 但同样有效的是,您在该样本中记录了 OTU 0 次。

于 2021-09-06T14:37:25.297 回答