Skip to content

The RaesLab's implementation of a distance based Redundancy Analysis (dbRDA)

License

Notifications You must be signed in to change notification settings

raeslab/RLdbRDA

Repository files navigation

R-CMD-check License: CC BY-NC-SA 4.0

RLdbRDA: RaesLab distance-based Redundancy Analysis

The RLdbRDA package streamlines the process of conducting distance-based redundancy analysis (db-RDA) as practiced in the RaesLab, particularly for microbial datasets. It assists researchers in identifying and visualizing the impact of metadata variables on community composition.

This package employs a two-step procedure. Initially, the influence of each variable on the community composition is individually assessed using the capscale function from the vegan package. Subsequently, a stepwise procedure is employed to determine which variables, having shown significant effects in the initial step, exert the most substantial influence. For instance, if Body Mass Index (BMI) emerges as a significant variable with the largest effect, the process then iterates to identify another variable that, in combination with BMI, has the greatest combined effect (e.g., age). This iterative process continues, adding one variable at a time (e.g., BMI combined with age, and so on), until no further variables demonstrate a significant combined effect.

Installation

RLdbRDA needs to be installed directly from GitHub using devtools. From an R console enter the commands below.

library(devtools)
install_github("raeslab/RLdbRDA")

If you are using renv, instead use the commands below to install this package.

renv::install("raeslab/RLdbRDA")

Usage

To run RLdbRDA two dataframes are needed: one with the microbial abundances and one with metadata. In both cases rows should be samples/subject and columns microbiota and metadata features respectively.

Of note: it is strongly recommended to remove strongly correlated features from the metadata before running RLdbRDA. Furthermore, RLdbRDA cannot handle missing values in the metadata. Features with many missing values should be excluded first, next samples/subjects with incomplete cases should be removed (or imputed if possible).

Example

library(RLdbRDA)
library(vegan)

data(varespec)
data(varechem)

out <- rldbrda(varespec, varechem)
out

plot_data <- prepare_plot_data(out)
plot_data

g <- plot_dbrda(plot_data)
g

bar plot showing the single and cumulative effect of various features on the varespec dataset included in vegan

Contributing

Any contributions you make are greatly appreciated.

  • Found a bug or have some suggestions? Open an issue.
  • Pull requests are welcome! Though open an issue first to discuss which features/changes you wish to implement.

Contact

RLdbRDA was developed by Sebastian Proost at the RaesLab and was adopted from code written by Sara Vieira-Silva.

For commercial access inquiries, please contact Jeroen Raes.

About

The RaesLab's implementation of a distance based Redundancy Analysis (dbRDA)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages