0
votes

I'm trying to create a phyloseq class object with an OTU table, taxa names, sample data and a phylogenetic tree using the following commands

ps <- phyloseq(otu_table(seqtab.nochim, taxa_are_rows=F),
           tax_table(taxa),
           sample_data(Metadata))

physeq = merge_phyloseq(ps, treefile)

I can create the ps object just find, but I cannot add the phylogenetic tree to this object. This appears to fail because the names on my OTU table and my tree (downloaded from the SILVA database) do not match. Using taxa_names, I can see that the tree has taxa names assigned to it as is expected, but my OTU table has the names as each sequence read instead.

The OTU table (seqtab.nochim), the taxonomy assignments and the sample data are all made exactly following the dada2 pipeline tutorial, and everything that I've read so far indicates that it's normal for the OTU table to have the sequences as the column names.

I'm confused because my taxa object already has taxonomy from Kingdom to Genus assigned to each sequence read, but I don't see a way to use these assignments to match with the phylogenetic tree instead of the sequence reads from the OTU table.

I'm sure it's probably something simple and glaringly obvious that I'm missing, but any help is greatly appreciated!

1

1 Answers

0
votes

You are right that the tree and the OTU table and the tax table need to have the same names. Usually though, one does not download the tree directly from SILVA, but rather makes a local tree from one's dada2 sequences. In this paper by Callihan et al., the authors discuss using PHANGORN to make such a tree. This should result in a tree file with sequences as the names of the branches that is compatible with the rest of your data. If you have other problems, try posting a reproducible subset of your data, eg the ps object subsampled down to just a few samples and the five most abundant taxa and maybe us internet people can identify the problem.