microbiomeComputations is an R package which provides helper functions for performing common analyses
on microbiome data. The results are available as json, or optionally in a data.table. This package is intended to be compliant with the API specified in VEuPathDB/service-eda-compute.
If you have questions or comments of any kind, join us on our Discord Community Server! We'd love to hear from you.
Use the R package remotes to install microbiomeComputations. From the R command prompt:
remotes::install_github('microbiomeDB/microbiomeComputations')If you encounter difficulties installing Maaslin2, try installing from GitHub directly:
remotes::install_github("biobakery/Maaslin2")If you encounter errors related to gfortran when installing SpiecEasi, particularly errors like:
ld: library 'emutls_w' not found
ld: warning: search path '/opt/gfortran/lib' not found
This typically occurs when gfortran is installed via Homebrew but R expects it in a different location. The recommended solution is to install the official gfortran from the R project:
- Download and install gfortran from: https://github.com/R-macos/gcc-14-branch/releases
- Restart R and try installing again
Alternatively, if you have gfortran installed via Homebrew (/opt/homebrew/bin/gfortran), you may need to create symlinks or set appropriate environment variables.
Starting with version 5.1.7, this package depends on mbioUtils instead of veupathUtils. If you're updating from an older version and encounter issues, you may need to:
# Remove old installation
remove.packages(c("microbiomeComputations", "veupathUtils"))
# Reinstall fresh
remotes::install_github('microbiomeDB/microbiomeComputations')# df is a data frame of abundance values with samples as rows. One column should hold the sample id, all other columns are assumed to be taxa
# the 'recordIdColumn' is the name of the column that contains the sample ids.
# 'method' can be 'simpson', 'shannon', or 'evenness'.
dt <- alphaDiv(df, recordIdColumn="entity.SampleID", method='simpson')
This package uses the testthat package for testing.
Pull requests are welcome and should be made to the dev branch.
For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update unit tests as appropriate.