NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Static Public Methods | List of all members
nvbio::aln::priv::hamming_alignment_score_dispatch< BAND_LEN, TYPE, TextBlockingTag, symbol_type > Struct Template Reference

Detailed description

template< uint32 BAND_LEN, AlignmentType TYPE, typename symbol_type>
struct nvbio::aln::priv::hamming_alignment_score_dispatch< BAND_LEN, TYPE, TextBlockingTag, symbol_type >

Calculate the alignment score between a pattern and a text, using the Smith-Waterman algorithm.

Template Parameters
BAND_LENinternal band length
TYPEthe alignment type
symbol_typetype of string symbols

Definition at line 842 of file hamming_inl.h.

#include <hamming_inl.h>

Static Public Methods

template<bool CHECK_N, typename context_type , typename ref_cache , typename score_type , typename temp_iterator , typename sink_type , typename scoring_type >
NVBIO_FORCEINLINE static
NVBIO_HOST_DEVICE void 
update_row (context_type &context, const uint32 block, const uint32 N, const uint32 i, const uint32 M, const symbol_type q_i, const uint8 qq_i, const score_type m_i, const ref_cache r_cache, temp_iterator temp, score_type &temp_i, score_type *band, sink_type &sink, score_type &max_score, const score_type zero, const scoring_type scoring)
 
template<typename context_type , typename string_type , typename qual_type , typename ref_type , typename scoring_type , typename sink_type , typename column_type >
NVBIO_FORCEINLINE static
NVBIO_HOST_DEVICE bool 
run (const scoring_type &scoring, context_type &context, string_type query, qual_type quals, ref_type ref, const int32 min_score, sink_type &sink, const uint32 window_begin, const uint32 window_end, column_type temp)
 
template<uint32 MAX_PATTERN_LEN, typename context_type , typename string_type , typename qual_type , typename ref_type , typename scoring_type , typename sink_type >
NVBIO_FORCEINLINE static
NVBIO_HOST_DEVICE bool 
run (const scoring_type &scoring, context_type &context, string_type query, qual_type quals, ref_type ref, const int32 min_score, sink_type &sink, const uint32 window_begin, const uint32 window_end)
 

Member Function Documentation

template<uint32 BAND_LEN, AlignmentType TYPE, typename symbol_type >
template<typename context_type , typename string_type , typename qual_type , typename ref_type , typename scoring_type , typename sink_type , typename column_type >
NVBIO_FORCEINLINE static NVBIO_HOST_DEVICE bool nvbio::aln::priv::hamming_alignment_score_dispatch< BAND_LEN, TYPE, TextBlockingTag, symbol_type >::run ( const scoring_type &  scoring,
context_type &  context,
string_type  query,
qual_type  quals,
ref_type  ref,
const int32  min_score,
sink_type &  sink,
const uint32  window_begin,
const uint32  window_end,
column_type  temp 
)
inlinestatic

Calculate the alignment score between a string and a reference, using the Smith-Waterman algorithm, using a templated column storage.

This function is templated over:

  • a context that is passed the computed DP matrix values, and can be used to specialize its behavior.
  • a sink that is used to report successful alignments

Furthermore, the function can be called on a window of the pattern, assuming that the context will provide the proper initialization for the first column of the corresponding DP matrix window.

