Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to perform a pairwise adonis test with unifrac distance? #125

Open
Stabilo12 opened this issue Oct 1, 2019 · 3 comments
Open

How to perform a pairwise adonis test with unifrac distance? #125

Stabilo12 opened this issue Oct 1, 2019 · 3 comments

Comments

@Stabilo12
Copy link

I would like to perform a pairwise adonis test with phyloseq object and a unifrac distance matrix but I don't know how?

Example:
data(GlobalPatterns)
metadata <- as(sample_data(GlobalPatterns), "data.frame")
dist.uf <- phyloseq::distance(GlobalPatterns, method = "unifrac")
ps.adonis <- adonis(dist.uf ~ SampleType, data = metadata, perm=9999)

SampleType 8 3.4957 0.43696 4.2046 0.66427 1e-04 ***

The adonis test showed that SampleType does explain part of the variation, but I want to know which Samples are different from each other.. With betadisper paired test is easy to perform, but I don't know how to do this within the adonis function with a uf distance matrix?

ps.disper <- betadisper(dist.uf, metadata$SampleType)
permutest(ps.disper, pair=TRUE)

Response: Distances
Df Sum Sq Mean Sq F N.Perm Pr(>F)
Groups 8 0.042397 0.0052996 2.9572 999 0.027 *
Residuals 17 0.030466 0.0017921

Signif. codes: 0 ‘’ 0.001 ‘’ 0.01 ‘’ 0.05 ‘.’ 0.1 ‘ ’ 1

Pairwise comparisons:
image

The pairwise.adonis function does only include Bray-curtis and Jaccard distance..

Thank you in advance!

@antagomir
Copy link
Member

As far as I can see, none of the above-mentioned functions are maintaiend in the microbiome R pkg. This functionality and examples would be useful, though, but not currently implemented. We could welcome & incorporate new examples on this in the tutorial

@Stabilo12
Copy link
Author

Thank for your reaction, it would be great if it could be implemented. I think many people would need such a function, right? Or are you currently only testing between two groups (without correction for multiple testing)? (Sorry, probably this is not the place for those questions, but i dont know were to ask otherwise)

@antagomir
Copy link
Member

I agree, this would be useful. If you could afford the time to prepare an example, we could add it in the tutorial? Otherwise, I'll leave this open for now and we could return to this later when time allows to expand the tutorials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants