Othello
 All Classes Files Functions Variables Macros
ConstantLengthKmerHelper< keyType, valueType > Class Template Reference

IOHelper for Constant-Length Kmers. More...

#include <io_helper.h>

Inheritance diagram for ConstantLengthKmerHelper< keyType, valueType >:
Collaboration diagram for ConstantLengthKmerHelper< keyType, valueType >:

Public Member Functions

 ConstantLengthKmerHelper (uint8_t _kmerlength, uint8_t _splitbit)
 
bool convert (char *s, keyType *k, valueType *v)
 convert a input-style line to key/value pair. More...
 
bool convert (char *s, keyType *k)
 skip the value.
 
void splitgrp (const keyType &key, uint32_t &grp, keyType &keyInGroup)
 split a keyTypeype value into two parts: groupID/keyInGroup by the highest splitbit bits.
 
void combgrp (keyType &key, uint32_t &grp, keyType &keyInGroup)
 combine groupID/keyInGroup to the origional key
 

Public Attributes

uint8_t kmerlength
 Assume all kmers are of the same length.
 
uint8_t splitbit
 group the keys according to the highest bits.
 

Detailed Description

template<typename keyType, typename valueType>
class ConstantLengthKmerHelper< keyType, valueType >

IOHelper for Constant-Length Kmers.

Note
Each Kmer is a string of length KMERLENGTH,
We consider string as a base-4 number. [A=0,C=1,G=2,T=3].
Kmers are grouped according to the highest splitbit bits.

Member Function Documentation

template<typename keyType, typename valueType>
bool ConstantLengthKmerHelper< keyType, valueType >::convert ( char *  s,
keyType *  T,
valueType *  V 
)
inlinevirtual

convert a input-style line to key/value pair.

Parameters
[in]char*s, a line from the input.
[out]keyType*T, converted key.
[out]valueType*V, converted value.
Return values
booleanreturn true if convert is success.

Implements IOHelper< keyType, valueType >.


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