1 static char rcsid[] = "$Id: diagnostic.c 40271 2011-05-28 02:29:18Z twu $";
2 #ifdef HAVE_CONFIG_H
3 #include <config.h>
4 #endif
5
6 #include "diagnostic.h"
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include "mem.h"
10
11 #define T Diagnostic_T
12
13 void
Diagnostic_free(T * old)14 Diagnostic_free (T *old) {
15 FREE(*old);
16 return;
17 }
18
19 T
Diagnostic_new()20 Diagnostic_new () {
21 T new = (T) MALLOC(sizeof(*new));
22
23 #ifndef PMAP
24 new->query_oligodepth = 0.0;
25 #endif
26 new->query_badoligos = 0;
27 new->query_trimoligos = 0;
28 new->query_repoligos = 0;
29 new->query_trimoligos = 0;
30 new->query_trim_start = 0;
31 new->query_trim_end = 0;
32
33 new->stage1_runtime = 0.0;
34 new->firstpair_found_5 = 0;
35 new->firstpair_found_3 = 0;
36 new->stutter_searched_5 = 0;
37 new->stutter_searched_3 = 0;
38 new->stutter_nmatchpairs = 0;
39 new->stutter_matches_5 = 0;
40 new->stutter_matches_3 = 0;
41 new->sampling_rounds = 0;
42 new->sampling_nskip = 0;
43 new->ngregions = 0;
44
45 return new;
46 }
47
48 void
Diagnostic_print(T this)49 Diagnostic_print (T this) {
50 if (this != NULL) {
51 #ifndef PMAP
52 printf("Query check oligodepth: %f\n",this->query_oligodepth);
53 #endif
54 printf("Query check badoligos: %d/%d\n",this->query_badoligos,this->query_trimoligos);
55 printf("Query check repoligos: %d/%d\n",this->query_repoligos,this->query_trimoligos);
56 printf("Query check trim bounds: %d..%d\n",this->query_trim_start,this->query_trim_end);
57
58 printf("Stage 1 runtime: %.3f sec\n",this->stage1_runtime);
59 printf("Stage 1 firstpair_found_5: %d\n",this->firstpair_found_5);
60 printf("Stage 1 firstpair_found_3: %d\n",this->firstpair_found_3);
61 printf("Stage 1 stutter_searched_5: %d\n",this->stutter_searched_5);
62 printf("Stage 1 stutter_searched_3: %d\n",this->stutter_searched_3);
63 printf("Stage 1 stutter_matchpairs: %d\n",this->stutter_nmatchpairs);
64 printf("Stage 1 stutter_matches_5: %d\n",this->stutter_matches_5);
65 printf("Stage 1 stutter_matches_3: %d\n",this->stutter_matches_3);
66 printf("Stage 1 sampling rounds: %d\n",this->sampling_rounds);
67 printf("Stage 1 sampling nskip: %d\n",this->sampling_nskip);
68 printf("Stage 1 number gregions: %d\n",this->ngregions);
69 }
70
71 return;
72 }
73
74