Store refID/position, but does not store values < 0.
More...
#include <PosList.h>
|
| PosList () |
| Constructor. More...
|
|
| PosList (int numRefs, int numPositions) |
| Reserves space for numRefs reference ids and numPositions for each id. More...
|
|
virtual | ~PosList () |
| Destructor. More...
|
|
void | addPosition (int refID, int refPosition) |
| Add the specified reference id/position (negative values will not be added). More...
|
|
bool | hasPosition (int refID, int refPosition) |
| Return whether or not this list contains the specified reference ID and position (negative values will automatically return false). More...
|
|
Store refID/position, but does not store values < 0.
Definition at line 24 of file PosList.h.
◆ PosList() [1/2]
Constructor.
Definition at line 21 of file PosList.cpp.
22 : myNumRefs(24),
23 myNumPos(100)
24{
25 initVars();
26}
◆ PosList() [2/2]
PosList::PosList |
( |
int |
numRefs, |
|
|
int |
numPositions |
|
) |
| |
Reserves space for numRefs reference ids and numPositions for each id.
Definition at line 29 of file PosList.cpp.
30 : myNumRefs(numRefs),
31 myNumPos(numPositions)
32{
33 initVars();
34}
◆ ~PosList()
Destructor.
Definition at line 36 of file PosList.cpp.
37{
38 myPosList.clear();
39}
◆ addPosition()
void PosList::addPosition |
( |
int |
refID, |
|
|
int |
refPosition |
|
) |
| |
Add the specified reference id/position (negative values will not be added).
Definition at line 42 of file PosList.cpp.
43{
44
45 if((refID < 0) || (refPosition < 0))
46 {
47 return;
48 }
49
50
51
52 if(myPosList.size() <= (unsigned int)refID)
53 {
54
55
56 myPosList.resize(refID+1, std::vector<bool>(myNumPos, false));
57 myNumRefs = refID + 1;
58 }
59
60
61
62 if((myPosList[refID]).size() <= (unsigned int)refPosition)
63 {
64
65
66 if(myNumPos <= refPosition)
67 {
68
69
70
71 myNumPos = refPosition + 1;
72 }
73
74 (myPosList[refID]).resize(myNumPos, false);
75 }
76
77
78 myPosList[refID][refPosition] = true;
79}
◆ hasPosition()
bool PosList::hasPosition |
( |
int |
refID, |
|
|
int |
refPosition |
|
) |
| |
Return whether or not this list contains the specified reference ID and position (negative values will automatically return false).
Definition at line 81 of file PosList.cpp.
82{
83
84 if((refID < 0) || (refPosition < 0))
85 {
86 return(false);
87 }
88 bool found = false;
89 try
90 {
91 if((myPosList.at(refID)).at(refPosition))
92 {
93 found = true;
94 }
95 }
96 catch (std::out_of_range& oor)
97 {
98
99
100 }
101 return(found);
102}
Referenced by Pileup< PILEUP_TYPE, FUNC_CLASS >::processAlignmentRegion().
◆ initVars()
void PosList::initVars |
( |
| ) |
|
|
protected |
Definition at line 105 of file PosList.cpp.
106{
107 myPosList.clear();
108 myPosList.resize(myNumRefs, std::vector<bool>(myNumPos, false));
109}
◆ myNumPos
◆ myNumRefs
◆ myPosList
std::vector< std::vector<bool> > PosList::myPosList |
|
protected |
The documentation for this class was generated from the following files: