]> git.donarmstrong.com Git - mothur.git/blob - uchime_src/chime.h
changes while testing
[mothur.git] / uchime_src / chime.h
1 #ifndef chime_h\r
2 #define chime_h\r
3 \r
4 #include "seq.h"\r
5 \r
6 struct ChimeHit2\r
7         {\r
8         string QLabel;\r
9         string ALabel;\r
10         string BLabel;\r
11         string Q3;\r
12         string A3;\r
13         string B3;\r
14 \r
15         //unsigned LY, LN, LA, LD;\r
16         //unsigned RY, RN, RA, RD;\r
17         double PctIdQT, PctIdQA, PctIdQB, PctIdQM, PctIdAB;\r
18 \r
19         unsigned ColLo;\r
20         unsigned ColXLo;\r
21         unsigned ColXHi;\r
22         unsigned ColHi;\r
23         unsigned QXLo;\r
24         unsigned QXHi;\r
25 \r
26         double Div;\r
27         double Score;\r
28         double H;\r
29 \r
30         unsigned CS_LY, CS_LN, CS_LA, CS_RY, CS_RN, CS_RA;\r
31 \r
32         float AbQ;\r
33         float AbA;\r
34         float AbB;\r
35 \r
36         ChimeHit2()\r
37                 {\r
38                 Clear();\r
39                 }\r
40 \r
41         void Clear()\r
42                 {\r
43                 Q3.clear();\r
44                 A3.clear();\r
45                 B3.clear();\r
46                 QLabel.clear();\r
47                 ALabel.clear();\r
48                 BLabel.clear();\r
49 \r
50                 //LY = LN = LA = LD = UINT_MAX;\r
51                 //RY = RN = RA = RD = UINT_MAX;\r
52                 ColLo = ColHi = QXLo = QXHi = ColXLo = ColXHi = UINT_MAX;\r
53                 CS_LY = CS_LN = CS_LA = CS_RY = CS_RN = CS_RA = UINT_MAX;\r
54                 PctIdQT = PctIdQA = PctIdQB = PctIdQM = PctIdAB = -1.0;\r
55                 Div = -1.0;\r
56                 H = -1.0;\r
57                 Score = -1.0;\r
58                 AbQ = AbA = AbB = -1.0f;\r
59                 };\r
60 \r
61         bool Accept() const\r
62                 {\r
63                 return Score >= opt_minh && Div >= opt_mindiv && CS_LY >= opt_mindiffs && CS_RY >= opt_mindiffs;\r
64                 }\r
65 \r
66         void LogMe() const\r
67                 {\r
68                 Log("@L %c ", yon(Score >= 1.0 && Div >= 1.0));\r
69                 Log(" %.4f", Score);\r
70                 Log(" LY %u LN %u LA %u", CS_LY, CS_LN, CS_LA);\r
71                 Log(" RY %u RN %u RA %u", CS_RY, CS_RN, CS_RA);\r
72                 Log(" Div %.1f%%", Div);\r
73                 Log(" Q=%s", QLabel.c_str());\r
74                 Log(" A=%s", ALabel.c_str());\r
75                 Log(" B=%s", BLabel.c_str());\r
76                 Log(" QA %.1f%% QB=%.1f%% AB=%.1f%% QM=%.1f%%", PctIdQA, PctIdQB, PctIdAB, PctIdQM);\r
77                 Log("\n");\r
78                 }\r
79 \r
80         bool operator<(const ChimeHit2 &rhs) const\r
81                 {\r
82                 if (Score == rhs.Score)\r
83                         return Div > rhs.Div;\r
84                 return Score > rhs.Score;\r
85                 }\r
86         };\r
87 \r
88 static inline bool isacgt(char c)\r
89         {\r
90         return c == 'A' || c == 'C' || c == 'G' || c == 'T';\r
91         }\r
92 \r
93 static bool inline isgap(char c)\r
94         {\r
95         return c == '-' || c == '.';\r
96         }\r
97 \r
98 void GetChunkInfo(unsigned L, unsigned &Length, vector<unsigned> &Los);\r
99 float GetAbFromLabel(const string &Label);\r
100 void WriteChimeHitCS(FILE *f, const ChimeHit2 &Hit);\r
101 void WriteChimeHit(FILE *f, const ChimeHit2 &Hit);\r
102 void WriteChimeFileHdr(FILE *f);\r
103 \r
104 #endif // chime_h\r