ppALIGN API documentation
ppALIGN library
1.0
Table of contents
Forward and backward calculation
The theoretical background of the calculation we would like to refer to our paper.
Getting started
The computation of the forward and backward variables are performed in the class PartitionWorkspace. In the constructor the user may provide the number of dynamic programming cells that are available for the computation, for example
#include <ppalign/partitionworkspace.hpp> PartitionWorkspace ws(1000000);
If the provided number of cells exceeds the required, the algorithm relies on the checkpoint algorithm by Newberg. To retrieve information from the forward an backward algorithm the user must provide a "Driver" to the PartitionWorkspace object.
Such a driver is registered via PartitionWorkspace::AddDriver(PartitionDriverBase & driver) before the actual computation.
The core library of ppALIGN provides already four drivers
- DriverPosterProb This driver computes the column wise posterior probablities of an given alignment.
- DriverSampling This driver samples alignments from the posterior distribution.
- DriverPosterDecode determines the alignment which for which the sum of marginalized probabilities is maximal.
- DriverLocalBound determines the start and end probabilities of local alignments.
- DriverFirstMoment compute the expected score with respect to the underlying model.
Extending the library
The starting point to extend the computations based on the forward and/or backward probabilities is the class PartitionDriverBase. You have to derive your own class and overwrite some virtual methods.