Skip to contents

Faith's phylogenetic diversity metric.

Usage

faith(counts, tree = NULL, cpus = n_cpus())

Arguments

counts

An OTU abundance matrix where each column is a sample, and each row is an OTU. Any object coercible with as.matrix() can be given here, as well as phyloseq, rbiom, SummarizedExperiment, and TreeSummarizedExperiment objects.

tree

A phylo-class object representing the phylogenetic tree for the OTUs in counts. The OTU identifiers given by colnames(counts) must be present in tree. Can be omitted if a tree is embedded with the counts object or as attr(counts, 'tree').

cpus

How many parallel processing threads should be used. The default, n_cpus(), will use all logical CPU cores.

Value

A numeric vector.

Details

Faith's Phylogenetic Diversity (PD) is a unique richness metric that incorporates the evolutionary relationships between the members of a community. Instead of simply counting the number of unique taxa, Faith's PD is calculated as the sum of the lengths of all the branches on a phylogenetic tree that connect all the species present in a sample. The rationale is that a community composed of distantly related organisms (e.g., from different phyla) is more "diverse" in an evolutionary sense than a community with the same number of species that are all closely related (e.g., from the same genus). A higher PD value indicates greater phylogenetic diversity. Because evolutionary relatedness often correlates with function, Faith's PD can also serve as a valuable proxy for the unmeasured functional diversity of a community. This metric requires a phylogenetic tree as an input for its calculation.

Calculation

Given \(n\) branches with lengths \(L\) and a sample's abundances on each of those branches coded as 1 for present or 0 for absent:

$$\sum_{i = 1}^{n} P_i \times L_i$$

References

Faith DP 1992. Conservation evaluation and phylogenetic diversity. Biological Conservation, 61:1-10. doi:10.1016/0006-3207(92)91201-3

See also

Other alpha_diversity: alpha_div(), beta_div(), chao1(), inv_simpson(), observed(), shannon(), simpson()

Examples

    # Example counts matrix
    ex_counts
#>                   Saliva Gums Nose Stool
#> Streptococcus        162  793   22     1
#> Bacteroides            2    4    2   611
#> Corynebacterium        0    0  498     1
#> Haemophilus          180   87    2     1
#> Propionibacterium      1    1  251     0
#> Staphylococcus         0    1  236     1
    
    # Faith diversity values
    faith(ex_counts, tree = ex_tree)
#> Saliva   Gums   Nose  Stool 
#>    180    191    215    202