This class can compute a form of alignment with a slightly more complicated cost function than LinearAligner. More...
#include <musaline.hpp>
Public Types | |
typedef CostCalc | CostCalculator |
Public Member Functions | |
AffineAligner (CostCalculator ccal=CostCalculator()) | |
Constructor. More... | |
void | set_cost_calculator (CostCalculator ccal) |
Set a different CostCalculator object. | |
CostCalculator const & | get_cost_calculator () const |
Get a const reference to the current CostCalculator object. | |
template<class Sequence0 , class Sequence1 > | |
Alignment | global_align (Sequence0 const &seq0, Sequence1 const &seq1) const |
template<class Sequence0 , class Sequence1 > | |
Alignment | cut_one_end_off_align (Sequence0 const &seq0, Sequence1 const &seq1) const |
template<class Sequence0 , class Sequence1 > | |
Alignment | cut_one_begin_off_align (Sequence0 const &seq0, Sequence1 const &seq1) const |
template<class Sequence0 , class Sequence1 > | |
Alignment | inside_align (Sequence0 const &seq0, Sequence1 const &seq1) const |
template<class Sequence0 , class Sequence1 > | |
Alignment | initial_align (Sequence0 const &seq0, Sequence1 const &seq1) const |
template<class Sequence0 , class Sequence1 > | |
Alignment | end_align (Sequence0 const &seq0, Sequence1 const &seq1) const |
template<class Sequence0 , class Sequence1 > | |
Alignment | semi_align (Sequence0 const &seq0, Sequence1 const &seq1) const |
template<class Sequence0 , class Sequence1 > | |
Alignment | partial_align (Sequence0 const &seq0, Sequence1 const &seq1) const |
No requirement for start and end. | |
This class can compute a form of alignment with a slightly more complicated cost function than LinearAligner.
An element of a sequence can be aligned with an element of the other sequence or with a gap. The cost of aligning two elements or an element does not depend on the context, but the cost of extending a gap can be different from starting a gap.
The class has several align functions which differ in what part of the sequences should be aligned. Details are provided with the individual align functions.
This class takes a CostCalculator class as a template parameter. This class shall be provided by the user and gives the benefit of matching one element with another one. If you can call the following function template with your cost calculator and sequences, you should be OK. More detailed requirements are listed after the function.
The classes Sequence0 and Sequence1 should fulfill the requirements for a boost Forward Range. See the documentation of the range library on http://www.boost.org for full details. A range can be thought of as a 'container light'. It should give access to a begin and end iterator, which should be forward iterators.
The CostCalculator class has the same requirements as the CostCalculator for the LinearAligner class, plus one extra required member function:
ext_bft
. Returns the benefit for extending a gap, that is, for matching an element with a gap, where the previous element was also matched with a gap. The returned value should be negative, otherwise, the results are not guaranteed to be the optimal solution.
|
inline |
Constructor.
Alignment musaline::AffineAligner< CostCalc >::cut_one_begin_off_align | ( | Sequence0 const & | seq0, |
Sequence1 const & | seq1 | ||
) | const |
align one complete sequence with the end of the other sequence. end[0]==size of seq0, end[1]==size of seq1 and either start[0]==0 or start[1]==0.
Alignment musaline::AffineAligner< CostCalc >::cut_one_end_off_align | ( | Sequence0 const & | seq0, |
Sequence1 const & | seq1 | ||
) | const |
align one complete sequence with the start of the other sequence. start[0]==0, start[1]==0 and either end[0]==size of seq0 or end[1]==size of seq1.
Alignment musaline::AffineAligner< CostCalc >::end_align | ( | Sequence0 const & | seq0, |
Sequence1 const & | seq1 | ||
) | const |
align the end of the sequences. end[0]==size of seq0 and end[1]==size of seq1.
Alignment musaline::AffineAligner< CostCalc >::global_align | ( | Sequence0 const & | seq0, |
Sequence1 const & | seq1 | ||
) | const |
align both complete sequences. The resulting Alignment will have start[i]==0 and end[i]==size of seq i, for i==1 and 2.
Alignment musaline::AffineAligner< CostCalc >::initial_align | ( | Sequence0 const & | seq0, |
Sequence1 const & | seq1 | ||
) | const |
align the start of the sequences. start[0]==0 and start[1]==0.
Alignment musaline::AffineAligner< CostCalc >::inside_align | ( | Sequence0 const & | seq0, |
Sequence1 const & | seq1 | ||
) | const |
align seq0 inside seq1. start[0]==0 and end[0]==size of sequence 0.
Alignment musaline::AffineAligner< CostCalc >::semi_align | ( | Sequence0 const & | seq0, |
Sequence1 const & | seq1 | ||
) | const |
start[0]==0 or start[1]==0 end[0]==size of seq0 or end[1]==size of seq1.