ecodive: Parallel and Memory-Efficient R Package for Ecological Diversity Analysis
ecodive: Parallel and Memory-Efficient R Package for Ecological Diversity Analysis - Published in JOSS (2026)
Science Score: 92.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 1 DOI reference(s) in JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org -
✓Committers with academic emails
1 of 1 committers (100.0%) from academic institutions -
✓Institutional organization owner
Organization cmmr has institutional domain (www.bcm.edu) -
✓JOSS paper metadata
Published in Journal of Open Source Software
Repository
Parallel and Memory-Efficient R Package for Ecological Diversity Analysis
Basic Info
- Host: GitHub
- Owner: cmmr
- License: other
- Language: R
- Default Branch: main
- Homepage: https://cmmr.github.io/ecodive/
- Size: 35.1 MB
Statistics
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 5
Metadata Files
README.md
ecodive 
ecodive is an R package for calculating ecological diversity metrics in a
parallelized and memory-efficient manner. It is designed to handle large
datasets, such as those common in microbiome research.
Why ecodive?
Analyzing ecological diversity is often a computational bottleneck, especially
with large datasets. ecodive addresses this by providing:
High Performance:
ecodiveis written in C and parallelized using pthreads, making it dramatically faster than other R packages. Benchmarks show it can be up to 14,000x faster and use up to 200,000x less memory.Zero Dependencies: The package has no external R dependencies, making it lightweight, stable, and easy to install. This also makes it an ideal and secure backend for other R packages.
Comprehensive Metrics: It implements a wide range of common alpha and beta diversity metrics, including classic and phylogenetic-aware methods like Faith's PD and the complete UniFrac family.
Ease of Use: The API is simple and integrates seamlessly with popular bioinformatics packages like
phyloseqandrbiom.
Installation
The latest stable version can be installed from CRAN.
r
install.packages('ecodive')
The development version is available on GitHub.
r
install.packages('pak')
pak::pak('cmmr/ecodive')
Usage
ecodive functions are straightforward to use. Here are a few examples.
With phyloseq or rbiom objects
The easiest way to use ecodive is with a phyloseq, rbiom, or
TreeSummarizedExperiment object. These objects conveniently bundle
the count data and phylogenetic tree.
``` r library(ecodive) data(esophagus, package = 'phyloseq') data(hmp50, package = 'rbiom')
Calculate weighted UniFrac distance
wunifrac <- weightedunifrac(esophagus) print(w_unifrac)
> B C
> C 0.1050480
> D 0.1401124 0.1422409
Calculate Faith's Phylogenetic Diversity
faithpd <- faith(hmp50) print(faithpd[1:4])
> HMP01 HMP02 HMP03 HMP04
> 6.22296 8.59432 8.93375 9.86597
```
With basic R objects
You can also provide the count data and phylogenetic tree as separate objects.
The ex_counts and ex_tree objects are included with ecodive.
``` r
Example Data ----------------------
counts <- rarefy(ex_counts) counts[,1:4]
> Streptococcus Bacteroides Corynebacterium Haemophilus
> Saliva 162 2 0 180
> Gums 309 2 0 34
> Nose 6 0 171 0
> Stool 1 341 1 1
Alpha Diversity -------------------
shannon(counts)
> Saliva Gums Nose Stool
> 0.74119910 0.35692121 1.10615349 0.07927797
faith(counts, tree = ex_tree)
> Saliva Gums Nose Stool
> 180 155 101 202
Beta Diversity --------------------
bray(counts)
> Saliva Gums Nose
> Gums 0.4260870
> Nose 0.9797101 0.9826087
> Stool 0.9884058 0.9884058 0.9913043
weightedunifrac(counts, tree = extree)
> Saliva Gums Nose
> Gums 36.97681
> Nose 67.23768 55.97101
> Stool 109.77971 109.44058 110.00870
```
Available Methods
Use list_metrics() to browse the metrics available for calculating diversity.
``` r
Alpha Diversity
list_metrics('alpha', 'id')
> [1] "ace" "berger" "brillouin" "chao1" "faith"
> [6] "fisher" "simpson" "inv_simpson" "margalef" "mcintosh"
> [11] "menhinick" "observed" "shannon" "squares"
Beta Diversity
list_metrics('beta', 'id')
> [1] "aitchison" "bhattacharyya" "bray"
> [4] "canberra" "chebyshev" "chord"
> [7] "clark" "sorensen" "divergence"
> [10] "euclidean" "generalized_unifrac" "gower"
> [13] "hamming" "hellinger" "horn"
> [16] "jaccard" "jensen" "jsd"
> [19] "lorentzian" "manhattan" "matusita"
> [22] "minkowski" "morisita" "motyka"
> [25] "normalizedunifrac" "ochiai" "psymchisq"
> [28] "soergel" "squaredchisq" "squaredchord"
> [31] "squaredeuclidean" "topsoe" "unweightedunifrac"
> [34] "varianceadjustedunifrac" "wavehedges" "weightedunifrac"
```
Documentation
The online manual for ecodive is available at https://cmmr.github.io/ecodive/. It includes a getting started guide, articles on alpha/beta diversity, and reference pages for each function.
Testing
ecodive has a comprehensive test suite using the testthat package. All
code is automatically tested via GitHub Actions upon each push to the
repository to ensure functionality and stability.
For users who have cloned the source repository, the tests can be run locally with the following commands in an R session:
r
install.packages('testthat')
devtools::test()
Community guidelines
Support
Bug reports, feature requests, and general questions can be submitted at https://github.com/cmmr/ecodive/issues.
Contributing
Pull requests are welcome. Please ensure contributed code is covered by tests and documentation (add additional tests and documentation as needed) and passes all automated tests.
New functions must leverage C and pthreads to minimize memory and CPU time.
Please note that the ecodive project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
ecodive is licensed under the MIT License © 2026 ecodive authors.
This package also contains third-party code:
- PCG Random Number Generation for C: Licensed under the Apache License, Version 2.0.
Detailed copyright and licensing information for all components can be found in the inst/COPYRIGHTS file.
Owner
- Name: Alkek Center for Metagenomics and Microbiome Research
- Login: cmmr
- Kind: organization
- Location: Baylor College of Medicine, Houston TX
- Website: https://www.bcm.edu/departments/molecular-virology-and-microbiology/cmmr/
- Repositories: 3
- Profile: https://github.com/cmmr
CMMR researchers develop molecular and informatic tools to advance clinical microbiome research.
JOSS Publication
ecodive: Parallel and Memory-Efficient R Package for Ecological Diversity Analysis
Authors
The Alkek Center for Metagenomics and Microbiome Research, Department of Molecular Virology and Microbiology, Baylor College of Medicine, Houston, TX 77030, USA, Department of Molecular Virology and Microbiology, Baylor College of Medicine, Houston, TX, USA
Tags
ecology bioinformatics microbiome diversity high-performance computingGitHub Events
Total
- Release event: 1
- Issues event: 5
- Watch event: 2
- Issue comment event: 1
- Push event: 109
- Create event: 1
Last Year
- Release event: 1
- Issues event: 5
- Watch event: 2
- Issue comment event: 1
- Push event: 109
- Create event: 1
Committers
Last synced: 4 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Daniel Smith | d****h@o****u | 151 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 6
- Total pull requests: 0
- Average time to close issues: 20 days
- Average time to close pull requests: N/A
- Total issue authors: 2
- Total pull request authors: 0
- Average comments per issue: 0.17
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 6
- Pull requests: 0
- Average time to close issues: 20 days
- Average time to close pull requests: N/A
- Issue authors: 2
- Pull request authors: 0
- Average comments per issue: 0.17
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- dansmith01 (5)
- antagomir (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- cran 2,610 last-month
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 0
(may contain duplicates) - Total versions: 8
- Total maintainers: 1
cran.r-project.org: ecodive
Parallel and Memory-Efficient Ecological Diversity Metrics
- Homepage: https://cmmr.github.io/ecodive/
- Documentation: http://cran.r-project.org/web/packages/ecodive/ecodive.pdf
- License: MIT + file LICENSE
-
Latest release: 2.2.6
published about 2 months ago
Rankings
Maintainers (1)
guix: r-ecodive
Parallel and memory-efficient ecological diversity metrics
- Homepage: https://cmmr.github.io/ecodive/
- Documentation: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/cran.scm#n21016
- License: expat
-
Latest release: 2.2.6
published 5 days ago
Rankings
Dependencies
- actions/checkout v4 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- JamesIves/github-pages-deploy-action v4.5.0 composite
- actions/checkout v4 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/checkout v4 composite
- actions/upload-artifact v4 composite
- codecov/codecov-action v5 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- R >= 4.2.0 depends
- parallel * imports
- testthat >= 3.0.0 suggests
- EndBug/add-and-commit v9 composite
- actions/checkout v4 composite
- actions/upload-artifact v4 composite
- openjournals/openjournals-draft-action master composite