Import Unifrac distance matrix to R

846 views
Skip to first unread message

sdpapet

unread,
Oct 14, 2014, 7:25:36 PM10/14/14
to qiime...@googlegroups.com
Hello, has anyone tried to import unifrac distance to R to do some analysis. I use R vegan package a lot, but the command "vegdist" in vegan package doesn't support to build a unifrac distance. I was wondering if it is possible to use R to analyze the unifrac matrix.

~Ben

Flo

unread,
Oct 15, 2014, 4:57:04 AM10/15/14
to qiime...@googlegroups.com
Hi ben,

The "vegdist" function from the vegan package is usefull in order to calculate pairwise community distance between samples (e.g., euclidean, sorensen, bray-curtis...). You can use the OTU table to compute that kind of distance using "vegdist" function.
The Unifrac matrix is by itself a distance matrix, like a bray-curtis matrix, so I don't clearly understand why you are trying to use the vegdist function on the unifrac matrix!
You can use metaMDS function as an ordinattion method to depict community variations across samples...or capscale function to understand community variations as a function of environnmental variables.

Hope this help!

Flo

Flo

unread,
Oct 15, 2014, 5:04:30 AM10/15/14
to qiime...@googlegroups.com

Pet Chiang

unread,
Oct 15, 2014, 11:18:27 AM10/15/14
to qiime...@googlegroups.com
Hi Flo,

Thanks. Yes, I know I can use use vegdist to create different distance matrices (e.g., bray-curtis) and then do ordination analysis. The reason that I want to import unifrac distance to R is I want to use other downstream R workflows and packages. For example, I want to build a cluster based on unfriac (I know Qiime can do this), but R "cluster" package is more powerful.

~Ben

--

---
You received this message because you are subscribed to a topic in the Google Groups "Qiime Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qiime-forum/TkUCtSJC4-c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qiime-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages