Thank you. This is amazing for getting my qiime2 output into phyloseq.
After a lot of struggles with other suggestions this worked perfectly. I have gotten my data imported before but I never got the taxonomy and the tree to both work at the same time!!
Just a note to others, I could not use the first suggested method for creating a phyloseq object, "
phy<-qza_to_phyloseq(“table.qza”, “rooted-tree.qza”, “taxonomy.qza”,“sample-metadata.tsv”)
phy"
However, I had no trouble using the second suggested commands for “if you want to have more control” after the data import steps.
physeq<-phyloseq(
otu_table(SVs$data, taxa_are_rows = T),
phy_tree(tree$data),
tax_table(as.data.frame(taxtable) %>% select(-Confidence) %>% column_to_rownames("Feature.ID") %>% as.matrix()), #moving the taxonomy to the way phyloseq wants it
sample_data(metadata %>% as.data.frame() %>% column_to_rownames("#SampleID"))
)
physeq