Augustus 3.4.0
Loading...
Searching...
No Matches
contentmodel.hh
1/*
2 * contentmodel.hh
3 *
4 * License: Artistic License, see file LICENSE.TXT or
5 * https://opensource.org/licenses/artistic-license-1.0
6 */
7
8#ifndef __CONTENTMODEL_HH
9#define __CONTENTMODEL_HH
10
11// project includes
12#include "types.hh"
13#include "motif.hh"
14
15// standard C/C++ includes
16#include <string>
17#include <iostream>
18#include <iomanip>
19
20using namespace std;
21
29public:
30 /*
31 * default contructor
32 */
33 ContentModel(){}
34
35 /*
36 * contructor
37 */
38 ContentModel(int k, int f = 1){
39 init(k,f);
40 };
41
42 void init(int k, int f){
43 this->k = k;
44 patprob.assign(f, POWER4TOTHE(k+1));
45 }
46
47 void setRandomPatProbs();
48 string generateRandSeq(int n, int startFrame = 0) const;
49 static int randomIndex(const Double* p, int count);
50 Double seqProbUnderModel(const char *seq, int len, int frame) const;
51 BaseCount getMeanContent();
52 Double getPatProb(int f, int pn) const{ return patprob[f][pn]; }
53// const Double* getPatProb(int f) const {return (*patprob)[f];}
54 vector<Double> copyPatProb(int f) const {return patprob.getRow(f);}
55 void setPatProb(const Matrix<Double>& newpatprob);
56 void setPatProb(int frame, const vector<Double>& newRow);
57// void setPatProbClone(const Matrix<Double>& newpatprob);
58 int getNumFrames() const { return patprob.getColSize(); }
59 int getNumPatterns() const { return patprob.getRowSize(); }
60 void print();
61 static double DiscrimDifference(const ContentModel *a, const ContentModel *b,
62 int n, int fa=0, int fb=0);
63
64private:
65 int k;
66 Matrix<Double> patprob;
67};
68
69
70
71#endif //__CONTENTMODEL_HH
Definition motif.hh:33
Model typical sequences by pattern frequencies.
Definition contentmodel.hh:28
This class implements a double object with a very large range.
Definition lldouble.hh:31
A simple matrix class. Base class for all mathematical matrix objects.
Definition matrix.hh:27