cassiopeia.critique.triplets_correct#

cassiopeia.critique.triplets_correct(tree1, tree2, number_of_trials=1000, min_triplets_at_depth=1)[source]#

Calculate the triplets correct accuracy between two trees.

Takes in two newick strings and computes the proportion of triplets in the tree (defined as a set of three leaves) that are the same across the two trees. This procedure samples the same number of triplets at every depth such as to reduce the amount of bias of sampling triplets randomly.

Parameters:
tree1 CassiopeiaTree

Input CassiopeiaTree

tree2 CassiopeiaTree

CassiopeiaTree to be compared to the first tree.

number_of_trials int (default: 1000)

Number of triplets to sample at each depth

min_triplets_at_depth int (default: 1)

The minimum number of triplets needed with LCA at a depth for that depth to be included

Returns:

all_triplets_correct: the total triplets correct resolvable_triplets_correct: the triplets correct for resolvable

triplets

unresolved_triplets_correct: the triplets correct for unresolvable

triplets

proportion_resolvable: the proportion of unresolvable triplets per

depth

Return type:

Four dictionaries storing triplet information at each depth