-
Notifications
You must be signed in to change notification settings - Fork 1
/
Parser.h
84 lines (74 loc) · 1.94 KB
/
Parser.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef PARSER_H
#define PARSER_H
#include "Alignment.h"
#include "ScoreMatrix.h"
#include "Kernel.h"
#include <string>
#define READ_SUCCESS 0
#define OPEN_FAIL 1
#define FORMAT_FAIL 2
#define NO_MORE_ALIGNMENTS 3
#define COMPLETE_MATCH 1;
#define GOOD_MATCH 0.5;
#define BAD_MATCH 0;
#define GAP -0.5;
using namespace std;
/// Class for parsing the whole file
class Parser {
public:
Parser();
/**
* Parse the alignment file, save the output into output stream.
* @param inputFile Name of the alignment file
* @param outputFile Name of the gff output file
*/
int parse(string inputFile, string outputFile);
/**
* Set how scores from left and right intron boundary are combined
*/
void setScoringCombination(int combination);
/**
* Set window length in the scoring function
*/
void setWindowLegth(int length);
/**
* Print all splice sites during parsing
*/
void printAllSites();
/**
* Print only canonical splice sites during parsing
*/
void printCanonicalsites();
/**
* Assign scoring matrix to the parser
*/
void setScoringMatrix(const ScoreMatrix * scoreMatrix);
/**
* Set which kernel will be used for scoring
*/
void setKernel(Kernel * kernel);
static const int BOUNDARIES_SUMMED = 1;
static const int BOUNDARIES_MULTIPLIED = 2;
private:
/**
* Parse next alignment in the input file.
* The alignment is stored in the "alignment" class variable
*/
int parseNext();
/**
* Return maximum possible score for an intron, depending on whether
* a scoring matrix is used
* @return
*/
double maxScore();
Alignment alignment;
int scoreCombination;
int windowLength;
bool printAll;
const ScoreMatrix * scoreMatrix;
Kernel * kernel;
ifstream inputStream;
static const char PAIR_SEPARATOR[];
static const int NUM_SEPARATORS = 3;
};
#endif /* PARSER_H */