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/
584 stars 187 forks source link

Generate taxa-wise unifrac Matrix #1364

Open MonicaSteffi opened 4 years ago

MonicaSteffi commented 4 years ago

Dear All, I am trying to create a unifrac distance matrix for taxonomy wise instead of sample wise.

unifrac_distance<-distance(ps, method="unifrac", type = "taxa")

I tried with the above command. But still i am getting distance matrix between the samples not between the OTUs. How do I achieve this?

spholmes commented 4 years ago

We don't offer this a distance in this way as I do not understand how we could do that with unifrac which is a distance between samples by definition. If you want to find the distance on the tree between taxa then please use the cophenetic distance function https://rdrr.io/cran/ape/man/cophenetic.phylo.html in the ape package.

On Mon, Jul 20, 2020 at 1:55 AM Monica Steffi notifications@github.com wrote:

Dear All, I am trying to create a unifrac distance matrix for taxonomy wise instead of sample wise.

unifrac_distance<-distance(ps, method="unifrac", type = "taxa")

I tried with the above command. But still i am getting distance matrix between the samples not between the OTUs. How do I achieve this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/joey711/phyloseq/issues/1364, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJFZPLHUT6NSHCRUKFXGFLR4QBADANCNFSM4PCBT7EA .

-- Susan Holmes John Henry Samter Fellow in Undergraduate Education Professor, Statistics 2017-2018 CASBS Fellow, Sequoia Hall, 390 Serra Mall Stanford, CA 94305 http://www-stat.stanford.edu/~susan/