-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBBHashKmerContainer.h
executable file
·49 lines (35 loc) · 1.18 KB
/
BBHashKmerContainer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef BBHASHKMERCONTAINER_H
#define BBHASHKMERCONTAINER_H
#include "AbstractKmerContainer.h"
#include "./lib/BBHash/BooPHF.h"
#include "KmerIterator.h"
// from BBhash example
#include <time.h>
#include <sys/types.h>
#include <random>
#include <algorithm>
//tells bbhash to use included hash function working on u_int64_t input keys :
using hasher_t = boomphf::SingleHashFunctor<u_int64_t>;
using boophf_t = boomphf::mphf<u_int64_t, hasher_t>;
template<typename Iter, typename charType>
class BBHashKmerContainer : public AbstractKmerContainer<Iter, charType> {
public:
// default constructor
BBHashKmerContainer();
~BBHashKmerContainer() = default;
// variable constructor
BBHashKmerContainer(int numThreads, double gammaFactor, int numElements, int kmer_size);
bool contains(charType *s); //TODO change to seqan type
void add(charType *s, int length); //TODO change to seqan type
void addRange(Iter &start, Iter &end);
void load(const char *fname);
void save(const char *fname);
private:
int kmers_size;
std::unique_ptr<boophf_t> bphf;
int numThreads;
double gammaFactor;
int numElements;
};
#include "BBHashKmerContainer.cpp"
#endif