- Timestamp:
- 04/02/12 15:16:30 (4 months ago)
- Location:
- branches/e4fix
- Files:
-
- 4 modified
-
AWT/AWT_seq_colors.cxx (modified) (9 diffs)
-
AWT/awt_seq_colors.hxx (modified) (1 diff)
-
EDIT4/ED4_root.cxx (modified) (1 diff)
-
HELP_SOURCE/oldhelp/sequence_colors.hlp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/e4fix/AWT/AWT_seq_colors.cxx
r8136 r8362 22 22 static int default_AMI_set = 3; // number of default amino acid set 23 23 24 static const char *default_sets[AWT_SEQ_COLORS_MAX_SET] = { 25 // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z * - 24 #define SEQ_COLOR_SETS 8 25 #define SEQ_COLOR_SET_ELEMS 28 // has to be a even number! 26 27 static const char *default_sets[SEQ_COLOR_SETS] = { 28 //A B C D E F G H I J K L M N O P Q R S T U V W X Y Z * - 26 29 "=2=0=3=0=0=0=4=0=0=0=0=0=0=6=0=0=0=0=0=5=5=0=0=0=0=0=0=6", // A, C, G, TU and N in 5 colors 27 30 "R2=0Y3=0=0=0R2=0=0=0=0=0=0=0=0=0=0=2=0Y3Y3=0=0=0=3=0=0=6", // AG and CTU in 2 colors 28 31 "=0=5=0=5=7=7=0=5=7=7=3=7=3=9=7=7=7=3=3=0=0=5=3=7=3=7=0=6", // ambiguity 29 32 "=7=0=7=8=2=9=8=9=3=0=2=3=7=8=0=8=2=2=2=2=0=3=9=6=9=0=0=6", // Protein colors 33 34 "=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=6", 35 "o9=0|2=0=0=0o5=0=0=0=0=0=0=0=0=0=0=0=0|8|8=0=0=0=0=0=0=6", // ambiguity (symbols) 36 "=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=6", 30 37 "=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=0=6", 31 38 }; … … 53 60 return result; 54 61 } 55 static const char *default_color(int set, int elem) {62 static const char *default_color(int cset, int elem) { 56 63 // returns default color numbers for seq-color-set 57 64 static char result[3] = "=0"; 58 const char *pos = default_sets[ set]+2*elem;65 const char *pos = default_sets[cset]+2*elem; 59 66 60 67 result[0] = pos[0]; 61 68 result[1] = pos[1]; 69 70 if (result[0] == '=' && result[1] == '0') result[0] = 0; 62 71 63 72 return result; … … 75 84 awr->awar_int(AWAR_SEQ_NAME_SELECTOR_AA, default_AMI_set, AW_ROOT_DEFAULT)->add_callback((AW_RCB)awt_awar_changed_cb, (AW_CL)asc, 0); 76 85 77 for (int elem = 0; elem< AWT_SEQ_COLORS_MAX_ELEMS; ++elem) {86 for (int elem = 0; elem<SEQ_COLOR_SET_ELEMS; ++elem) { 78 87 const char *awar_name = GBS_global_string(AWAR_SEQ_NAME_STRINGS_TEMPLATE, elem); 79 88 awr->awar_string(awar_name, default_characters(elem)); 80 89 81 for (int set = 0; set<AWT_SEQ_COLORS_MAX_SET; ++set) {82 awar_name = GBS_global_string(AWAR_SEQ_NAME_TEMPLATE, set, elem);83 awr->awar_string(awar_name, default_color( set, elem));90 for (int cset = 0; cset<SEQ_COLOR_SETS; ++cset) { 91 awar_name = GBS_global_string(AWAR_SEQ_NAME_TEMPLATE, cset, elem); 92 awr->awar_string(awar_name, default_color(cset, elem)); 84 93 } 85 94 } … … 96 105 97 106 aws = new AW_window_simple; 98 aws->init(awr, "SEQUENCE_ COLOR_MAPPING", "SEQUENCE COLORS");99 100 aws->at (10, 10);107 aws->init(awr, "SEQUENCE_MAPPING", "Sequence color mapping"); 108 109 aws->at(10, 10); 101 110 aws->auto_space(0, 3); 102 111 103 aws->callback (AW_POPDOWN); aws->create_button("CLOSE", "CLOSE", "C"); 104 aws->callback (AW_POPUP_HELP, (AW_CL)"sequence_colors.hlp"); aws->create_button("HELP", "HELP"); 112 aws->callback(AW_POPDOWN); 113 aws->create_button("CLOSE", "CLOSE", "C"); 114 115 aws->callback(AW_POPUP_HELP, (AW_CL)"sequence_colors.hlp"); 116 aws->create_button("HELP", "HELP"); 117 105 118 aws->at_newline(); 106 107 int set;108 119 109 120 for (int seqType=0; seqType<2; seqType++) { 110 121 if (seqType==0) { 111 aws->label("Select Colors For Nucleotides (NA):");122 aws->label("Select color-set for Nucleotides (NA):"); 112 123 aws->create_toggle_field(AWAR_SEQ_NAME_SELECTOR_NA, 1); 113 124 } 114 125 else { 115 aws->label("Select Colors For Amino Acids (AA):");126 aws->label("Select color-set for Amino Acids (AA):"); 116 127 aws->create_toggle_field(AWAR_SEQ_NAME_SELECTOR_AA, 1); 117 128 } 118 129 119 for ( set = 0; set < AWT_SEQ_COLORS_MAX_SET;set++) {120 sprintf(buf, " S_%i", set);121 aws->insert_toggle(buf, " ", set);130 for (int cset = 0; cset < SEQ_COLOR_SETS; cset++) { 131 sprintf(buf, "%i", cset+1); 132 aws->insert_toggle(buf, " ", cset); 122 133 } 123 134 aws->update_toggle_field(); … … 125 136 } 126 137 127 aws->label_length(6); 128 aws->button_length(6); 129 130 for (int big_columns = 0; big_columns <= 1; ++big_columns) { 131 aws->create_button(0, "Char"); 132 for (set = 0; set < AWT_SEQ_COLORS_MAX_SET; set++) { 133 sprintf(buf, "S %i", set); 138 const int BIG_COLUMNS = 2; 139 const int CHAR_COL_WIDTH = 4; 140 const int SET_COL_WIDTH = 2; 141 142 int col_x_off[BIG_COLUMNS][SEQ_COLOR_SETS+1]; 143 144 aws->auto_space(3, 2); 145 146 for (int bcol = 0; bcol<BIG_COLUMNS; ++bcol) { 147 col_x_off[bcol][0] = aws->get_at_xposition(); 148 aws->button_length(CHAR_COL_WIDTH); 149 aws->create_button(0, "Chars"); 150 151 aws->button_length(SET_COL_WIDTH); 152 for (int cset = 0; cset < SEQ_COLOR_SETS; cset++) { 153 sprintf(buf, " %i", cset+1); 154 col_x_off[bcol][cset+1] = aws->get_at_xposition(); 134 155 aws->create_button(0, buf); 135 156 } 136 157 137 buf[0] = 0; aws->create_button(0, buf); // empty 138 } 158 if (!bcol) { 159 int set_col_pixel_width = col_x_off[0][1]-col_x_off[0][0]; 160 aws->at_x(aws->get_at_xposition()+set_col_pixel_width); 161 } 162 } 163 139 164 aws->at_newline(); 140 aws->auto_space(2, 2); 141 142 for (int elem = 0; elem < (AWT_SEQ_COLORS_MAX_ELEMS/2); elem++) {143 for (int b ig_columns = 0; big_columns <= 1; ++big_columns) {144 int my_elem = elem+big_columns*AWT_SEQ_COLORS_MAX_ELEMS/2;145 146 sprintf(buf, AWAR_SEQ_NAME_STRINGS_TEMPLATE, my_elem);147 aws-> create_input_field(buf, 4);148 for (set = 0; set < AWT_SEQ_COLORS_MAX_SET; set++) {149 sprintf(buf, AWAR_SEQ_NAME_TEMPLATE, set, my_elem); 150 aws->create_input_field(buf, 4);151 }152 if (big_columns == 0) {153 buf[0] = 0; aws->create_button(0, buf); // empty165 166 const int ROWS = SEQ_COLOR_SET_ELEMS/2; 167 for (int r = 0; r<ROWS; r++) { 168 for (int bcol = 0; bcol<BIG_COLUMNS; ++bcol) { 169 int elem = bcol*ROWS+r; 170 171 sprintf(buf, AWAR_SEQ_NAME_STRINGS_TEMPLATE, elem); 172 aws->at_x(col_x_off[bcol][0]); 173 aws->create_input_field(buf, CHAR_COL_WIDTH); 174 175 for (int cset = 0; cset < SEQ_COLOR_SETS; cset++) { 176 sprintf(buf, AWAR_SEQ_NAME_TEMPLATE, cset, elem); 177 aws->at_x(col_x_off[bcol][cset+1]); 178 aws->create_input_field(buf, SET_COL_WIDTH); 154 179 } 155 180 } … … 158 183 159 184 aws->window_fit(); 160 return (AW_window *)aws; 185 186 return aws; 161 187 } 162 188 … … 179 205 for (int selector = 0; selector<2; selector++) { 180 206 long def_set = selector == 0 ? default_NUC_set : default_AMI_set; 181 long set= *GBT_readOrCreate_int(gb_def, selector_awar[selector], def_set);182 183 if ( set < 0 || set >= AWT_SEQ_COLORS_MAX_SET) {184 set = def_set;185 } 186 187 for (int elem = 0; elem < AWT_SEQ_COLORS_MAX_ELEMS; elem++) {207 long cset = *GBT_readOrCreate_int(gb_def, selector_awar[selector], def_set); 208 209 if (cset < 0 || cset >= SEQ_COLOR_SETS) { 210 cset = def_set; 211 } 212 213 for (int elem = 0; elem < SEQ_COLOR_SET_ELEMS; elem++) { 188 214 sprintf(buf, AWAR_SEQ_NAME_STRINGS_TEMPLATE, elem); 189 215 unsigned char *sc = (unsigned char *)GBT_readOrCreate_string(gb_def, buf, default_characters(elem)); … … 191 217 GBDATA *gb_ne = GB_search(gb_def, buf, GB_STRING); 192 218 GB_ensure_callback(gb_ne, GB_CB_CHANGED, awt_awar_changed_cb, (int *)this); 193 for (int s2=0; s2< AWT_SEQ_COLORS_MAX_SET; s2++) {219 for (int s2=0; s2<SEQ_COLOR_SETS; s2++) { 194 220 sprintf(buf, AWAR_SEQ_NAME_TEMPLATE, s2, elem); 195 221 GBT_readOrCreate_char_pntr(gb_def, buf, default_color(s2, elem)); // add default if missing … … 198 224 } 199 225 } 200 sprintf(buf, AWAR_SEQ_NAME_TEMPLATE, (int) set, elem);226 sprintf(buf, AWAR_SEQ_NAME_TEMPLATE, (int)cset, elem); 201 227 char *val = GBT_read_string(gb_def, buf); 228 229 if (strcmp(val, "=0") == 0) GBT_write_string(gb_def, buf, ""); // replace '=0' stored in props with '' 230 if (!val[0]) freedup(val, "=0"); // interpret '' as ' = 0' 231 202 232 if (strlen(val) != 2 || val[1] >'9' || val[1] < '0') { 203 233 aw_message(GB_export_errorf("Error in Color Lookup Table: '%s' is not of type X#", val)); -
branches/e4fix/AWT/awt_seq_colors.hxx
r7623 r8362 21 21 #define AWAR_SEQ_NAME_SELECTOR_NA AWAR_SEQ_PATH "na/select" 22 22 #define AWAR_SEQ_NAME_SELECTOR_AA AWAR_SEQ_PATH "aa/select" 23 24 #define AWT_SEQ_COLORS_MAX_SET 525 #define AWT_SEQ_COLORS_MAX_ELEMS 28 // has to be a even number!26 23 27 24 class AWT_seq_colors { -
branches/e4fix/EDIT4/ED4_root.cxx
r8353 r8362 1644 1644 SEP________________________SEP; 1645 1645 1646 awmm->insert_menu_topic("props_data", "Change Colors & Fonts ", "C", 0, AWM_ALL, AW_POPUP, (AW_CL)ED4_create_gc_window,(AW_CL)first_gc_manager);1647 awmm->insert_menu_topic("props_seq_colors", "Se t Sequence Colors ", "S", "no help", AWM_ALL, AW_POPUP, (AW_CL)create_seq_colors_window, (AW_CL)sequence_colors);1646 awmm->insert_menu_topic("props_data", "Change Colors & Fonts ", "C", 0, AWM_ALL, AW_POPUP, (AW_CL)ED4_create_gc_window, (AW_CL)first_gc_manager); 1647 awmm->insert_menu_topic("props_seq_colors", "Sequence color mapping", "S", "sequence_colors.hlp", AWM_ALL, AW_POPUP, (AW_CL)create_seq_colors_window, (AW_CL)sequence_colors); 1648 1648 1649 1649 SEP________________________SEP; -
branches/e4fix/HELP_SOURCE/oldhelp/sequence_colors.hlp
r6141 r8362 9 9 10 10 #************* Title of helpfile !! and start of real helpfile ******** 11 TITLE Change Colors Of Sequences11 TITLE Sequence color mapping 12 12 13 OCCURRENCE ARB_EDIT4 13 OCCURRENCE ARB_EDIT4/Properties/Sequence color mapping 14 14 15 15 DESCRIPTION The ARB_EDIT4 editor uses two tables to translate the … … 20 20 Each character in each sequence is translated into 21 21 a new character and a color index (0..9) using the definitions 22 from the 'S EQUENCE COLORS' subwindow.22 from the 'Sequence color mapping' subwindow. 23 23 24 - There are different sets ( S_0 .. S_#) of color shemes,25 one columnfor each set.24 - There are different sets (1..8) of color shemes, 25 using two columns for each set. 26 26 27 - In the first row you may choose which set is used for translation. 27 - At the top of the window you may choose which set is used 28 for translation of nucleotides and aminoacids. 28 29 29 30 - The first column shows the characters which should be 30 31 translated/replaced. 31 32 32 - The nth + 1 column holds the data for translation set n.33 - The Nth + 1 column holds the translation instruction for set N. 33 34 Each of its fields has two characters: 34 35 35 1.the character which should replace the original value,36 or '=' if no translation should be performed.36 - the character which should replace the original value, 37 or '=' if no translation should be performed. 37 38 38 2. A color index for this character, between 0 and 9. 39 - a color index for this character, between 0 and 9. 40 41 The default for the translation instruction is '=0' 39 42 40 43 Second Step: … … 59 62 - Only YR instead of ACGTU 60 63 - Only ambiguous symbols 61 - ...64 - etc. 62 65 63 66 BUGS No bugs known
