A functor to generate a encoded word (serves as a hash entry). More...
#include <ESTCodec.h>
Public Member Functions | |
int | operator() (const int w, const char bp, int &ignoreMask) const |
A functor to generate a encoded word (serves as a hash entry).
This functor must be used to generate an encoded word for a reverse complement (rather than normal) fragment. This method handles 'n' entries in the EST in the following manner:
Whenever it encounters an 'n' base pair (that is created when ESTs are loaded in the class EST.cpp) it sets the ignoreMask to Mask (as Mask template parameter already tells us the number of bits we care about and that is used as an indicator of number hashes to ignore).
The ignoreMask is shifted right dropping off the least significant bits each time this method is called. If all bits of ignoreMask are cleared then the ignore mask is zero and ignored.
If the ignoreMask is non-zero, then the caller is expected not to use the hash returned from this method. as this word/hash contains a 'n'. As bits get shifted the value for 'n' drops off (when the ignoreMask is zero) and the hashes can actually be used by the caller.
Shift | The number of bits by which the encoding for the given base pair must be shifted. Currently this parameter is not used but it is present to provide a symmetric interface with the NormalEncoder. | |
Mask | The mask (with bits set to 1) that must be used to retain the signficiant values in the hash. For example, when using words of length 6, the Mask would be the binary 1111 1111 1111 or 0xfff . |
[in] | w | The current hash value that has been computed thusfar. |
[in] | bp | The base pair ('A', 'T', 'C', 'G', or 'n') to be encoded by this method. |
[in,out] | ignoreMask | The ignore mask that is used to determine if the current hash/word has a 'n' entry in it and must be ignored. |
Definition at line 269 of file ESTCodec.h.
int ESTCodec::RevCompEncoder< Shift, Mask >::operator() | ( | const int | w, | |
const char | bp, | |||
int & | ignoreMask | |||
) | const [inline] |
Definition at line 270 of file ESTCodec.h.
References ESTCodec::encode2rc().