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

Where to find CAP1 and CAP2 values in phyloseq::ordinate with method "CAP" #1772

Open
msconstante opened this issue Sep 25, 2024 · 1 comment

Comments

@msconstante
Copy link

msconstante commented Sep 25, 2024

Hi,

I am trying to get the CAP1, CAP2 and bacterial loading values from a capscale.phyloseq ordination object and look at bacterial contributions to beta-diversity.

ord<-phyloseq::ordinate(phyloclr, method="CAP", distance="euclidean", formula= ~ Group)
ordPlotDefault` <- plot(ord)
ordPlotOrdination` <- phyloseq::plot_ordination(phyloclr, ord)

The above two plots are consistent (see attached), but I get a different scale (but the same pattern) using:

dfo <- data.frame(ord[["CCA"]][["wa"]])
waPlot <- ggplot() + 
  geom_point(data=dfo, aes(x=dfo[,1], y= dfo[,2]), color="black")

I assume "wa" values are being multiplied by a specific value, but I cannot find which.
This is relevant as I am interested in the bacterial contributions to CAP1 and CAP2 by using the values in:
ord[["CCA"]][["v"]]

I am wondering whether the "v" values are compared to "wa" values or to those obtained from phyloseq::plot_ordination.

ordPlotDefault
ordPlotDefault

ordPlotOrdination
ordPlotOrdination

waPlot
waPlot

@msconstante
Copy link
Author

Nevermind.

This seems to be a vegan question and it seems you can get the CAP and bacterial contributions using:

as.data.frame(scores(ord, display = "sites"))
as.data.frame(scores(ord, display = "species"))

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

1 participant