| 1 |
#include "bio++.H" |
| 2 |
#include "existDB.H" |
| 3 |
#include "positionDB.H" |
| 4 |
|
| 5 |
// Tests a positionDB when using an existDB for masking. |
| 6 |
// |
| 7 |
// existDB can be either include or exclude |
| 8 |
// positionDB can use include, exclude or threshold |
| 9 |
// |
| 10 |
|
| 11 |
int |
| 12 |
main(int argc, char **argv) { |
| 13 |
|
| 14 |
uint64 maxMers = uint64ONE << 25; |
| 15 |
|
| 16 |
for (uint32 merSize=8; merSize<33; merSize++) { |
| 17 |
fprintf(stderr, "Testing "uint64FMT" Mmers at merSize "uint32FMT".\n", maxMers, merSize); |
| 18 |
|
| 19 |
kMerBuilder *K = new kMerBuilder(merSize); |
| 20 |
merStream *T = new merStream(K, "acgcgactcgagctacgagcgatcacgacgactacgagca", 40); |
| 21 |
positionDB *P = new positionDB(T, merSize, 0, 0L, 0L, 0L, 0, 0, false, true); |
| 22 |
|
| 23 |
uint64 p = 0; |
| 24 |
uint64 f = 0; |
| 25 |
|
| 26 |
mt_s *mts = mtInit(3492); |
| 27 |
uint64 msk = uint64MASK(2*merSize); |
| 28 |
uint64 cnt = maxMers; |
| 29 |
|
| 30 |
while (cnt--) { |
| 31 |
if (P->checkREBUILD(mtRandom64(mts) & msk) == false) { |
| 32 |
f++; |
| 33 |
} else { |
| 34 |
p++; |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
if (f) { |
| 39 |
fprintf(stderr, "PASS: "uint64FMT" FAIL: "uint64FMT"\n", p, f); |
| 40 |
exit(1); |
| 41 |
} |
| 42 |
|
| 43 |
free(mts); |
| 44 |
|
| 45 |
delete P; |
| 46 |
delete T; |
| 47 |
} |
| 48 |
|
| 49 |
exit(0); |
| 50 |
} |