-
Notifications
You must be signed in to change notification settings - Fork 10
/
gliamodels.h
93 lines (75 loc) · 1.54 KB
/
gliamodels.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
85
86
87
88
89
90
91
92
93
/*
* gliamodels.h
* glia
*
* Created by Deniz Kural.
* Copyright 2010-2012 Deniz Kural. All rights reserved.
*
*/
#ifndef GLIAMODELS_H
#define GLIAMODELS_H
#include <iostream>
#include <vector>
#include <string>
#include <iostream>
#include "cigar.h"
#include "gssw.h"
// forward declaration of structures
struct ms;
struct ts;
struct sn;
// ts := top score data structure, 3-tuplet of int
// keeps track of matrix node with highest score
struct ts {
int score;
int x;
int y;
ts() : score(0),
x(0),
y(0) { }
};
// ms := matrix score structure
struct ms {
int score;
char arrow;
sn* parent;
ms() : score(0),
arrow(0),
parent(NULL) { }
};
// sn := string-node data structure
struct sn {
std::string sequence;
std::string name;
std::vector<sn*> p5;
std::vector<sn*> p3;
int seq_len;
ts top_score;
std::vector<std::vector<ms> > matrix;
int depth;
// for mapping back into reference coordinates
long int position;
Cigar cigar;
bool isref;
gssw_node* node;
// initialization
sn() : seq_len(0),
depth(-1) { }
sn(std::string s,
std::string n,
long int p,
Cigar c)
: depth(-1)
, sequence(s)
, name(n)
, position(p)
, cigar(c) {
seq_len = sequence.size();
isref = cigar.isReference(); // if in reference coordinates
}
void initScore(size_t read_length);
};
std::ostream& operator<<(std::ostream& o, const sn* s);
std::ostream& operator<<(std::ostream& o, const ts& t);
int displayDAG(const sn* s);
#endif