Here’s a documentation for the target file cassiopeia/data/__init__.py:

High-level description

This file serves as the top-level initialization for the cassiopeia.data module. It imports and exposes key classes and utility functions from the module, making them easily accessible to users of the Cassiopeia package.

Symbols

CassiopeiaTree

Description

Imports the CassiopeiaTree class from the CassiopeiaTree module. This class is the core data structure in Cassiopeia, representing a phylogenetic tree with associated character matrices and metadata.

Utility Functions

Description

Imports several utility functions from the utilities module. These functions provide various operations and computations related to phylogenetic trees and character matrices.

Imported Functions:

  1. compute_dissimilarity_map: Computes pairwise dissimilarities between samples in a character matrix.
  2. compute_inter_cluster_distances: Calculates mean distances between categories in a categorical variable.
  3. compute_phylogenetic_weight_matrix: Computes distances or proximities between all leaves in a tree.
  4. get_lca_characters: Builds the character vector of the lowest common ancestor (LCA) of a list of character vectors.
  5. net_relatedness_index: Computes the net relatedness index between two groups of indices.
  6. sample_bootstrap_allele_tables: Generates bootstrap character matrices from an allele table.
  7. sample_bootstrap_character_matrices: Creates bootstrapped character matrices from a given character matrix.
  8. to_newick: Converts a networkx graph to a Newick string representation.

Dependencies

DependencyPurpose
CassiopeiaTreeCore data structure for phylogenetic trees
utilitiesModule containing various utility functions

Note: This file acts as a convenient entry point for users of the Cassiopeia package, allowing them to import commonly used classes and functions directly from cassiopeia.data without needing to know the exact submodule structure.