Overview
High-level description
This directory contains unit tests for various simulators and data generators in the Cassiopeia project. The tests cover different aspects of tree simulation, spatial data simulation, lineage tracing, and leaf subsampling. These tests ensure the correct functionality of the simulators and help maintain the integrity of the Cassiopeia package.
What does it do?
The test suite in this directory verifies the following functionalities:
- Birth-death tree simulation
- Brownian spatial data simulation
- CRISPR/Cas9 lineage tracing simulation
- Clonal spatial simulation
- Complete binary tree simulation
- ecDNA birth-death simulation
- Sequential lineage tracing simulation
- Simple fit subclone simulation
- Spatial leaf subsampling
- Supercellular sampling
- Uniform leaf subsampling
Each test file contains multiple test cases that check for correct initialization, error handling, and output generation for the respective simulators and data generators.
Entry points
The main entry points for these tests are the individual test files, each corresponding to a specific simulator or data generator. Some key files include:
birth_death_simulator_test.py
: Tests for the birth-death tree simulatorbrownian_spatial_simulator_test.py
: Tests for the Brownian spatial data simulatorcas9_lineage_tracing_simulator_test.py
: Tests for the CRISPR/Cas9 lineage tracing simulatorecdna_birth_death_simulator_test.py
: Tests for the ecDNA birth-death simulatorsequential_lineage_tracing_simulator_test.py
: Tests for the sequential lineage tracing simulatorspatial_leaf_subsampler_test.py
: Tests for the spatial leaf subsampler
These test files can be run individually or as part of a larger test suite to ensure the correct functionality of the Cassiopeia package.
Dependencies
The test suite relies on the following main dependencies:
- unittest: The Python unit testing framework
- numpy: For numerical operations and random number generation
- networkx: For graph operations and tree structures
- pandas: For handling data frames and character matrices
- cassiopeia: The main package being tested, including its various modules and classes
Configuration
The tests do not require specific configuration files. However, they often use random seeds to ensure reproducibility of test results. For example:
This ensures that random number generation produces consistent results across test runs.
In summary, this test suite provides comprehensive coverage for the various simulators and data generators in the Cassiopeia project, ensuring their correct functionality and helping maintain the overall quality of the package.