yat  0.20.3pre
Public Member Functions | List of all members
theplu::yat::utility::SmithWaterman Class Reference

#include <yat/utility/SmithWaterman.h>

Public Member Functions

 SmithWaterman (double gap=0, double open_gap=0)
 Constructor. More...
 
 SmithWaterman (double vertical_gap, double open_vertical_gap, double horizon_gap, double open_horizon_gap)
 Constructor. More...
 
const Aligner::Cigarcigar (void) const
 
size_t position (void) const
 
const Matrixscore (void) const
 
double operator() (const MatrixBase &dot)
 
template<typename RandomAccessIterator1 , typename RandomAccessIterator2 >
double operator() (RandomAccessIterator1 reference_begin, RandomAccessIterator1 reference_end, RandomAccessIterator2 query_begin, RandomAccessIterator2 query_end, double mismatch=0)
 

Detailed Description

Since
New in yat 0.12

Constructor & Destructor Documentation

◆ SmithWaterman() [1/2]

theplu::yat::utility::SmithWaterman::SmithWaterman ( double  gap = 0,
double  open_gap = 0 
)
explicit

Constructor.

Same as SmithWaterman(gap, open_gap, gap, open_gap)

◆ SmithWaterman() [2/2]

theplu::yat::utility::SmithWaterman::SmithWaterman ( double  vertical_gap,
double  open_vertical_gap,
double  horizon_gap,
double  open_horizon_gap 
)

Constructor.

Parameters
vertical_gapPenalty for extending a vertical gap. A vertical gap means consuming a reference element i.e. a deletion in query sequence.
open_vertical_gapOpen a deletion. Total cost for a deletion is open_vertical_gap + N * vertical_gap.
horizon_gapPenalty for extending a insertion.
open_horizon_gapPenalty for open an insertion. Total penalty for a insertion is open_horizon_gap + N * horizon_gap.

Member Function Documentation

◆ cigar()

const Aligner::Cigar& theplu::yat::utility::SmithWaterman::cigar ( void  ) const

The CIGAR here is slightly different compared to CIGAR in Aligner as it uses BAM_CEQUAL and BAM_CDIFF rather than BAM_CMATCH, and it also uses BAM_CSOFT_CLIP and ends of CIGAR to reflect if whole query was aligned.

Returns
CIGAR reflecting latest performed alignment

◆ operator()() [1/2]

double theplu::yat::utility::SmithWaterman::operator() ( const MatrixBase dot)

Find best alignment using Smith-Waterman algorithm based on the dot-matrix. Each row in dot corresponds to an element in reference, and each column corresponds to an element in the query.

Returns
smith-waterman score

◆ operator()() [2/2]

template<typename RandomAccessIterator1 , typename RandomAccessIterator2 >
double theplu::yat::utility::SmithWaterman::operator() ( RandomAccessIterator1  reference_begin,
RandomAccessIterator1  reference_end,
RandomAccessIterator2  query_begin,
RandomAccessIterator2  query_end,
double  mismatch = 0 
)

Calculate a dot-matrix of size query_end-query_begin X reference_end-reference_begin where the element ij is 1.0 if reference_begin[i] == query_begin[j] and -mismatch otherwise.

Type Requirements:

◆ position()

size_t theplu::yat::utility::SmithWaterman::position ( void  ) const
Returns
position i.e. first element in reference that is aligned to the query.

◆ score()

const Matrix& theplu::yat::utility::SmithWaterman::score ( void  ) const
Returns
score matrix

The documentation for this class was generated from the following file:

Generated on Sat Feb 18 2023 03:31:45 for yat by  doxygen 1.8.14