-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtraceback.h
74 lines (60 loc) · 1.62 KB
/
traceback.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
/*
* traceback.h
* glia
*
* Created by Deniz Kural on 12/26/11.
* Copyright 2011 __MyCompanyName__. All rights reserved.
*
*/
#ifndef TRACEBACK_H
#define TRACEBACK_H
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <sstream>
#include "gliamodels.h"
#include "nodealign.h"
#include "cigar.h"
#include "utility.h"
// bt := backtrace return object
struct bt {
int x;
int y;
std::string backstr;
Cigar cigar;
sn* node;
bt() : node(NULL) { }
};
// mbt := data structure for trace report
struct mbt {
int x;
int y;
std::string gcigar; // graph cigar
Cigar fcigar; // flattened to reference
std::vector<sn*> node_list;
std::string node_name;
sn* node; // start node
// when flattening, we might want to pull in sequence from
// nodes which are only partly overlapped, and then append it
// to our alignments. these hold such sequence when it exists.
std::string read; // modified, possibly flattened read
std::string qualities; // modified, possibly flattened quality bases
};
// recursive backtrack
bt graphbacktrack(sn* node,
int x, int y,
std::vector<bt>& trace,
std::string& backstr,
std::vector<sn*> &node_list);
bt flatbacktrack(sn* node,
int x, int y,
std::vector<bt>& trace,
Cigar& cigar,
std::vector<sn*> &node_list,
mbt& trace_report);
// mbt := data structure for trace report
struct mbt;
// master backtrack
bt master_backtrack(sn* node, mbt &trace_report, std::string& read, std::string& qualities);
#endif