ARB
SQ_ambiguities.cxx
Go to the documentation of this file.
1 // ============================================================= //
2 // //
3 // File : SQ_ambiguities.cxx //
4 // Purpose : //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // ============================================================= //
10 
11 #include "SQ_ambiguities.h"
12 #include <arbdb.h>
13 
14 using namespace std;
15 
17  GBDATA * gb_quality) {
18  char c;
19 
20  for (int i = 0; i < length; i++) {
21  c = iupac[i];
22  switch (c) {
23  case 'R':
24  number++;
25  iupac_value = iupac_value + 2;
26  break;
27  case 'Y':
28  number++;
29  iupac_value = iupac_value + 3;
30  break;
31  case 'M':
32  number++;
33  iupac_value = iupac_value + 2;
34  break;
35  case 'K':
36  number++;
37  iupac_value = iupac_value + 3;
38  break;
39  case 'W':
40  number++;
41  iupac_value = iupac_value + 3;
42  break;
43  case 'S':
44  number++;
45  iupac_value = iupac_value + 2;
46  break;
47  case 'B':
48  number++;
49  iupac_value = iupac_value + 4;
50  break;
51  case 'D':
52  number++;
53  iupac_value = iupac_value + 4;
54  break;
55  case 'H':
56  number++;
57  iupac_value = iupac_value + 4;
58  break;
59  case 'V':
60  number++;
61  iupac_value = iupac_value + 3;
62  break;
63  case 'N':
64  number++;
65  iupac_value = iupac_value + 5;
66  break;
67  }
68  }
69  percent = (100 * number) / length;
70 
71  GBDATA *gb_result1 = GB_search(gb_quality, "iupac_value", GB_INT);
72  seq_assert(gb_result1);
73  GB_write_int(gb_result1, iupac_value);
74 }
75 
Definition: iupac.cxx:21
STL namespace.
void SQ_count_ambiguities(const char *iupac, int length, GBDATA *gb_quality)
#define seq_assert(bed)
GB_ERROR GB_write_int(GBDATA *gbd, long i)
Definition: arbdb.cxx:1220
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
Definition: adquery.cxx:531
size_t length
Definition: arbdb.h:66