The SpectralSolver
class in SpectralSolver.py
provides a method for reconstructing phylogenetic trees using a spectral algorithm. It leverages the similarity between samples based on shared mutations to partition them recursively, ultimately building a tree structure. This approach aims to minimize the separation of samples with shared mutations while accounting for the size of each partition.
The SpectralSolver
class inherits from the GreedySolver
class. It primarily overrides the perform_split
method to implement its specific partitioning logic using a spectral algorithm. The SpectralSolver
utilizes functions from graph_utilities
to construct and manipulate similarity graphs.
This code references the following symbols:
GreedySolver
(from cassiopeia.solver.GreedySolver
)dissimilarity_functions
(from cassiopeia.solver
)graph_utilities
(from cassiopeia.solver
)SpectralSolver
This class implements a spectral algorithm for phylogenetic tree reconstruction. It inherits from GreedySolver
and overrides the perform_split
method to partition samples based on a similarity graph.
Name | Type | Description |
---|---|---|
similarity_function | Optional[Callable[[int, int, pd.DataFrame, int, Optional[Dict[int, Dict[str, float]]]], float]] | A function to calculate similarity between samples (default: hamming_similarity_without_missing ). |
threshold | Optional[int] | Minimum similarity threshold for graph edges (default: 0). |
prior_transformation | str | Transformation function for priors (default: “negative_log”). |
This class doesn’t directly return any output. It modifies the input CassiopeiaTree
object during the solve
method.
perform_split
Method:
graph_utilities.construct_similarity_graph
.graph_utilities.spectral_improve_cut
.solve
Method (inherited from GreedySolver
):
perform_split
until individual samples are reached.CassiopeiaTree
with the reconstructed tree.The solve
method modifies the input CassiopeiaTree
object by populating its tree structure.
The spectral algorithm’s performance depends on the size and structure of the similarity graph. Larger datasets might require more computational resources. The spectral_improve_cut
function performs a greedy hill-climbing optimization, which could be computationally intensive for complex graphs.
The SpectralSolver
class in SpectralSolver.py
provides a method for reconstructing phylogenetic trees using a spectral algorithm. It leverages the similarity between samples based on shared mutations to partition them recursively, ultimately building a tree structure. This approach aims to minimize the separation of samples with shared mutations while accounting for the size of each partition.
The SpectralSolver
class inherits from the GreedySolver
class. It primarily overrides the perform_split
method to implement its specific partitioning logic using a spectral algorithm. The SpectralSolver
utilizes functions from graph_utilities
to construct and manipulate similarity graphs.
This code references the following symbols:
GreedySolver
(from cassiopeia.solver.GreedySolver
)dissimilarity_functions
(from cassiopeia.solver
)graph_utilities
(from cassiopeia.solver
)SpectralSolver
This class implements a spectral algorithm for phylogenetic tree reconstruction. It inherits from GreedySolver
and overrides the perform_split
method to partition samples based on a similarity graph.
Name | Type | Description |
---|---|---|
similarity_function | Optional[Callable[[int, int, pd.DataFrame, int, Optional[Dict[int, Dict[str, float]]]], float]] | A function to calculate similarity between samples (default: hamming_similarity_without_missing ). |
threshold | Optional[int] | Minimum similarity threshold for graph edges (default: 0). |
prior_transformation | str | Transformation function for priors (default: “negative_log”). |
This class doesn’t directly return any output. It modifies the input CassiopeiaTree
object during the solve
method.
perform_split
Method:
graph_utilities.construct_similarity_graph
.graph_utilities.spectral_improve_cut
.solve
Method (inherited from GreedySolver
):
perform_split
until individual samples are reached.CassiopeiaTree
with the reconstructed tree.The solve
method modifies the input CassiopeiaTree
object by populating its tree structure.
The spectral algorithm’s performance depends on the size and structure of the similarity graph. Larger datasets might require more computational resources. The spectral_improve_cut
function performs a greedy hill-climbing optimization, which could be computationally intensive for complex graphs.