-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathshow.cpp
112 lines (81 loc) · 2.28 KB
/
show.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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
* show.cpp
* glia
*
* Created by Deniz Kural on 1/1/12.
* Copyright 2012 __MyCompanyName__. All rights reserved.
*
*/
#include "show.h"
using namespace std;
/*
vector<string> parentNames(sn* node) {
vector<string> parentNames;
vector<sn*>::iterator t; // good place for vector iteration?
for (t=node.p5.begin(); t!=node.p5.end(); ++t) {
parent_names.push_back((*t)->name);
}
return parentNames;
}
int displayStrings(vector<string> values) {
vector<sn*>::iterator t; // good place for vector iteration?
for (t=node.p5.begin(); t!=node.p5.end(); ++t) {
parent_names.push_back((*t)->name);
}
*/
int displayNode(sn* node) {
cout << "Node Summary" << endl << "----------" << endl;
cout << "NodeName: " << node->name << endl;
cout << "Sequence: " << node->sequence << endl;
cout << "Depth: " << node->depth << endl;
cout << "Parents: ";
vector<sn*>::iterator t;
for (t = node->p5.begin(); t != node->p5.end(); ++t) {
cout<<(*t)->name<<", ";
}
cout<<endl;
cout << "Children: ";
for (t = node->p3.begin(); t != node->p3.end(); ++t) {
cout<<(*t)->name<<", ";
}
cout<<endl<<endl;
return 0;
}
int displayAlignment(sn* node, string& read) {
vector<vector<ms> >::iterator y;
vector<ms>::iterator x;
cout << "Node: " << node->name << endl << endl;
cout << "Score:"<< endl << "----------" << endl;
cout << "\t\t";
for (string::iterator s = node->sequence.begin(); s != node->sequence.end(); ++s) {
cout << "\t" << *s;
}
cout << endl;
for (y = node->matrix.begin(); y != node->matrix.end(); ++y) {
cout << "\t" << read[y-node->matrix.begin()-1] << "\t";
for (x = (*y).begin(); x != (*y).end(); ++x) {
cout << x->score << "\t";
}
cout << endl;
}
cout << endl;
cout << "Back Trace:" << endl << "----------" << endl;
for (y = node->matrix.begin(); y != node->matrix.end(); ++y) {
cout << "\t";
for (x = (*y).begin(); x != (*y).end(); ++x) {
cout << x->arrow << "\t";
}
cout << endl;
}
cout << endl;
cout << "Parent:" << endl << "----------" << endl;
for (y = node->matrix.begin(); y != node->matrix.end(); ++y) {
cout << "\t";
for (x = (*y).begin(); x != (*y).end(); ++x) {
cout << x->parent->name << "\t";
}
cout << endl;
}
cout << endl;
return 0;
}