NCBI C++ ToolKit
Static Public Member Functions | List of all members
CSeqMaskerUtil Class Reference

Search Toolkit Book for CSeqMaskerUtil

Collection of various support utilities. More...

#include <algo/winmask/seq_masker_util.hpp>

Static Public Member Functions

static Uint1 BitCount (Uint4 mask, Uint1 bit_value=1)
 Count the bits with given value in a given bit pattern. More...
 
static Uint4 reverse_complement (Uint4 seq, Uint1 size)
 Reverse complement of a unit. More...
 
static pair< Uint4, Uint1hash_code (Uint4 unit, Uint1 k, Uint1 roff)
 Compute a hash code of a unit. More...
 

Detailed Description

Collection of various support utilities.

This class is used as a namespace for different utility functions that can be used by other winmasker classes.

Definition at line 48 of file seq_masker_util.hpp.

Member Function Documentation

◆ BitCount()

Uint1 CSeqMaskerUtil::BitCount ( Uint4  mask,
Uint1  bit_value = 1 
)
static

Count the bits with given value in a given bit pattern.

Parameters
maskthe bit pattern
bit_valueif 0 then 0-bits will be counted; otherwise 1-bits will be counted
Returns
the bit count

Definition at line 39 of file seq_masker_util.cpp.

References i, mask, and result.

Referenced by CSeqMaskerWindowPattern::CSeqMaskerWindowPattern(), and CSeqMasker::DoMask().

◆ hash_code()

static pair< Uint4, Uint1 > CSeqMaskerUtil::hash_code ( Uint4  unit,
Uint1  k,
Uint1  roff 
)
inlinestatic

Compute a hash code of a unit.

Parameters
unitthe target unit
klength (int bits) of the hash key
roffoffset in bits from the right end of the unit
Returns
the hash code and concatenation of high and low remaining bits

Definition at line 81 of file seq_masker_util.hpp.

Referenced by CSeqMaskerOstatOpt::doFinalize(), CSeqMaskerOstatOpt::findBestRoff(), and CSeqMaskerUsetHash::get_info().

◆ reverse_complement()

Uint4 CSeqMaskerUtil::reverse_complement ( Uint4  seq,
Uint1  size 
)
static

Reverse complement of a unit.

Parameters
seqthe unit
sizethe unit length
Returns
the reverse complement of seq

Definition at line 54 of file seq_masker_util.cpp.

References i, letter(), result, and ncbi::grid::netcache::search::fields::size.

Referenced by CSeqMaskerOstatOpt::createCacheBitArray(), CSeqMaskerUsetArray::get_info(), CSeqMaskerUsetHash::get_info(), CSeqMaskerUsetSimple::get_info(), CWinMaskCountsConverter::operator()(), and reverse_complement().


The documentation for this class was generated from the following files:
Modified on Tue May 21 10:55:27 2024 by modify_doxy.py rev. 669887