-
Notifications
You must be signed in to change notification settings - Fork 10
/
mm.h
58 lines (41 loc) · 1.18 KB
/
mm.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
50
51
52
53
54
55
56
57
58
#ifndef MM_H
#define MM_H
#include <vector>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <dirent.h>
#include <string>
#include <iostream>
#include <fstream>
#include <math.h>
#include <ctype.h>
class mm
{
int verbosity;
std::string modelName;
unsigned int order;
double alpha;
std::vector<unsigned int> lowerOrderCounts,orderCounts;
std::vector<double> pc; // pseudo count probabilities
std::vector<double> p;
void initArrays();
int read(std::string modelFile);
void computeModelProb();
size_t hashKmer(std::string::iterator kmer, unsigned int k);
static std::string mapToAlphabet(std::string seq);
void countKmers(std::string genome);
size_t lastNucl(size_t k);
size_t head(size_t k);
public:
mm(std::string modelFile, int verb);
mm(unsigned int k,double a, int verb);
~mm();
void printParameters();
std::string getName();
int write(std::string modelDir);
int trainOn(std::string genomeFile);
static std::vector<std::string> readGenome(std::string genomeFile);
double evaluate(std::vector<std::string>);
};
#endif // MM_H