forked from PASApipeline/PASApipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLobject.cpp
executable file
·70 lines (51 loc) · 1.43 KB
/
Lobject.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
#include "Lobject.h"
Lobject::Lobject (int index, int num_alignments) {
this->index = index;
this->num_alignments = num_alignments;
LscoreF = 0;
LscoreR = 0;
toLptr = 0;
fromLptr = 0;
// init the containment array:
contained_cdna_indices.resize(num_alignments);
for (int i = 0; i < num_alignments; i++) {
contained_cdna_indices[i] = false;
}
}
void Lobject::setContainedIndices(vector<int> indices) {
num_contained_indices = 0;
for (int i=0; i < indices.size(); i++) {
contained_cdna_indices[indices[i]] = true;
LscoreF++;
LscoreR++;
num_contained_indices++;
}
}
int Lobject::num_unique_contained (Lobject& other) {
int num = 0;
for (int i=0; i < num_alignments; i++) {
if (contained_cdna_indices[i] && ! other.contained_cdna_indices[i]) {
num++;
}
}
return (num);
}
string Lobject::toString () {
ostringstream os;
os << "Lobject index: [" << index << "] has LscoreF: " << LscoreF
<< ", LscoreR: " << LscoreR
<< ", combinedScore: " << combined_score
<< endl << "contains the following alignment indices:" << endl;
for (int i = 0; i < num_alignments; i++) {
if (contained_cdna_indices[i]) {
os << "\tindex: " << index << " contains " << i << endl;
}
}
return (os.str());
}
void Lobject::setTraceIndices(vector<int> traces) {
traceIndices = traces;
}
vector<int> Lobject::getTraceIndices() {
return (traceIndices);
}