I can't get the coefficients of the taxa that contribute to the groups differences

68 Views Asked by At

I'm trying to get the coefficients of the taxa that generate the most differences between the groups in my permutest of types of supplies for the animals. I paste the results of the permutest:

permutest(betadispersionAlimentación, pairwise = TRUE) enter image description here

When I try to get the coefficients, Studio answer me with this:

coefficients(betadispersionAlimentación)["C",] NULL

The object to get the coefficients is the type of: Permanova? Betadisper? Permutest?

i don't know how can I get the taxa (genus, Family, Specie...) that contribute to the differences.

can anybody help me, please?

Thanks a lot!

1

There are 1 best solutions below

1
On BEST ANSWER

For anybody who have the same problem. From the day that I posted the question I have worked about that. To get de genus or the specie that more contribute to the dissimilarity I used the vegan library.

Here I used the Vegan Distance to create de distance object

DIST_ABUNDANCES <- vegdist(t(OTU_ABUNDANCES))

Here I took the anova function to create all the values.

anova(betadisper(DIST_ABUNDANCES, META_ABUNDANDES$Sexo))

Here I made the permutest to compare all the values of the variable Sexo

permutest(betadisper(DIST_ABUNDANCES, META_ABUNDANDES$Sexo), pairwise = TRUE)

Here I took the correlation coefficients of the anova to seek the objetive

COEF_ABUNDANCES <- coefficients(PERMANOVA_ABUNDANCES)["Sexo1",] 

I created the top coeficients object

TOP.COEF_ABUNDANCES <- COEF_ABUNDANCES[rev(order(abs(COEF_ABUNDANCES)))[1:20]]

Here I designed the plot of the coefficients

par(mar = c(3, 14, 2, 1))
barplot(sort(TOP.COEF_ABUNDANCES), horiz = T, las = 1, main = "Top taxa")

I followed this tutorial: https://mibwurrepo.github.io/Microbial-bioinformatics-introductory-course-Material-2018/multivariate-comparisons-of-microbial-community-composition.html