source: tags/arb_5.0/AWT/awt_seq_colors.hxx

Last change on this file was 5968, checked in by westram, 15 years ago
  • new flag -w to aisc_mkpt (add include wrapper)
  • uniform style for several include wrappers
  • removed duplicated includes
  • removed useless nt_concatenate.hxx
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1// =========================================================== //
2//                                                             //
3//   File      : awt_seq_colors.hxx                            //
4//   Purpose   :                                               //
5//                                                             //
6//   Institute of Microbiology (Technical University Munich)   //
7//   http://www.arb-home.de/                                   //
8//                                                             //
9// =========================================================== //
10
11#ifndef AWT_SEQ_COLORS_HXX
12#define AWT_SEQ_COLORS_HXX
13
14
15#define AWAR_SEQ_PATH                  "awt/seq_colors/"
16#define AWAR_SEQ_NAME_STRINGS_TEMPLATE AWAR_SEQ_PATH  "strings/elem_%i"
17#define AWAR_SEQ_NAME_TEMPLATE         AWAR_SEQ_PATH  "set_%i/elem_%i"
18#define AWAR_SEQ_NAME_SELECTOR_NA      AWAR_SEQ_PATH   "na/select"
19#define AWAR_SEQ_NAME_SELECTOR_AA      AWAR_SEQ_PATH   "aa/select"
20
21#define AWT_SEQ_COLORS_MAX_SET   5
22#define AWT_SEQ_COLORS_MAX_ELEMS 28 // has to be a even number!
23
24class AWT_seq_colors {
25    int   base_gc;
26    AW_CL cd1;
27    AW_CL cd2;
28    AW_CB callback;
29    int   cbexists;
30
31public:
32    AW_window *aww;
33    GBDATA    *gb_def;
34
35    void       run_cb();
36    void       reload();
37
38    // real public
39    char char_2_gc[256];         // translate to gc
40    char char_2_char[256];       // translate to char
41    char char_2_gc_aa[256];      // translate to gc  - for aminoacid sequence
42    char char_2_char_aa[256];    // translate to char - for aminoacid sequence
43
44    AWT_seq_colors(GBDATA *gb_default, int base_gc,AW_CB cb,AW_CL cd1,AW_CL cd2);
45};
46
47class AWT_reference{
48    GBDATA *gb_main;
49    int     ref_len;
50    char   *reference;
51    char   *init_species_name;
52   
53public:
54    AWT_reference(GBDATA *gb_main);
55    ~AWT_reference();
56
57    void init();
58    void init(const char *species_name, const char *alignment_name);
59    void init(const char *name, const char *sequence_data, int len);
60
61    void expand_to_length(int len);             // make sure that reference is at least len long
62
63    int convert(char c,int pos) const                           { return (c=='-' || c!=reference[pos]) ? c : '.'; }
64    int reference_species_is(const char *species_name) const    { return init_species_name ? strcmp(species_name, init_species_name)==0 : 0; }
65};
66
67AW_window *create_seq_colors_window(AW_root *awr, AWT_seq_colors *asc);
68
69
70#else
71#error awt_seq_colors.hxx included twice
72#endif // AWT_SEQ_COLORS_HXX
Note: See TracBrowser for help on using the repository browser.