0

我正在努力将元数据附加到 phylo4d 树。首先我会说我可以将我的对象作为 Dropbox 文件附加,但如果我只是误解了逻辑,我会节省自己和每个人的时间

我从 phyloseq 对象开始,然后提取 phylo 树。我删除了节点标签,因为一些与提示标签重叠。

library(phylobase)
library(phylosignal)

#get the tree out of the phyloseq object 'physeq'
tree <- phy_tree(physeq)

#remove the node labels to correct non-unique tip label error
tree$node.label <- NULL

#remove appropriate metadata from the phyloseq object 'physeq'
otu_table <- otu_table(physeq) #sample ID x ASV ID
tax_table <- tax_table(physeq) #taxonomy x ASV ID
sample_data <- as.list(sample_data(physeq)) #list of relevant metadata (chemistry, location, etc)

#merge the tree and metadata and create a phylo4d object
tree_4d <- phylo4d(tree,metadata = list(sample_data))

#create a phylo correlogram of the phylo4d object
pc <- phyloCorrelogram(tree_4d, ci.bs = 1000, ci.conf = 0.95)

我发生的错误如下,我收到了我之前的回答。我知道我必须附上上面的元数据(即sample_data),但我很挣扎。

任何帮助是极大的赞赏!

4

0 回答 0