aspartik.b3.likelihoods
Felsenstein's tree likelihood calculators.
class Likelihood:
class Likelihood(Stateful, Protocol): """ Tree likelihood calculator This object calculates the likelihood of a tree given the sequence data using Felsenstein's tree pruning algorithm. There are several implementations, each with its own options. """ def propose(self) -> None: """ Fetches the current model state and starts the calculations. Each implementations are responsible for pulling the state. Depending on the implementation, `propose` might start the calculation in parallel and return. In this case `likelihood` will block on it. """ ... def likelihood(self) -> float: """ Returns the tree likelihood calculated. If `propose` was called during this epoch, this must the likelihood as a result of the proposal. If `accept` or `reject` was called last, this method must return the last accepted likelihood. """ ... def num_patterns(self) -> int: """Number of unique state patterns in the underlying alignment""" ...#
Tree likelihood calculator
This object calculates the likelihood of a tree given the sequence data using Felsenstein's tree pruning algorithm.
There are several implementations, each with its own options.
def propose(self) -> None
def propose(self) -> None: """ Fetches the current model state and starts the calculations. Each implementations are responsible for pulling the state. Depending on the implementation, `propose` might start the calculation in parallel and return. In this case `likelihood` will block on it. """ ...#
Fetches the current model state and starts the calculations.
Each implementations are responsible for pulling the state.
Depending on the implementation, propose might start the calculation
in parallel and return. In this case likelihood will block on it.
def likelihood(self) -> float
def likelihood(self) -> float: """ Returns the tree likelihood calculated. If `propose` was called during this epoch, this must the likelihood as a result of the proposal. If `accept` or `reject` was called last, this method must return the last accepted likelihood. """ ...#
Returns the tree likelihood calculated.
If propose was called during this epoch, this must the likelihood as
a result of the proposal. If accept or reject was called last,
this method must return the last accepted likelihood.
def num_patterns(self) -> int
def num_patterns(self) -> int: """Number of unique state patterns in the underlying alignment""" ...#
Number of unique state patterns in the underlying alignment
def accept(self) -> None
def accept(self) -> None: """Accept changes made during the current step"""#
Accept changes made during the current step
def reject(self) -> None
def reject(self) -> None: """Reject changes made during the current step This method must roll the state of the object back to how it was at the beginning of the MCMC step. """#
Reject changes made during the current step
This method must roll the state of the object back to how it was at the beginning of the MCMC step.
class CPU4Likelihood:
#4-state DNA likelihood calculator.
It's synchronous. CUDALikelihood should be used for parallel calculations
for alignments larger than 100Kb.
def likelihood(self, /)
#The type of the None singleton.
def accept(self, /)
#The type of the None singleton.
def reject(self, /)
#The type of the None singleton.
def num_patterns(self, /)
#The type of the None singleton.
class CUDALikelihood:
#Likelihood calculations on NVIDIA graphics cards.
Only supports 4-state DNA models. cuda_device allows selecting the device
index.
def likelihood(self, /)
#The type of the None singleton.
def accept(self, /)
#The type of the None singleton.
def reject(self, /)
#The type of the None singleton.
def num_patterns(self, /)
#The type of the None singleton.