Set of functions to calculate Benthic Biotic Indices from composition data, obtained whether from morphotaxonomic inventories or sequencing data.
It takes composition data with associated taxonomic assignments as input and output biotic indices values. It also return the ecological quality status for each pair of sample-BBI. These BBI values can be used to calculate the normalized Ecological Quality Ratio (nEQR)
The composition can be derived from morpho-taxonomy or DNA based assignements.
To be able to use the BBI package, the following is required:
- R or RStudio
- vegan package
- BBI package (see the installation section below)
- Composition data (see below for format)
The BBI package, in its lastest stable release, is available at: https://cran.r-project.org/web/packages/BBI/index.html It can be installed using the following command within R :
install.packages("BBI")
Alternatively, the developpement version can be installed by typing these commands in R :
install.packages("devtools")
library(devtools)
install_github("trtcrd/BBI")
| taxa | Sample1 | Sample2 | Sample3 | Sample4 | ... |
|---|---|---|---|---|---|
| Annelida;Polychaeta Capitellidae;Capitellidae;Capitella;Capitella capitata | 3 | 2201 | 100 | 388 | ... |
| Mollusca;Bivalvia;Adapedonta;Hiatellidae;Hiatella;Hiatella arctica | 11 | 204 | 100 | 299 | ... |
| Nematoda sp. | 0 | 20 | 130 | 10 | ... |
| Glycera alba | 147 | 0 | 0 | 9 | ... |
| Nemertea indet. | 17 | 0 | 110 | 15 | ... |
| ... | ... | ... | ... | ... |
Preferably taxonomic paths (taxa separated by ";","/" or ",") in order to match higher rank matches. Space rather than "_" separation is expected in species names.
There are two functions: BBI calculates and return for each sample the biotic indices values and their ecological quality status.
nEQR calculates and return for each sample the nEQR values and the associated normalized ecological quality status.
library(BBI)
# calculating BBI values and ecological quality status
my_BBI <- BBI(my_composition_data)
# calculating nEQR values and ecological quality status
my_nEQR <- nEQR(my_BBI$BBI)
> my_BBI$found
[1] "Found match:" "101" " Not found:" "31"
> my_BBI$BBI
AMBI ISI NSI NQI1 Shannon ITI Bentix
Sample1 3.178476 9.571429 20.81954 0.5830994 2.093312 15.0084794 2.0249856
Sample2 3.471889 9.571429 19.93133 0.5284062 2.465243 21.4910281 2.4569632
Sample3 3.272532 9.180000 18.35880 0.5415376 2.181589 23.0795610 2.8546545
Sample4 4.777285 9.042857 20.92236 0.4173243 2.562996 23.3007691 2.9201504
> my_BBI$BBIclass
AMBI ISI NSI NQI1 Shannon
Sample1 "good" "good" "good" "moderate" "moderate"
Sample2 "moderate" "good" "moderate" "moderate" "moderate"
Sample3 "good" "good" "moderate" "moderate" "moderate"
Sample4 "bad" "good" "good" "bad" "moderate"
> my_nEQR$nEQR
nAMBI nISI nNSI nNQI1 nShannon nEQR
Sample1 0.6115737 0.7342886 0.6327817 0.5329992 0.4351477 0.5893582
Sample2 0.5656222 0.7342886 0.5972531 0.4548661 0.5027715 0.5709603
Sample3 0.6026160 0.6995857 0.5343520 0.4736251 0.4511980 0.5522754
Sample4 0.3204526 0.6874270 0.6368945 0.3192493 0.5205447 0.4969136
> my_nEQR$nEQR_class
nEQR nEQR_class
Sample1 0.58935817792461 "moderate"
Sample2 0.570960301407608 "moderate"
Sample3 0.552275367599034 "moderate"
Sample4 0.496913603640647 "moderate"
Cordier T., Pawlowski J. BBI: an R package for the computation of Benthic Biotic Indices from composition data. Metabarcoding and Metagenomics 2: e25649, doi: 10.3897/mbmg.2.25649
In specific queries without taxonomic path, genus is now used as query when species is unmatched. Major bugfix affecting the ability to match misspelled names.
Minor bugfix to handle the new stringdist requirement and to re-introduce missing row names in returned BBI dataframe.
Updated the BBI reference table, re-inserting genus rank entries that were removed from the official NSI as part of the 2018 update. Because their removal appears to significantly worsen the annotation of metabarcoding data that can often not be assigned to a species, these were re-introduced to the BBI version of NSI. The main NSI developers at NIVA have also been informed and consent. Further, a bug fix merged duplicate taxon entries.
Updated the BBI reference table
Various code cleaning and optimizations, added help pages for package functions
First version