File: MatchPos.cpp

package info (click to toggle)
pbseqlib 0~20161219-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,924 kB
  • ctags: 5,123
  • sloc: cpp: 82,727; makefile: 305; python: 239; sh: 8
file content (59 lines) | stat: -rw-r--r-- 1,120 bytes parent folder | download | duplicates (4)
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
#include "MatchPos.hpp"


MatchPos::MatchPos(const MatchPos &rhs) {
    (*this) = rhs;
}

int MatchPos::GetMultiplicity() const {
    return m;
}

MatchWeight MatchPos::GetWeight() const {
    if (m > 0) {
        return (1.0*l)/m;
    } else {
        return 0;
    }
}

UInt MatchPos::GetT() {
    return t;
}

UInt MatchPos::GetQ() {
    return (UInt) q;
}

UInt MatchPos::GetW() {
    return w;
}

std::ostream& operator<<(std::ostream & out, MatchPos &p) {
    out << p.q << "\t" << p.t <<"\t"<< p.l << "\t"<< p.m;
    return out;
}


ChainedMatchPos::ChainedMatchPos(DNALength pt, DNALength pq, DNALength pl, int pm) : MatchPos(pt, pq, pl, pm) {
    score = 0; 
    chainPrev = NULL;
}

ChainedMatchPos::ChainedMatchPos() : MatchPos() {
    score = 0;
    chainPrev = NULL;
}

int ChainedMatchPos::SetScore(int _score) {
    return (score = _score);
}

ChainedMatchPos* ChainedMatchPos::SetChainPrev(ChainedMatchPos *_chainPrev) {
    return (chainPrev = _chainPrev);
}

std::ostream& operator<<(std::ostream & out, ChainedMatchPos &p) {
    out << p.q << "\t" << p.t <<"\t"<< p.l << "\t"<< p.m;
    return out;
}