ppALIGN API documentation
DriverPosterProb Class Reference
#include <posterprob.hpp>
Public Member Functions | |
| void | SetAlign (Align &a) |
| double | GetAverage () |
| virtual bool | NeedForwardBackward () |
| virtual void | OnForwardBackward (PartitionWorkspace::ForwardBackwardInfo &fb_info) |
| virtual void | AfterComputation () |
Detailed Description
Compute the marginal posterior probabilities for a given alignment.
This driver computes the marginal posterior probability for each position of a given alignment.
Match probabilities are computed from the forward and backward partition functions. Probabilities for gaps are marginalized over all possible bounding matches.
#include <posterprob.hpp> #include <partitionworkspace.hpp> ... Align align(...); ... DriverPosterProb poster_prob; PartitionWorkspace pws(100000); poster_prob.SetAlign(align); pws.AddDriver(poster_prob); ... pws.PartitionFunction(...); ... for(Align::iterator itr = align.begin(); itr != align.end(); ++itr) { itr->pair << " " << itr->posterior << endl; }
- Examples:
Definition at line 56 of file posterprob.hpp.
Member Function Documentation
| virtual void DriverPosterProb::AfterComputation | ( | ) | [virtual] |
An event that is thrown when the complete computation has been finished, forward and evtl. backward if required.
Reimplemented from PartitionDriverBase.
| double DriverPosterProb::GetAverage | ( | ) | [inline] |
- Returns:
- average posterior prob.
Definition at line 87 of file posterprob.hpp.
| virtual bool DriverPosterProb::NeedForwardBackward | ( | ) | [inline, virtual] |
Tell the main algorithm that a callback of OnForwardBackward() for each row is needed when the forward and backward rows are available simulationasly.
- Returns:
- true if the OnForwardBackward() method is to be called for each row every time the row is (re-)computed.
Reimplemented from PartitionDriverBase.
Definition at line 89 of file posterprob.hpp.
| virtual void DriverPosterProb::OnForwardBackward | ( | PartitionWorkspace::ForwardBackwardInfo & | fb_info | ) | [virtual] |
An event that is thrown when both, the forward and the backward sums are available. The the checkpoint method in the main algorithm in PartitionWorkspace assures that each row is available in increasing index i
- Parameters:
-
fb_info forward and backward data
Reimplemented from PartitionDriverBase.
| void DriverPosterProb::SetAlign | ( | Align & | a | ) |
Set the alignment for which the posterior probability should be computed. If the alignment is local, please use xdouble PartitionFunction(const Sequence & seq1, const Sequence & seq2, Align & a, const BoltzmannWeight & weight, int gap_open, int gap_extension, bool bound_match);
to perform the acutal computation.
- Parameters:
-
a alignment (global or local)
- Examples:
- alternative_alignments.cpp.
The documentation for this class was generated from the following file:
- src/posterprob.hpp