gatb.core-API-1.4.2
BloomBuilder< span > Class Template Reference

Helper that builds a Bloom filter from an iterator of kmers. More...

#include <BloomBuilder.hpp>

Public Types

typedef Kmer< span >::Type Type
 

Public Member Functions

 BloomBuilder (u_int64_t bloomSize, size_t nbHash, size_t ksize, tools::misc::BloomKind bloomKind=tools::misc::BLOOM_DEFAULT, size_t nbCores=0, int min_abundance=0)
 
tools::collections::impl::IBloom< Type > * build (tools::dp::Iterator< Count > *itKmers, tools::misc::IProperties *stats=0)
 
tools::collections::impl::IBloom< Type > * load (tools::collections::Iterable< tools::math::NativeInt8 > *bloomIterable, tools::misc::IProperties *stats=0)
 

Detailed Description

template<size_t span = KMER_DEFAULT_SPAN>
class gatb::core::kmer::impl::BloomBuilder< span >

Helper that builds a Bloom filter from an iterator of kmers.

This class encapsulates the creation of a Bloom filter from a set of kmers. Such a set can be provided as an Iterator of Count objects, which likely should have been generated by DSK.

Once the IBloom instance has been instantiated, the Count iterator is iterated and each item is inserted into the Bloom filter.

Several parameters allows to configure the Bloom filter creation.

This class also provides a load method that builds a Bloom filter by reading the raw bitset as an Iterable of NativeInt8 objects.

This class has a 'span' template which determines which implementation of Type has to be used.

Member Typedef Documentation

typedef Kmer<span>::Type Type

Shortcuts.

Constructor & Destructor Documentation

BloomBuilder ( u_int64_t  bloomSize,
size_t  nbHash,
size_t  ksize,
tools::misc::BloomKind  bloomKind = tools::misc::BLOOM_DEFAULT,
size_t  nbCores = 0,
int  min_abundance = 0 
)
inline

Constructor.

Parameters
[in]bloomSize: the size (in bits) of the Bloom filter to be created
[in]nbHash: number of hash functions of the Bloom filter.
[in]ksize: the kmer size is needed
[in]bloomKind: kind of Bloom filter to be created
[in]nbCores: number of cores to be used for the iteration of items to be inserted
[in]min_abundance: if >0, only kmers having abundance greater than that threshold are inserted into the Bloom filter. otherwise all items are inserted.

Member Function Documentation

tools::collections::impl::IBloom<Type>* build ( tools::dp::Iterator< Count > *  itKmers,
tools::misc::IProperties stats = 0 
)
inline

Create a Bloom filter and fill it with the provided kmers iterator.

Parameters
[in]itKmers: an iterator over the kmers to be inserted; more precisely, we iterate couples [kmers,abundance]
[in]stats: properties object to be filled by statistics gathered during the build.
Returns
the IBloom instance.
tools::collections::impl::IBloom<Type>* load ( tools::collections::Iterable< tools::math::NativeInt8 > *  bloomIterable,
tools::misc::IProperties stats = 0 
)
inline

Load a Bloom filter from a binary stream provided as an Iterable of NativeInt8

Parameters
[in]bloomIterable: binary stream holding the bitset of the Bloom filter
[in]stats: properties object to be filled by statistics gathered during the build.

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