NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | Private Member Functions | List of all members
CSeqMaskerWindow Class Reference

Search Toolkit Book for CSeqMaskerWindow

Sliding window skipping over the ambiguities. More...

#include <algo/winmask/seq_masker_window.hpp>

+ Inheritance diagram for CSeqMaskerWindow:

Public Types

typedef Uint4 TUnit
 Integer type used to represent units within a window. More...
 
typedef vector< TUnitTUnits
 type representing an array of consecutive units. More...
 

Public Member Functions

 CSeqMaskerWindow (const objects::CSeqVector &arg_data, Uint1 arg_unit_size, Uint1 arg_window_size, Uint4 window_step, Uint1 unit_step=1, Uint4 winstart=0, Uint4 winend=0)
 Object constructor. More...
 
virtual ~CSeqMaskerWindow ()
 Object destructor. More...
 
 operator bool () const
 Check if the end of the sequence has been reached. More...
 
void operator++ ()
 Advance the window. More...
 
TUnit operator[] (Uint1 index) const
 Access units of the current window by index. More...
 
Uint4 Start () const
 Get the current starting position of the window. More...
 
Uint4 End () const
 Get the current ending position of the window. More...
 
Uint4 Step () const
 Get the current value of the window step. More...
 
Uint1 UnitStep () const
 Get the current value of the unit step. More...
 
Uint1 NumUnits () const
 Get the number of units in a window. More...
 
virtual void Advance (Uint4 step)
 Slide the window by the given number of bases. More...
 
Uint1 GetUnitSize () const
 Get the unit size. More...
 

Static Public Attributes

static Uint1 LOOKUP []
 Table used to translate bases from iupacna to ncbi2na format. More...
 

Protected Attributes

const objects::CSeqVector & data
 The sequence data in iupacna format. More...
 
bool state
 true, if the end of the sequence has not been reached. More...
 
Uint1 unit_size
 The unit size. More...
 
Uint1 unit_step
 The distance between consequtive units within a window. More...
 
Uint1 window_size
 The window size. More...
 
Uint4 window_step
 The amount of bases by which the window advances under operator++() More...
 
Uint4 start
 The start of the current window. More...
 
Uint4 end
 The end if the current window. More...
 
TUnits::size_type first_unit
 The position in the array of units of the first unit of the current window. More...
 
TUnits units
 The array of units. More...
 
TUnit unit_mask
 The mask to use when accessing the integer value of a unit. More...
 
Uint4 winend
 Final position in the sequence. More...
 

Private Member Functions

void FillWindow (Uint4 winstart)
 

Detailed Description

Sliding window skipping over the ambiguities.

This class represents a window consisting totally of unambiguous bases. It provides access to each of the window units and operators for sliding the window forward.

Definition at line 54 of file seq_masker_window.hpp.

Member Typedef Documentation

◆ TUnit

Integer type used to represent units within a window.

Definition at line 62 of file seq_masker_window.hpp.

◆ TUnits

typedef vector< TUnit > CSeqMaskerWindow::TUnits

type representing an array of consecutive units.

Definition at line 68 of file seq_masker_window.hpp.

Constructor & Destructor Documentation

◆ CSeqMaskerWindow()

CSeqMaskerWindow::CSeqMaskerWindow ( const objects::CSeqVector &  arg_data,
Uint1  arg_unit_size,
Uint1  arg_window_size,
Uint4  window_step,
Uint1  unit_step = 1,
Uint4  winstart = 0,
Uint4  winend = 0 
)

Object constructor.

Parameters
arg_datathe base sequence
arg_unit_sizethe value of the unit size to use
arg_window_sizethe value of the window size to use
window_stepthe number of bases by which the window advances when operator++() is applied
unit_stepthe number of bases between consequtive units in a window
winstartstart window at this data position
winenddo not advance beyond this data position

Definition at line 49 of file seq_masker_window.cpp.

References data, FillWindow(), LOOKUP, NumUnits(), unit_mask, unit_size, units, window_size, and winend.

◆ ~CSeqMaskerWindow()

CSeqMaskerWindow::~CSeqMaskerWindow ( )
virtual

Object destructor.

Definition at line 88 of file seq_masker_window.cpp.

Member Function Documentation

◆ Advance()

void CSeqMaskerWindow::Advance ( Uint4  step)
virtual

Slide the window by the given number of bases.

Parameters
stepthe number of bases by which the window should slide

Reimplemented in CSeqMaskerWindowPatternAmbig, CSeqMaskerWindowPattern, and CSeqMaskerWindowAmbig.

Definition at line 93 of file seq_masker_window.cpp.

References data, end, FillWindow(), first_unit, letter(), LOOKUP, NumUnits(), start, unit_mask, unit_step, units, window_size, and winend.

Referenced by operator++().

◆ End()

Uint4 CSeqMaskerWindow::End ( void  ) const
inline

Get the current ending position of the window.

Returns
the offset of the end of the window in the sequence

Definition at line 149 of file seq_masker_window.hpp.

References end.

Referenced by CSeqMaskerCacheBoost::Check(), CSeqMasker::DoMask(), and CSeqMasker::mitem::mitem().

◆ FillWindow()

