biotaphy.analyses.phylo_beta_diversity package
Submodules
biotaphy.analyses.phylo_beta_diversity.phylo_beta_diversity module
Module contents
Module containing code for calculating phylogenetic beta diversity.
Note
- Numpy and Scipy may have the methods needed for these computations. Feel
free to take advantage of those to libraries as they are already dependencies.
- biotaphy.analyses.phylo_beta_diversity.calculate_phylo_beta_diversity_jaccard(pam, tree)[source]
Calculates phylogenetic beta diversity for the jaccard index family.
- Parameters
pam (
Matrix
) – A Lifemapper Matrix object with presence absence values (site rows by species columns).tree (
TreeWrapper
) – A TreeWrapper object for a wrapped Dendropy phylogenetic tree.
- Returns
- Phylogenetic beta diversity matrics (species by species)
beta_jtu: ADD DESCRIPTION
phylo_beta_jtu: ADD DESCRIPTION
beta_jne: ADD DESCRIPTION
phylo_beta_jne: ADD DESCRIPTION
beta_jac: ADD DESCRIPTION
phylo_beta_jac: ADD DESCRIPTION
Note
- It looks like the scipy.spatial.distance.jaccard method may be useful
here.
- biotaphy.analyses.phylo_beta_diversity.calculate_phylo_beta_diversity_sorensen(pam, tree)[source]
Calculates phylogenetic beta diversity for the sorensen index family.
- Parameters
pam (
Matrix
) – A Lifemapper Matrix object with presence absence values.tree (
TreeWrapper
) – A TreeWrapper object for a wrapped Dendropy phylogenetic tree.
- Returns
- Phylogenetic beta diversity matrics (species by species)
beta_sim: ADD DESCRIPTION
phylo_beta_sim: ADD DESCRIPTION
beta_sne: ADD DESCRIPTION
phylo_beta_sne: ADD DESCRIPTION
beta_sor: ADD DESCRIPTION
phylo_beta_sor: ADD DESCRIPTION
- biotaphy.analyses.phylo_beta_diversity.core_Beta_calc(pam, tree)[source]
Creates an array of core metrics to asses beta diversity components.
- Parameters
( (tree) – obj:’Matrix’): A Lifemapper Matrix object with presence absence values.
( – obj:’TreeWrapper’): A TreeWrapper object for a wrapped Dendropy phylogenetic tree.
- Returns
List of arrays, see Details.
- Details:
In general, the metrics returned represent different contributions to beta diversity arising from how communities are combined together. Metrics:
shared_array: spp shared in each pairwise comm. combinations. not_shared_array: spp. not shared btwn pairwise comm. combinations. sum_not_shared: max_not_shared: min_not_shared:
- biotaphy.analyses.phylo_beta_diversity.core_PD_calc(pam, tree)[source]
Creates array of core metrics to asses components of beta diversity.
- Parameters
( (tree) – obj:’Matrix’): A Lifemapper Matrix object with presence absence values.
( – obj:’TreeWrapper’): A TreeWrapper object for a wrapped Dendropy phylogenetic tree.
- Returns
Matrix object. Cols=core metrics; Rows=Pairwise comparisons.
- Details:
In general, the metrics returned represent different contributions to PD arising from how communities are combined together. Metrics:
min_not_shared: smallest dist. from ind. samples to their combo. max_not_shared: largest dist. from ind. samples to their combo. sum_not_shared: total addition to PD from both comm. shared: combined contribution to PD that comm. make jointly.
- biotaphy.analyses.phylo_beta_diversity.pdnew(pam, tree)[source]
Creates a lookup dictionary for PD of sites in a matrix.
- Parameters
pam (
Matrix
) – A Lifemapper Matrix object with presence absence values.tree (
TreeWrapper
) – A TreeWrapper object for a wrapped Dendropy phylogenetic tree.
- Returns
Matrix object w/ PD values & spp. rch for each community in sample. Col1 = PD; Col2 = SR; Rows = Indvidual samples from pam.