source: tags/arb-6.0/AWT/awt_seq_colors.hxx

Last change on this file was 8623, checked in by westram, 12 years ago

merge from e4fix [8376] [8377] [8378] [8379] [8380] [8386] [8387] [8388] [8389]

  • do not save AWARs which have default values
    • motivation: edit4-props saved after [8362] did not load with older versions
    • pros:
      • if the user did not change the default, changing the default in code will propagate to the user
    • cons:
      • AWARs used by multiple applications will trigger in non-saving application, when the database containing the awar is saved
        • only happens once if AWAR was previously stored with default-value
        • the most obvious ones were those edit4-search-strings linked to ntree (primer, probe, gene). disarmed them by setting the default to NULL
  • always generate definitions of SAI color translation tables (since default no longer saved)
    • drawback: when user deletes a default color translation table, it will re-appear after restart
  • allow experts to save fast-aligner protection to properties
  • deliver errors exported by awar callbacks (when triggered by widget change)
  • sequence color mapping
    • translate stored old default ('=0') to new default ('') on awar creation
    • removed code talking to AWARs via ARBDB interface - just use AWARs straightforward
  • ignore request_refresh_for_sequence_terminals when there is no hierarchy yet (now triggered by seq colors)
  • lib/arb_default/edit4.arb
    • removed default values (where code defaulted to same value)
    • changed some defaults
      • aligner (explicit, but empty ref)
      • helix setting (stolen from WL)
  • lib/arb_default/ntree.arb
    • removed all values
      • equal to default value
      • obsolete entries (former awar names)
      • entries that are now stored in main DB
  • removed unused AWARS (AWTC_create_rename_awars)
  • default for AWAR_TREE now "" everywhere
  • removed unused AISC variable
  • renamed edit direction related variables/awars
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 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#ifndef AW_WINDOW_HXX
15#include <aw_window.hxx>
16#endif
17
18#define AWAR_SEQ_PATH                  "awt/seq_colors/"
19#define AWAR_SEQ_NAME_STRINGS_TEMPLATE AWAR_SEQ_PATH  "strings/elem_%i"
20#define AWAR_SEQ_NAME_TEMPLATE         AWAR_SEQ_PATH  "set_%i/elem_%i"
21#define AWAR_SEQ_NAME_SELECTOR_NA      AWAR_SEQ_PATH   "na/select"
22#define AWAR_SEQ_NAME_SELECTOR_AA      AWAR_SEQ_PATH   "aa/select"
23
24class AWT_seq_colors {
25    int base_gc;
26    void (*cb)();
27
28public:
29    void run_cb() const { if (cb) cb(); }
30    void reload();
31
32    // real public
33    char char_2_gc[256];         // translate to gc
34    char char_2_char[256];       // translate to char
35    char char_2_gc_aa[256];      // translate to gc  - for aminoacid sequence
36    char char_2_char_aa[256];    // translate to char - for aminoacid sequence
37
38    AWT_seq_colors(int baseGC, void (*changed_cb)());
39};
40
41class AWT_reference : virtual Noncopyable {
42    GBDATA *gb_main;
43    int     ref_len;
44    char   *reference;
45    char   *init_species_name;
46
47public:
48    AWT_reference(GBDATA *gb_main);
49    ~AWT_reference();
50
51    void init();
52    void init(const char *species_name, const char *alignment_name);
53    void init(const char *name, const char *sequence_data, int len);
54
55    void expand_to_length(int len);             // make sure that reference is at least len long
56
57    int convert(char c, int pos) const                           { return (c=='-' || c!=reference[pos]) ? c : '.'; }
58    int reference_species_is(const char *species_name) const    { return init_species_name ? strcmp(species_name, init_species_name)==0 : 0; }
59};
60
61AW_window *create_seq_colors_window(AW_root *awr, AWT_seq_colors *asc);
62
63
64#else
65#error awt_seq_colors.hxx included twice
66#endif // AWT_SEQ_COLORS_HXX
Note: See TracBrowser for help on using the repository browser.