void CSeqMaskerWindow::FillWindow ( Uint4  winstart)
private

Definition at line 131 of file seq_masker_window.cpp.

References data, end, first_unit, letter(), LOOKUP, start, unit_mask, unit_size, unit_step, units, and window_size.

Referenced by Advance(), and CSeqMaskerWindow().

◆ GetUnitSize()

Uint1 CSeqMaskerWindow::GetUnitSize ( ) const
inline

Get the unit size.

Returns
the unit size (1-16)

Definition at line 191 of file seq_masker_window.hpp.

References unit_size.

◆ NumUnits()

Uint1 CSeqMaskerWindow::NumUnits ( ) const
inline

◆ operator bool()

CSeqMaskerWindow::operator bool ( ) const
inline

Check if the end of the sequence has been reached.

Returns
true if not at the end of the sequence; false otherwise

Definition at line 108 of file seq_masker_window.hpp.

References state.

◆ operator++()

void CSeqMaskerWindow::operator++ ( void  )
inline

Advance the window.

The window will slide by the predefined number of bases. If the result contains ambiguities it will slide further by the minimal number of bases such that the resulting window does not have ambiguities.

Definition at line 119 of file seq_masker_window.hpp.

References Advance(), and window_step.

◆ operator[]()

TUnit CSeqMaskerWindow::operator[] ( Uint1  index) const
inline

Access units of the current window by index.

Parameters
indexwhich unit to access
Returns
the value of the requested unit

Definition at line 128 of file seq_masker_window.hpp.

References first_unit, NumUnits(), and units.

◆ Start()

Uint4 CSeqMaskerWindow::Start ( ) const
inline

Get the current starting position of the window.

Returns
the offset of the start of the window in the sequence

Definition at line 141 of file seq_masker_window.hpp.

References start.

Referenced by CSeqMasker::DoMask(), CSeqMaskerScoreMean::FillScores(), CSeqMaskerScoreMean::Init(), CSeqMaskerScoreMean::PostAdvance(), and CSeqMaskerScoreMean::PreAdvance().

◆ Step()

Uint4 CSeqMaskerWindow::Step ( ) const
inline

Get the current value of the window step.

Returns
the least number of bases by which the window slides when operator++() is applied

Definition at line 158 of file seq_masker_window.hpp.

References window_step.

Referenced by CSeqMasker::mitem::mitem().

◆ UnitStep()

Uint1 CSeqMaskerWindow::UnitStep ( ) const
inline

Get the current value of the unit step.

Returns
the distance between any 2 consequtive units within a window

Definition at line 167 of file seq_masker_window.hpp.

References unit_step.

Referenced by CSeqMaskerScoreMean::PostAdvance(), CSeqMaskerScoreMeanGlob::PostAdvance(), and CSeqMaskerScoreMean::PreAdvance().

Member Data Documentation

◆ data

const objects::CSeqVector& CSeqMaskerWindow::data
protected

◆ end

Uint4 CSeqMaskerWindow::end
protected

◆ first_unit

TUnits::size_type CSeqMaskerWindow::first_unit
protected

The position in the array of units of the first unit of the current window.

Definition at line 204 of file seq_masker_window.hpp.

Referenced by Advance(), CSeqMaskerWindowAmbig::Advance(), FillWindow(), CSeqMaskerWindowAmbig::FillWindow(), CSeqMaskerWindowPattern::FillWindow(), CSeqMaskerWindowPatternAmbig::FillWindow(), and operator[]().

◆ LOOKUP

Uint1 CSeqMaskerWindow::LOOKUP
static

Table used to translate bases from iupacna to ncbi2na format.

Definition at line 75 of file seq_masker_window.hpp.

Referenced by Advance(), CSeqMaskerWindowAmbig::Advance(), CSeqMaskerWindow(), FillWindow(), CSeqMaskerWindowAmbig::FillWindow(), and CSeqMaskerWindowPattern::MakeUnit().

◆ start

Uint4 CSeqMaskerWindow::start
protected

◆ state

bool CSeqMaskerWindow::state
protected

true, if the end of the sequence has not been reached.

Definition at line 197 of file seq_masker_window.hpp.

Referenced by operator bool().

◆ unit_mask

TUnit CSeqMaskerWindow::unit_mask
protected

◆ unit_size

Uint1 CSeqMaskerWindow::unit_size
protected

◆ unit_step

Uint1 CSeqMaskerWindow::unit_step
protected

◆ units

TUnits CSeqMaskerWindow::units
protected

◆ window_size

Uint1 CSeqMaskerWindow::window_size
protected

◆ window_step

Uint4 CSeqMaskerWindow::window_step
protected

The amount of bases by which the window advances under operator++()

Definition at line 201 of file seq_masker_window.hpp.

Referenced by CSeqMaskerWindowPattern::FillWindow(), operator++(), and Step().

◆ winend

Uint4 CSeqMaskerWindow::winend
protected

Final position in the sequence.

Definition at line 207 of file seq_masker_window.hpp.

Referenced by Advance(), CSeqMaskerWindow(), and CSeqMaskerWindowPattern::FillWindow().


The documentation for this class was generated from the following files:
Modified on Sat Jun 15 11:49:40 2024 by modify_doxy.py rev. 669887