gatb.core-API-1.4.2
CounterBuilder Class Reference

Class that counts the number of occurrences of a kmer in several banks. More...

#include <PartitionsCommand.hpp>

Public Member Functions

 CounterBuilder (size_t nbBanks=1)
 
size_t size () const
 
void init (size_t idxBank=0)
 
void increase (size_t idxBank=0)
 
void set (CountNumber val, size_t idxBank=0)
 
CountNumber operator[] (size_t idxBank) const
 

Detailed Description

Class that counts the number of occurrences of a kmer in several banks.

This class manages a vector of occurrences for a kmer, each index of the vector holding the occurrences number for a bank.

It is used during the process of kmers counting and eases the work for counting kmers per bank.

Constructor & Destructor Documentation

CounterBuilder ( size_t  nbBanks = 1)
inline

Constructor.

Parameters
[in]nbBanks: number of banks parsed during kmer counting.

Member Function Documentation

void increase ( size_t  idxBank = 0)
inline

Increase the abundance of the current kmer for the provided bank index.

Parameters
[in]idxBank: index of the bank
void init ( size_t  idxBank = 0)
inline

Initialization of the counting for the current kmer. This method should be called when a kmer is seen for the first time.

Parameters
[in]idxBank: bank index where the new current kmer has been found.
CountNumber operator[] ( size_t  idxBank) const
inline

Get the abundance of the current kmer for the provided bank index.

Parameters
[in]idxBank: index of the bank
Returns
the abundance of the current kmer for the given bank.
void set ( CountNumber  val,
size_t  idxBank = 0 
)
inline

Set the abundance of the current kmer for the provided bank index.

Parameters
[in]idxBank: index of the bank
size_t size ( ) const
inline

Get the number of banks.

Returns
the number of banks.

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