BranchLengthEstimator.py
High-level description
This code defines an abstract base class BranchLengthEstimator
for branch length estimation algorithms in the Cassiopeia framework. It serves as a template for concrete branch length estimation algorithms, requiring them to implement the estimate_branch_lengths
method.
Code Structure
The BranchLengthEstimator
class is an abstract base class defined using the abc
module. It has a single abstract method, estimate_branch_lengths
, which needs to be implemented by concrete subclasses.
Symbols
Symbol Name: BranchLengthEstimator
Description
This is an abstract base class for all branch length estimation algorithms. It defines a common interface for these algorithms, ensuring that they all have an estimate_branch_lengths
method.
Inputs
The class itself does not take any inputs during initialization.
Outputs
The class itself does not return any outputs.
Internal Logic
This is an abstract base class and does not have any internal logic.
Symbol Name: estimate_branch_lengths
Description
This is an abstract method that needs to be implemented by subclasses. It should estimate the branch lengths of a given tree.
Inputs
Name | Type | Description |
---|---|---|
tree | CassiopeiaTree | CassiopeiaTree object storing character information and an initialized tree topology. |
Outputs
This method does not return any values. It should modify the input tree
object in-place, updating the branch lengths.
Internal Logic
The internal logic of this method is specific to the concrete subclass that implements it.