2.2.3. Diversity computation
Diversity computations were carried out with the R vegan package
(version 2.5-5) (Oksanen et al., 2019). Shannon diversity index was
calculated with the diversity function. The richness was
calculated from rarefied counts (rarefy function, random
subsamples of the size of the sample with the lowest number of reads).
For the computation of inter-sample diversity (beta-diversity), the
matrices were generated from the rarefied abundances.
If the “Bray-Curtis dissimilarity ” option is selected on the
query page, the abundances are normalized using the Hellingermethod from the decostand function and a dissimilarity matrix is
produced with the vegdist function.
For the ”Jaccard index ” option, the abundance matrix is
transformed into a presence/absence matrix (0 and 1). The distance
matrix is calculated with the vegdist function using the Jaccard
option.
Based on these matrices, a nMDS is performed with the metaMDSfunction. The stress value shown on the graph indicates how similar the
distances between samples in the ordination space are to the original
distances. The closer the stress value is to 0, the more similar the
distances are.
The “With environmental vectors ” button plots an additional
nMDS graphic with projections of variable vectors. The script uses theenvfit function to fit environmental vectors or factors onto an
ordination. The data projections onto vectors have a maximum correlation
with corresponding environmental variables and the factors show the
averages of factor levels. The variables with a percentage of missing
data higher than 15 are removed.