Template Parameters
context_typethe context class, implementing the following interface:
struct context_type
{
// initialize the j-th column of the DP matrix
//
// \param j column index
// \param N column size
// \param column column values
// \param scoring scoring scheme
// \param zero zero value
template <typename column_type, typename scoring_type, typename score_type>
void init(
const uint32 j,
const uint32 N,
const scoring_type& scoring,
const score_type zero);
// do something with the previous column
//
// \param j column index
// \param N column size
// \param column column values
template <typename column_type>
void previous_column(
const uint32 j,
const uint32 N,
// do something with the newly computed cell
//
// \param i row index
// \param N number of rows (column size)
// \param j column index
// \param M number of columns (row size)
// \param score computed score
// \param dir direction flow
template <typename score_type>
void new_cell(
const uint32 i,
const uint32 N,
const uint32 j,
const uint32 M,
const score_type score,
const DirectionVector dir);
};
Parameters
contexttemplate context class, used to specialize the behavior of the aligner
queryinput pattern (horizontal string)
qualsinput pattern qualities (horizontal string)
refinput text (vertical string)
scoringscoring scheme
min_scoreminimum output score
sinkalignment sink
window_beginbeginning of pattern window
window_endend of pattern window

Definition at line 1005 of file hamming_inl.h.

template<uint32 BAND_LEN, AlignmentType TYPE, typename symbol_type >
template<uint32 MAX_PATTERN_LEN, typename context_type , typename string_type , typename qual_type , typename ref_type , typename scoring_type , typename sink_type >
NVBIO_FORCEINLINE static NVBIO_HOST_DEVICE bool nvbio::aln::priv::hamming_alignment_score_dispatch< BAND_LEN, TYPE, TextBlockingTag, symbol_type >::run ( const scoring_type &  scoring,
context_type &  context,
string_type  query,
qual_type  quals,
ref_type  ref,
const int32  min_score,
sink_type &  sink,
const uint32  window_begin,
const uint32  window_end 
)
inlinestatic

Calculate the alignment score between a string and a reference, using the Smith-Waterman algorithm, using local memory storage for the boundary columns.

This function is templated over:

  • a context that is passed the computed DP matrix values, and can be used to specialize its behavior.
  • a sink that is used to report successful alignments

Furthermore, the function can be called on a window of the pattern, assuming that the context will provide the proper initialization for the first column of the corresponding DP matrix window.

Template Parameters
context_typethe context class, implementing the following interface:
struct context_type
{
// initialize the j-th column of the DP matrix
//
// \param j column index
// \param N column size
// \param column column values
// \param scoring scoring scheme
// \param zero zero value
template <typename column_type, typename scoring_type, typename score_type>
void init(
const uint32 j,
const uint32 N,
const scoring_type& scoring,
const score_type zero);
// do something with the previous column
//
// \param j column index
// \param N column size
// \param column column values
template <typename column_type>
void previous_column(
const uint32 j,
const uint32 N,
// do something with the newly computed cell
//
// \param i row index
// \param N number of rows (column size)
// \param j column index
// \param M number of columns (row size)
// \param score computed score
// \param dir direction flow
template <typename score_type>
void new_cell(
const uint32 i,
const uint32 N,
const uint32 j,
const uint32 M,
const score_type score,
const DirectionVector dir);
};
Parameters
scoringscoring scheme
contexttemplate context class, used to specialize the behavior of the aligner
queryinput pattern (horizontal string)
qualsinput pattern qualities (horizontal string)
refinput text (vertical string)
min_scoreminimum output score
sinkalignment sink
window_beginbeginning of pattern window
window_endend of pattern window
Returns
false if early-exited, true otherwise

Definition at line 1251 of file hamming_inl.h.

template<uint32 BAND_LEN, AlignmentType TYPE, typename symbol_type >
template<bool CHECK_N, typename context_type , typename ref_cache , typename score_type , typename temp_iterator , typename sink_type , typename scoring_type >
NVBIO_FORCEINLINE static NVBIO_HOST_DEVICE void nvbio::aln::priv::hamming_alignment_score_dispatch< BAND_LEN, TYPE, TextBlockingTag, symbol_type >::update_row ( context_type &  context,
const uint32  block,
const uint32  N,
const uint32  i,
const uint32  M,
const symbol_type  q_i,
const uint8  qq_i,
const score_type  m_i,
const ref_cache  r_cache,
temp_iterator  temp,
score_type &  temp_i,
score_type *  band,
sink_type &  sink,
score_type &  max_score,
const score_type  zero,
const scoring_type  scoring 
)
inlinestatic

Definition at line 853 of file hamming_inl.h.


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