Last change
on this file was
6490,
checked in by westram, 15 years ago
|
- moved a few types to arbdb_base.h
- only use arbdb_base.h or arbdb.h where possible
- global included cleanup
- added MBI headers to many files
- moved SQ_ambiguities.SQ_count_ambiguities() to separate object
|
File size:
2.2 KB
|
Line | |
---|
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 | |
---|
16 | void SQ_ambiguities::SQ_count_ambiguities(const char *iupac, int length, |
---|
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 | |
---|
Note: See
TracBrowser
for help on using the repository browser.