Error when creating a phyloseq object

Hello,

this might be a question not directly towards qiime2 but related to creating a phyloseq object in R with the output created by qiime2.
I am importing the output with qime2R:

otu <- read_qza("otutable.qza")$data
metadata <- read_q2metadata("samplemetadata_master.tsv")
tree <- read_qza("rooted_tree.qza")$data
taxonomy <- read_qza("taxonomy-silva-primer.qza")$data %>%
separate(Taxon, into = c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species"), sep = ";") %>%
column_to_rownames("Feature.ID") %>% as.matrix() %>% tax_table()

This all works fine until I want to call the phyloseq command:

ps <- phyloseq(otu_table(otu_transformed, taxa_are_rows = TRUE), taxonomy, metadata, phy_tree(tree))

which returns the following error:

Error: unable to find an inherited method for function ‘prune_samples’ for signature ‘samples = "array", x = "phyloseq"’

I am really clueless and couldn't really find a solution/ explanation online. I am using R 4.5.1

Thank you!

2 Likes

I'm not a regular phyloseq user, but I've seen this error mentioned in their GitHub: unable to find an inherited method for function ‘prune_samples’ for signature ‘"array", "phyloseq"’ · Issue #1356 · joey711/phyloseq · GitHub

I hope this helps!

Best,

Sergio

1 Like

Thank you - funny - thats also the solution I used. I tried to be as verbose as possible. And it worked.

Thanks!

2 Likes