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

Update RDA example using plotLoadings #603

Open
wants to merge 28 commits into
base: devel
Choose a base branch
from

Conversation

ElySeraidarian
Copy link
Contributor

Small update to use new plotLoadings function.

Also shows how to retrieve and plot the loadings for RDA (microbiome/mia#604)

Created same plot as before (can change to plot all components and/or more examples using different parameters/methods)

Comment on lines +616 to +617
#Create a plot
plotLoadings(coef, ncomponents = 1, n = 20) + labs(x = "", y= "", title = "Top Taxa") +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm - why this doesn't use TreeSE directly (but coef)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, I think the plotted values are species scores (the coordinate of taxon in ordination space) instead of loadings (how much environmental variable, e.g, diagnosis affects the coordinates). The example has been incorrect

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because loadings are not stored in the "rotation" or "loadings" attribute (discussed in #604 )
It requires a wrapper I believe?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a small problem in addRDA as it should store the results to this slot microbiome/mia#634

Let's keep this PR open until the mia is fixed

ggplot(df, aes(x = x, y = y)) +
geom_bar(stat = "identity") +
labs(x = "", y= "", title = "Top Taxa") +
#Create a plot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually, space after #

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

Successfully merging this pull request may close these issues.

4 participants