This directory contains unit tests for the plotting functionality in the Cassiopeia project. It includes tests for various plotting utilities, local 2D and 3D plotting, and iTOL (Interactive Tree of Life) plotting. The tests cover a wide range of functions and classes related to tree visualization, color manipulation, coordinate transformations, and data representation.
The test suite in this directory ensures the correctness and reliability of Cassiopeia’s plotting capabilities. It verifies:
Basic utility functions for color manipulation, coordinate transformations, and tree placement.
Generation of color strips and indel heatmaps for tree visualization.
2D plotting functionality using both matplotlib and plotly backends.
3D tree plotting and spatial data representation.
Integration with iTOL for online tree visualization and export.
These tests help maintain the integrity of Cassiopeia’s plotting features, ensuring that researchers can reliably visualize and analyze their phylogenetic data.
This file tests the iTOL plotting utilities. It verifies the creation of gradient files, colorbar files, and allele heatmaps for iTOL visualization. It also tests the integrated pipeline for uploading and exporting trees to iTOL.Key tests include:
Generation of gradient and colorbar files
Creation of allele heatmaps with various color specifications
Integrated pipeline for uploading and exporting trees to iTOL
This file contains tests for 3D plotting of tree structures. It verifies functions related to coordinate interpolation, color manipulation, label generation, and the main Tree3D class.Key tests include:
Interpolation of branch coordinates
Color mixing and manipulation functions
Generation of labels from spatial coordinates
Initialization and basic functionality of the Tree3D class
This file tests the local 2D plotting functionality. It covers color strip creation, indel heatmap generation, and the main plotting functions for both matplotlib and plotly backends.Key tests include:
Computation of color strip sizes
Creation of categorical and continuous color strips
This file tests various utility functions used in plotting trees and other visualizations. It covers functions for coordinate transformations, color generation, and tree placement.Key tests include:
Conversion between degrees and radians
Conversion between polar and Cartesian coordinates
Some tests, particularly those related to iTOL integration, may require a configuration file (~/.itolconfig) for iTOL credentials. Tests that depend on this configuration are skipped if the file is not present.The tests use various fixtures and setup methods to create sample data, including:
Random number generation with fixed seeds for reproducibility
Sample trees and allele tables
Indel priors and color maps
These configurations ensure consistent and reproducible test results across different environments.