cassiopeia.critique.compare
module, specifically focusing on the comparison of phylogenetic trees. It uses various tree structures, including balanced trees, multifurcating trees, and rake-shaped trees, to test the accuracy of the comparison metrics.
TestTreeComparisons
class contains multiple test methods, each designed to test a specific aspect of the tree comparison functionality. The setUp
method initializes various tree structures used throughout the tests. The test methods then utilize these trees to calculate and validate different comparison metrics.
TestTreeComparisons
cassiopeia.critique.compare
module.
unittest
framework in Python. Each test method within this class is executed independently and checks for specific outcomes from the tree comparison functions. Assertions are used to validate the expected results.
setUp
CassiopeiaTree
objects with different tree structures for testing purposes.
test_out_group
get_outgroup
function, which identifies the outlier node in a triplet.
get_outgroup
)
test_same_tree_gives_perfect_triplets_correct
triplets_correct
function when comparing a tree to itself, expecting perfect agreement.
triplets_correct
)
test_triplets_correct_different_trees
triplets_correct
function with different trees, expecting variations in agreement.
triplets_correct
)
test_triplets_correct_multifurcating_same_tree
triplets_correct
function with a multifurcating tree compared to itself, considering unresolvable triplets.
triplets_correct
)
test_triplets_correct_multifurcating_different_trees
triplets_correct
function with different multifurcating trees, considering unresolvable triplets.
triplets_correct
)
test_rake_tree
triplets_correct
function with a rake-shaped tree, which has all nodes at the same depth.
triplets_correct
)
test_robinson_foulds_same_tree_bifurcating
robinson_foulds
function, which calculates the Robinson-Foulds distance between trees.
robinson_foulds
)
cassiopeia.critique.critique_utilities.get_outgroup
cassiopeia.critique.triplets_correct
cassiopeia.critique.robinson_foulds
cassiopeia.data.CassiopeiaTree
Dependency | Purpose |
---|---|
unittest | Provides the framework for writing and running unit tests. |
networkx | Used for creating and manipulating graph structures, representing phylogenetic trees. |
numpy | Used for numerical operations and array manipulation. |
pandas | Used for data manipulation and analysis, particularly with DataFrames. |
cassiopeia | The core library for single-cell lineage tracing analysis. |