biotaphy.analyses.site_statistics

Module containing functions for computing site statistics.

Module Contents

Functions

calculate_tree_site_statistics(pam, tree)

Calculate tree statistics for each site in a PAM.

get_tip_lengths(tree)

Get the tip lengths in a tree.

mean_node_height(tree)

Get the mean node height for the tree.

mean_tip_length(tree)

Determine the mean tip length for the tips in a tree.

median_node_height(tree)

Get the median node height for the tree.

median_tip_length(tree)

Determine the median tip length for the tips in a tree.

node_height_percentile_25(tree)

Determine the 25 percentile node height for a tree.

node_height_percentile_2_5(tree)

Determine the 2.5 percentile node height for a tree.

node_height_percentile_75(tree)

Determine the 75 percentile node height for a tree.

node_height_percentile_97_5(tree)

Determine the 97.5 percentile node height for a tree.

tip_length_percentile_25(tree)

Determine the 25 percentile for tip length for the tips of the tree.

tip_length_percentile_2_5(tree)

Determine the 2.5 percentile for tip length for the tips of the tree.

tip_length_percentile_75(tree)

Determine the 75 percentile for tip length for the tips of the tree.

tip_length_percentile_97_5(tree)

Determine the 97.5 percentile for tip length for the tips of the tree.

Attributes

TOLERANCE

biotaphy.analyses.site_statistics.TOLERANCE = 0.005[source]
biotaphy.analyses.site_statistics.calculate_tree_site_statistics(pam, tree)[source]

Calculate tree statistics for each site in a PAM.

Parameters
  • pam (Matrix) – A PAM to compute statistics for.

  • tree (TreeWrapper) – A corresponding tree to use for statistics.

Returns

Matrix - A site by statistic matrix of tree pam statistics.

biotaphy.analyses.site_statistics.get_tip_lengths(tree)[source]

Get the tip lengths in a tree.

Parameters

tree (Tree) – A tree object to get tip lengths from.

Returns

A list of tip lengths in the tree.

Return type

list

biotaphy.analyses.site_statistics.mean_node_height(tree)[source]

Get the mean node height for the tree.

Parameters

tree (Tree) – A tree object used to measure node heights.

Returns

The mean height of the nodes in the tree.

Return type

float

biotaphy.analyses.site_statistics.mean_tip_length(tree)[source]

Determine the mean tip length for the tips in a tree.

Parameters

tree (Tree) – A tree object used to retrieve tip lengths.

Returns

The mean tip length for the tips in the tree.

Return type

float

biotaphy.analyses.site_statistics.median_node_height(tree)[source]

Get the median node height for the tree.

Parameters

tree (Tree) – A tree object used to measure node heights.

Returns

The median height of the nodes in the tree.

Return type

float

biotaphy.analyses.site_statistics.median_tip_length(tree)[source]

Determine the median tip length for the tips in a tree.

Parameters

tree (Tree) – A tree object used to retrieve tip lengths.

Returns

The median tip length for the tips in the tree.

Return type

float

biotaphy.analyses.site_statistics.node_height_percentile_25(tree)[source]

Determine the 25 percentile node height for a tree.

Parameters

tree (Tree) – A tree object used to measure node heights.

Returns

The 25 percentile node height for the tree.

Return type

float

biotaphy.analyses.site_statistics.node_height_percentile_2_5(tree)[source]

Determine the 2.5 percentile node height for a tree.

Parameters

tree (Tree) – A tree object used to measure node heights.

Returns

The 2.5 percentile node height for the tree.

Return type

float

biotaphy.analyses.site_statistics.node_height_percentile_75(tree)[source]

Determine the 75 percentile node height for a tree.

Parameters

tree (Tree) – A tree object used to measure node heights.

Returns

The 75 percentile node height for the tree.

Return type

float

biotaphy.analyses.site_statistics.node_height_percentile_97_5(tree)[source]

Determine the 97.5 percentile node height for a tree.

Parameters

tree (Tree) – A tree object used to measure node heights.

Returns

The 97.5 percentile node height for the tree.

Return type

float

biotaphy.analyses.site_statistics.tip_length_percentile_25(tree)[source]

Determine the 25 percentile for tip length for the tips of the tree.

Parameters

tree (Tree) – A tree object used to retrieve tip lengths.

Returns

The 25 percentile tip length for the tips in the tree.

Return type

float

biotaphy.analyses.site_statistics.tip_length_percentile_2_5(tree)[source]

Determine the 2.5 percentile for tip length for the tips of the tree.

Parameters

tree (Tree) – A tree object used to retrieve tip lengths.

Returns

The 2.5 percentile tip length for the tips in the tree.

Return type

float

biotaphy.analyses.site_statistics.tip_length_percentile_75(tree)[source]

Determine the 75 percentile for tip length for the tips of the tree.

Parameters

tree (Tree) – A tree object used to retrieve tip lengths.

Returns

The 75 percentile tip length for the tips in the tree.

Return type

float

biotaphy.analyses.site_statistics.tip_length_percentile_97_5(tree)[source]

Determine the 97.5 percentile for tip length for the tips of the tree.

Parameters

tree (Tree) – A tree object used to retrieve tip lengths.

Returns

The 97.5 percentile tip length for the tips in the tree.

Return type

float