-
Notifications
You must be signed in to change notification settings - Fork 0
/
pivot.h
81 lines (66 loc) · 2.1 KB
/
pivot.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
75
76
77
78
79
80
81
/*
* pivot.h
*
* Written by Conrad Shyu (conradshyu at hotmail.com)
*
* Center for the Study of Biological Complexity (CSBC)
* Department of Microbiology and Immunology
* Medical College of Virginia
* Virginia Commonwealth University
* Richmond, VA 23298
*
* revised on April 16, 2013
*/
#ifndef _PIVOT_H
#define _PIVOT_H
#include <vector>
struct stPIVOT
{
stPIVOT()
{
site.clear();
} // default constructor
stPIVOT( const stPIVOT& _t )
{
*this = _t;
} // copy constructor
~stPIVOT()
{
site.clear();
} // default destructor; environmentally conscientious
const stPIVOT& operator=( const stPIVOT& _t )
{
phred = _t.phred; // read quality
ratio = _t.ratio; // percent identity
gap = _t.gap; // number of gaps
tid = _t.tid;
odd = _t.odd; // number of mismatches
score = _t.score; // alignment score
length = _t.length; // alignment length
site = _t.site; // invoke copy constructor
return( *this );
} // operator overloading
const stPIVOT& operator+=( const stPIVOT& _t )
{
phred += _t.phred; // read quality
ratio += _t.ratio; // percent identity
gap += _t.gap; // number of gaps
odd += _t.odd; // number of mismatches
score += _t.score; // alignment score
length += _t.length; // alignment length
for ( unsigned int i = 0; i < _t.site.size(); ++i )
{
site.push_back( _t.site[ i ] );
} // accumulate the binding sites
return( *this );
} // operator overloading
double phred; // read quality
double ratio; // percent identity
unsigned int tid; // ncbi tid
unsigned int gap; // number of gaps
unsigned int odd; // number of mismatches
unsigned int score; // alignment score
unsigned int length; // alignment length
std::vector<unsigned int> site;
}; // smart container implementation
#endif // _PIVOT_H