joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
569 stars 187 forks source link

Trying to merge_phyloseq but problem with trees #1647

Open xaalii opened 1 year ago

xaalii commented 1 year ago

Hi,

I am trying to merge two phyloseq objects containing samples from different environments. I have used QIIME2 and Deblur to clean the data and obtain the phylogenetic tree, etc.

I can successfully make two phyloseq objects. However, when I try to merge the phyloseq objects, I can the following error: "Error in FUN(X[[i]], ...) : one tree has a different number of tips"

Please can somebody clarify why this might be and how I get around it?

I know I can make the objects without trees, but I need them to be able to calculate UniFrac distances later on.

Thanks!

AngelicaMiraples commented 6 months ago

Hi @joey711 and @xaalii

I have a similar issue as described above.

I have a phyloseq object that I subsetted into two, pse and psl, for separate analyses. Now I would like to merge them back together but am running into errors regarding the tree, as you mentioned in the above thread:

pse phyloseq-class experiment-level object otu_table() OTU Table: [ 156 taxa and 40 samples ] sample_data() Sample Data: [ 40 samples by 7 sample variables ] tax_table() Taxonomy Table: [ 156 taxa by 7 taxonomic ranks ] phy_tree() Phylogenetic Tree: [ 156 tips and 155 internal nodes ] refseq() DNAStringSet: [ 156 reference sequences ]

psl phyloseq-class experiment-level object otu_table() OTU Table: [ 306 taxa and 40 samples ] sample_data() Sample Data: [ 40 samples by 7 sample variables ] tax_table() Taxonomy Table: [ 306 taxa by 7 taxonomic ranks ] phy_tree() Phylogenetic Tree: [ 306 tips and 305 internal nodes ] refseq() DNAStringSet: [ 306 reference sequences ]

mps <- merge_phyloseq(pse, psl) Error in FUN(X[[i]], ...) : one tree has a different number of tips

Any support to get around this?

Thanks!

Angelica