Using qiime files with adonis in R, some questions

84 views
Skip to first unread message

Rune Grønseth

unread,
Apr 27, 2017, 9:07:31 AM4/27/17
to Qiime 1 Forum
Hi!

As several others I have paired data, so I've googled around and find that people use slightly different angles. I'm not very skilled in R, and I'm neither a bioinformatician.

I'd like to compare the beta-diversity at two and three different time points (two for 60 individuals, and some have a third time point, thus 130 samples). The timepoint vector is coded as 0 for the baseline, 1 for the first re-examination and 2 for the second. 

I've used a weighted_unifrac_dm.txt file of 130 samples and reordered the matrix to that of my mapping file. 

My idea would be to call adonis, and add a strata option for identity (vector named mk_mknr).
Thus my commands are:

library("vegan")
library("phyloseq")
meta <- read.table("MapFilerPSB270417u1065na.txt", header=TRUE)
dist <- read.table("weighted_reordered.txt", header=T)
adonis(formula = dist ~ meta$ProcedureNumber, strata = meta$mk_mknr, permutations = 999)

My questions are:
1) will the adonis call understand that this is a dissimilarity matrix, or will it try to recalculate distances somehow? 
2) will this give me results that somehow takes into account that I have paired data? Or should I have used another approach? 

With great appreciation of any help,

Rune 


Jai Ram Rideout

unread,
Apr 27, 2017, 8:04:46 PM4/27/17
to Qiime 1 Forum
Hi Rune,

This isn't really a QIIME-specific question and I'm not sure of an answer (I'm not a statistician). You might have better luck contacting the R vegan package developers for support, or perhaps the GUSTA ME community would have ideas. The phyloseq developers may also be able to point you in the right direction.

If anyone else on the forum has ideas, please jump in!

Best,
Jai

Colin Brislawn

unread,
Apr 27, 2017, 11:20:59 PM4/27/17
to Qiime 1 Forum
Hello Rune

Take a look at this page. It includes a great example of using the vegan::adonis() test along with Phyloseq.

This is the method that I use to run the adonis test on my unifrac distances matrices. 

I hope this helps,
Colin
Reply all
Reply to author
Forward
0 new messages