Debian Codegraph @

seagen/test/encodedQueryTest.C

raw
1 #include "bio++.H"
2 #include "encodedQuery.H"
3
4 int
5 main(int argc, char **argv) {
6
7 if (argc == 1) {
8 mt_s *mt = mtInit(time(0L));
9
10 fprintf(stderr, "Building random sequences for testing.\n");
11
12 for (uint32 i=0; i<100000; i++) {
13 char *seq = new char [10000];
14 char *hdr = new char [128];
15
16 for (uint32 j=0; j<10000; j++) {
17 seq[j] = decompressSymbol[mtRandom32(mt) % 4];
18 if (mtRandomRealOpen(mt) < 0.01)
19 seq[j] = 'n';
20 }
21 seq[9999] = 0;
22
23 sprintf(hdr, ">"uint32FMT, i);
24
25 seqInCore *S = new seqInCore(i, hdr, strlen(hdr), seq, 9999);
26 encodedQuery *Q = new encodedQuery(S, 22);
27 Q->test(S);
28 delete Q;
29 delete S;
30 }
31
32 } else {
33 seqCache *F = new seqCache(argv[1]);
34
35 while (F->eof() == false) {
36 seqInCore *S = F->getSequenceInCore();
37 encodedQuery *Q = new encodedQuery(S, 22);
38 Q->test(S);
39 delete Q;
40 delete S;
41 }
42
43 delete F;
44 }
45
46
47 exit(0);
48 }