CassiopeiaSolver.py
High-level description
The CassiopeiaSolver
is an abstract base class for all phylogenetic inference algorithms in the Cassiopeia framework. It defines the basic structure and interface for solvers, requiring subclasses to implement the solve
method, which performs the actual tree inference. It also handles the transformation of prior probabilities into weights used by some solvers.
Code Structure
The CassiopeiaSolver
class is an abstract base class. It doesn’t have any internal logic or complex interactions between symbols. The main purpose of this class is to define a common interface for all derived solver classes.
Symbols
CassiopeiaSolver
Description
This is an abstract base class for all phylogenetic inference algorithms. It defines the basic structure and interface for solvers.
Inputs
Name | Type | Description |
---|---|---|
prior_transformation | str | A string specifying the function to use for transforming prior probabilities into weights. Defaults to “negative_log”. |
Outputs
This class does not have any outputs.
Internal Logic
This class does not have any internal logic.
solve
Description
This is an abstract method that needs to be implemented by all derived solver classes. It performs the actual tree inference.
Inputs
Name | Type | Description |
---|---|---|
cassiopeia_tree | CassiopeiaTree | A CassiopeiaTree object storing character information for phylogenetic inference. |
layer | Optional[str] | Layer storing the character matrix for solving. If None, the default character matrix is used in the CassiopeiaTree . |
collapse_mutationless_edges | bool | Indicates if the final reconstructed tree should collapse mutationless edges based on internal states inferred by Camin-Sokal parsimony. Defaults to False. |
logfile | str | File location to log output. Defaults to “stdout.log”. |
Outputs
This method does not have any outputs. It modifies the input cassiopeia_tree
object by populating its tree attribute.
Internal Logic
This method is abstract and does not have any internal logic. It needs to be implemented by derived classes.