-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathgliamodels.cpp
56 lines (50 loc) · 1.41 KB
/
gliamodels.cpp
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
/*
* gliamodels.cpp
* glia
*
* Created by Deniz Kural on 12/26/11.
* Copyright 2011 __MyCompanyName__. All rights reserved.
*
*/
#include "gliamodels.h"
std::ostream& operator<<(std::ostream& o, const sn* s) {
if (s) {
o << (void*)s << ";"
<< s->name << ","
<< s->position << ","
<< s->cigar << ":"
<< s->sequence << ";"
<< s->top_score << ";"
<< s->depth << ";";
o << "p5:";
for (std::vector<sn*>::const_iterator n = s->p5.begin(); n != s->p5.end(); ++n) {
o << (*n)->name << (n+1 == s->p5.end() ? "" : ",");
}
o << ";";
o << "p3:";
for (std::vector<sn*>::const_iterator n = s->p3.begin(); n != s->p3.end(); ++n) {
o << (*n)->name << (n+1 == s->p3.end() ? "" : ",");
}
}
return o;
}
std::ostream& operator<<(std::ostream& o, const ts& t) {
o << t.score << ";" << t.x << "," << t.y;
return o;
}
std::ostream& operator<<(std::ostream& o, const ms& m) {
o << m.score << ";" << m.arrow << "," << m.parent;
return o;
}
void sn::initScore(size_t read_length) {
ms o;
o.parent = this;
matrix.clear();
matrix.resize(read_length+1, std::vector<ms>(seq_len+1, o));
}
int displayDAG(const sn* s) {
std::cout << s << std::endl;
for (std::vector<sn*>::const_iterator n = s->p3.begin(); n != s->p3.end(); ++n) {
displayDAG(*n);
}
}