ARB
ED4_main.cxx
Go to the documentation of this file.
1 // ============================================================= //
2 // //
3 // File : ED4_main.cxx //
4 // Purpose : //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // ============================================================= //
10 
11 
12 #include "ed4_class.hxx"
13 #include "ed4_awars.hxx"
14 #include "ed4_edit_string.hxx"
15 #include "ed4_nds.hxx"
16 #include "ed4_visualizeSAI.hxx"
17 #include "ed4_ProteinViewer.hxx"
19 #include "ed4_dots.hxx"
20 #include "ed4_naligner.hxx"
21 #include "ed4_seq_colors.hxx"
22 #include "graph_aligner_gui.hxx"
23 #include <ed4_extern.hxx>
24 
25 #include <st_window.hxx>
26 #include <gde.hxx>
27 #include <AW_helix.hxx>
28 #include <AP_pro_a_nucs.hxx>
29 #include <ad_config.h>
30 #include <awt_map_key.hxx>
31 #include <awt.hxx>
32 
33 #include <aw_preset.hxx>
34 #include <aw_awars.hxx>
35 #include <aw_msg.hxx>
36 #include <aw_root.hxx>
37 #include <aw_advice.hxx>
38 
39 #include <arbdbt.h>
40 
41 #include <arb_defs.h>
42 #include <arb_global_defs.h>
43 #include <macros.hxx>
44 #include <aw_question.hxx>
45 
47 
49 GBDATA *GLOBAL_gb_main = NULp; // global gb_main for arb_edit4
50 
52 
55 
56 int MAXSEQUENCECHARACTERLENGTH; // greatest # of characters in a sequence string terminal
60 
61 long ED4_counter = 0;
62 
63 size_t not_found_counter; // nr of species which haven't been found
65 
66 long max_seq_terminal_length; // global maximum of sequence terminal length
69 bool move_cursor; // only needed for editing in consensus
70 bool DRAW;
71 
72 inline void replaceChars(char *s, char o, char n) {
73  while (1) {
74  char c = *s++;
75  if (!c) {
76  break;
77  }
78  if (c==o) {
79  s[-1] = n;
80  }
81  }
82 }
83 
84 inline void set_and_realloc_gde_array(uchar **&the_names, uchar **&the_sequences, long &allocated, long &numberspecies, long &maxalign,
85  const char *name, int name_len, const char *seq, int seq_len)
86 {
87  if (allocated==numberspecies) {
88  long new_allocated = (allocated*3)/2;
89 
90  ARB_recalloc(the_names, allocated, new_allocated);
91  ARB_recalloc(the_sequences, allocated, new_allocated);
92  allocated = new_allocated;
93  }
94 
95  the_names[numberspecies] = (uchar*)ARB_strndup(name, name_len);
96  the_sequences[numberspecies] = (uchar*)ARB_strndup(seq, seq_len);
97 
98  replaceChars((char*)the_names[numberspecies], ' ', '_');
99 
100  if (seq_len>maxalign) {
101  maxalign = seq_len;
102  }
103 
104  numberspecies++;
105 }
106 
107 static char *add_area_for_gde(ED4_area_manager *area_man, uchar **&the_names, uchar **&the_sequences,
108  long &allocated, long &numberspecies, long &maxalign,
109  int show_sequence, int show_SAI, int show_helix, int show_consensus, int show_remark)
110 {
111  ED4_terminal *terminal = area_man->get_first_terminal();
112  ED4_terminal *last = area_man->get_last_terminal();
113 
114  for (; terminal;) {
115  if (terminal->is_species_name_terminal()) {
116  ED4_species_manager *species_manager = terminal->get_parent(LEV_SPECIES)->to_species_manager();
117  ED4_species_name_terminal *species_name = species_manager->search_spec_child_rek(LEV_SPECIES_NAME)->to_species_name_terminal();
118  int name_len;
119  char *name = species_name->resolve_pointer_to_string_copy(&name_len);
120  ED4_sequence_terminal *sequence_terminal;
121 
122  {
123  ED4_base *sequence_term = species_manager->search_spec_child_rek(LEV_SEQUENCE_STRING);
124  if (!sequence_term) goto end_of_loop;
125  sequence_terminal = sequence_term->to_sequence_terminal();
126  }
127 
128  int show = -1;
129 
130  bool is_consensus = false;
131  bool is_SAI = false;
132 
133  if (sequence_terminal->is_consensus_terminal()) {
134  is_consensus = true;
135  show = show_consensus;
136  }
137  else if (sequence_terminal->is_SAI_terminal()) {
138  is_SAI = true;
139  show = show_SAI;
140  }
141  else {
142  show = show_sequence;
143  }
144 
145  e4_assert(show!=-1);
146 
147  if (show) {
148  int seq_len;
149  char *seq = NULp;
150 
151  if (is_consensus) {
152  ED4_group_manager *group_manager = sequence_terminal->get_parent(LEV_GROUP)->to_group_manager();
153 
154  seq = group_manager->build_consensus_string(&seq_len);
155  e4_assert(seq && strlen(seq) == size_t(seq_len));
156 
157  ED4_group_manager *folded_group_man = sequence_terminal->is_in_folded_group();
158 
159  if (folded_group_man) { // we are in a folded group
160  if (folded_group_man==group_manager) { // we are the consensus of the folded group
161  if (folded_group_man->is_in_folded_group()) { // a folded group inside a folded group -> do not show
162  freenull(seq);
163  }
164  else { // group folded but consensus shown -> add '-' before name
165  char *new_name = ARB_alloc<char>(name_len+2);
166 
167  sprintf(new_name, "-%s", name);
168  freeset(name, new_name);
169  name_len++;
170  }
171  }
172  else { // we are really inside a folded group -> don't show
173  freenull(seq);
174  }
175  }
176  }
177  else { // sequence
178  if (!sequence_terminal->is_in_folded_group()) {
179  seq = sequence_terminal->resolve_pointer_to_string_copy(&seq_len);
180  }
181  }
182 
183  if (seq) {
184  set_and_realloc_gde_array(the_names, the_sequences, allocated, numberspecies, maxalign, name, name_len, seq, seq_len);
185  if (show_helix && !is_SAI && ED4_ROOT->helix->size()) {
186  char *helix = ED4_ROOT->helix->seq_2_helix(seq, '.');
187  set_and_realloc_gde_array(the_names, the_sequences, allocated, numberspecies, maxalign, name, name_len, helix, seq_len);
188  free(helix);
189  }
190  if (show_remark && !is_consensus) {
191  ED4_manager *ms_man = sequence_terminal->get_parent(LEV_MULTI_SEQUENCE);
192  if (ms_man) {
193  ED4_base *remark_name_term = ms_man->search_ID("remark");
194  if (remark_name_term) {
195  ED4_base *remark_term = remark_name_term->get_next_terminal();
196  e4_assert(remark_term);
197 
198  int remark_len;
199  char *remark = remark_term->resolve_pointer_to_string_copy(&remark_len);
200 
201  replaceChars(remark, ' ', '_');
202  set_and_realloc_gde_array(the_names, the_sequences, allocated, numberspecies, maxalign, name, name_len, remark, remark_len);
203  free(remark);
204  }
205  }
206  }
207  free(seq);
208  }
209  }
210  free(name);
211  }
212  end_of_loop :
213  if (terminal==last) break;
214  terminal = terminal->get_next_terminal();
215  }
216 
217  return NULp;
218 }
219 
220 static char *ED4_create_sequences_for_gde(GBDATA **&the_species, uchar **&the_names, uchar **&the_sequences, long &numberspecies, long &maxalign) {
221  int top = ED4_ROOT->aw_root->awar("gde/top_area")->read_int();
222  int tops = ED4_ROOT->aw_root->awar("gde/top_area_sai")->read_int();
223  int toph = ED4_ROOT->aw_root->awar("gde/top_area_helix")->read_int();
224  int topk = ED4_ROOT->aw_root->awar("gde/top_area_kons")->read_int();
225  int topr = ED4_ROOT->aw_root->awar("gde/top_area_remark")->read_int();
226  int middle = ED4_ROOT->aw_root->awar("gde/middle_area")->read_int();
227  int middles = ED4_ROOT->aw_root->awar("gde/middle_area_sai")->read_int();
228  int middleh = ED4_ROOT->aw_root->awar("gde/middle_area_helix")->read_int();
229  int middlek = ED4_ROOT->aw_root->awar("gde/middle_area_kons")->read_int();
230  int middler = ED4_ROOT->aw_root->awar("gde/middle_area_remark")->read_int();
231 
232  numberspecies = 0;
233  maxalign = 0;
234 
235  long allocated = 100;
236  the_species = NULp;
237 
238  ARB_calloc(the_names, allocated);
239  ARB_calloc(the_sequences, allocated);
240 
241  char *err = add_area_for_gde(ED4_ROOT->top_area_man, the_names, the_sequences, allocated, numberspecies, maxalign, top, tops, toph, topk, topr);
242  if (!err) {
243  err = add_area_for_gde(ED4_ROOT->middle_area_man, the_names, the_sequences, allocated, numberspecies, maxalign, middle, middles, middleh, middlek, middler);
244  }
245 
246  if (allocated!=(numberspecies+1)) {
247  ARB_recalloc(the_names, allocated, numberspecies+1);
248  ARB_recalloc(the_sequences, allocated, numberspecies+1);
249  }
250 
251  return err;
252 }
253 
254 void ED4_setup_gaps_and_alitype(const char *gap_chars, GB_alignment_type alitype) {
255  BaseFrequencies::setup(gap_chars, alitype);
256 }
257 
258 static void ED4_gap_chars_changed(AW_root *root) {
259  char *gap_chars = root->awar_string(ED4_AWAR_GAP_CHARS)->read_string();
260  ED4_setup_gaps_and_alitype(gap_chars, ED4_ROOT->alignment_type);
261  free(gap_chars);
262 }
263 
265  for (ED4_window *win = ED4_ROOT->first_window; win; win = win->next) {
266  ED4_LocalWinContext uses(win);
267  cb(win);
268  }
269 }
270 
271 static void redraw_cursor(ED4_window *win) { win->cursor.redraw(); }
272 static void ED4_edit_direction_changed(AW_root * /* awr */) {
274 }
275 
277  // callbacks to main DB awars are bound later
278  // (otherwise its easy to crash the editor by clicking around in ARB_NTREE during editor startup)
279 
283 }
284 
285 static void ed4_create_mainDB_awars(AW_root *root) {
286  // WARNING: do not bind callbacks here -> do it in ed4_bind_mainDB_awar_callbacks()
287 
288  root->awar_int(AWAR_CURSOR_POSITION, info2bio(0), GLOBAL_gb_main);
289  root->awar_int(AWAR_CURSOR_POSITION_LOCAL, 0, GLOBAL_gb_main);
290  root->awar_int(AWAR_SET_CURSOR_POSITION, 1, GLOBAL_gb_main);
291 
292  root->awar_string(AWAR_FIELD_CHOSEN, NO_FIELD_SELECTED, GLOBAL_gb_main);
293 
294  root->awar_string(AWAR_SPECIES_NAME, "", GLOBAL_gb_main);
295  root->awar_string(AWAR_SAI_NAME, "", GLOBAL_gb_main);
296  root->awar_string(AWAR_SAI_GLOBAL, "", GLOBAL_gb_main);
297 }
298 
299 static void ed4_create_all_awars(AW_root *root, const char *config_name) {
300  // Note: cursor awars are created in window constructor
301 
303 
306 
307 #if defined(DEBUG)
308  AWT_create_db_browser_awars(root, AW_ROOT_DEFAULT);
309 #endif // DEBUG
310 
313 
315 
316  int def_sec_level = 0;
317 #ifdef DEBUG
318  def_sec_level = 6; // don't nag developers
319 #endif
320  root->awar_int(AWAR_EDIT_SECURITY_LEVEL, def_sec_level, AW_ROOT_DEFAULT);
321 
324 
327 
329  root->awar_int(AWAR_EDIT_TITLE_MODE, 0);
330 
331  root->awar_int(AWAR_EDIT_HELIX_SPACING, 0) ->set_minmax(-30, 30) ->add_target_var(&ED4_ROOT->helix_add_spacing) ->add_callback(makeRootCallback(ED4_request_relayout));
333 
334  ed4_changesecurity(root);
335 
340 
344 
346  ED4_create_NDS_awars(root);
347 
350 
354 
356 
358  ED4_gap_chars_changed(root);
360 
361  {
362  GB_ERROR gde_err = GDE_init(ED4_ROOT->aw_root, ED4_ROOT->props_db, GLOBAL_gb_main, ED4_create_sequences_for_gde, NULp, GDE_WINDOWTYPE_EDIT4);
363  if (gde_err) GBK_terminatef("Fatal error: %s", gde_err);
364  }
365 
371 
374 
375  // Create Awars To Be Used In Protein Viewer
376  if (ED4_ROOT->alignment_type == GB_AT_DNA) {
378  }
379 
380  // create awars to be used for protein secondary structure match
381  if (ED4_ROOT->alignment_type == GB_AT_AA) {
382  root->awar_int(PFOLD_AWAR_ENABLE, 1);
383  root->awar_string(PFOLD_AWAR_SELECTED_SAI, "PFOLD");
385  int pt;
386  char awar[256];
387  for (int i = 0; pfold_match_type_awars[i].name; i++) {
390  sprintf(awar, PFOLD_AWAR_PAIR_TEMPLATE, pfold_match_type_awars[i].name);
391  root->awar_string(awar, pfold_pairs[pt])->add_target_var(&pfold_pairs[pt]);
392  sprintf(awar, PFOLD_AWAR_SYMBOL_TEMPLATE, pfold_match_type_awars[i].name);
394  }
396  root->awar_string(PFOLD_AWAR_SAI_FILTER, "pfold");
397  }
398 
399  GB_ERROR error = ARB_init_global_awars(root, AW_ROOT_DEFAULT, GLOBAL_gb_main);
400  if (error) aw_message(error);
401 }
402 
403 const char *ED4_propertyName(int mode) {
404  // mode == 0 -> alignment specific (e.g. "edit4_ali_16s.arb")
405  // mode == 1 -> alignment-type specific (e.g. "edit4_rna.arb")
406  // mode == 2 -> unspecific (normal) (always "edit4.arb")
407  //
408  // Note : result is only valid until next call
409 
410  e4_assert(mode >= 0 && mode <= 2);
411 
412  const char *result;
413  if (mode == 2) {
414  result = "edit4.arb";
415  }
416  else {
417  static char *ali_name = NULp;
418  static char *ali_type = NULp;
419  static char *result_copy = NULp;
420 
421  if (!ali_name) {
422  GB_transaction ta(GLOBAL_gb_main);
423  ali_name = GBT_get_default_alignment(GLOBAL_gb_main);
424  ali_type = GBT_get_alignment_type_string(GLOBAL_gb_main, ali_name);
425  result_copy = new char[21+strlen(ali_name)];
426  }
427 
428  sprintf(result_copy, "edit4_%s.arb", mode == 0 ? ali_name : ali_type);
429  result = result_copy;
430  }
431 
432  return result;
433 }
434 
435 static void ED4_postcbcb(AW_window *aww) {
436  ED4_ROOT->announce_useraction_in(aww);
438 }
439 static void seq_colors_changed_cb() {
441 }
442 
443 int ARB_main(int argc, char *argv[]) {
444  const char *data_path = ":";
445  char *config_name = NULp;
446 
447  if (argc > 1 && ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "--help") == 0))) {
448  fprintf(stderr,
449  "Usage: arb_edit4 [options] database\n"
450  " database name of database or ':' to connect to arb-database-server\n"
451  "\n"
452  " options:\n"
453  " -c config loads configuration 'config' (default: '" DEFAULT_CONFIGURATION "')\n"
454  );
455  return EXIT_SUCCESS;
456  }
457 
458  if (argc > 1 && strcmp(argv[1], "-c") == 0) {
459  config_name = new char[strlen(argv[2])+1];
460  strcpy(config_name, argv[2]);
461  argc -= 2; argv += 2;
462  }
463  else { // load default configuration if no command line is given
464  config_name = ARB_strdup(DEFAULT_CONFIGURATION);
465  printf("Using '%s'\n", DEFAULT_CONFIGURATION);
466  }
467 
468  if (argc>1) {
469  data_path = argv[1];
470  argc--; argv++;
471  }
472 
473  aw_initstatus();
474 
475  GB_shell shell;
477  GLOBAL_gb_main = GB_open(data_path, "rwt");
478  if (!GLOBAL_gb_main) {
479  error = GB_await_error();
480  }
481  else {
482 #if defined(DEBUG)
483  AWT_announce_db_to_browser(GLOBAL_gb_main, GBS_global_string("ARB database (%s)", data_path));
484 #endif // DEBUG
485 
486  ED4_ROOT = new ED4_root(&argc, &argv);
487 
488  error = configure_macro_recording(ED4_ROOT->aw_root, "ARB_EDIT4", GLOBAL_gb_main);
489  if (!error) {
490  ED4_ROOT->database = new EDB_root_bact;
491  error = ED4_ROOT->init_alignment();
492  }
493  if (!error) {
494  ed4_create_all_awars(ED4_ROOT->aw_root, config_name);
495 
496  ED4_ROOT->st_ml = STAT_create_ST_ML(GLOBAL_gb_main);
498 
499  ED4_ROOT->edk = new ed_key;
500  ED4_ROOT->edk->create_awars(ED4_ROOT->aw_root);
501 
502  ED4_ROOT->helix = new AW_helix(ED4_ROOT->aw_root);
503 
504  {
506  switch (ED4_ROOT->alignment_type) {
507  case GB_AT_RNA:
508  case GB_AT_DNA:
509  warning = ED4_ROOT->helix->init(GLOBAL_gb_main);
510  break;
511 
512  case GB_AT_AA:
513  warning = ED4_pfold_set_SAI(&ED4_ROOT->protstruct, GLOBAL_gb_main, ED4_ROOT->alignment_name, &ED4_ROOT->protstruct_len);
514  break;
515 
516  default:
517  e4_assert(0);
518  break;
519  }
520 
521  if (warning) aw_message(warning); // write to console
522  ED4_ROOT->create_first_window();
523  if (warning) { aw_message(warning); warning = NULp; } // write again to status window
524  }
525 
527  {
528  int found_config = 0;
529  ED4_LocalWinContext uses(ED4_ROOT->first_window);
530 
531  if (config_name) {
532  GB_transaction ta(GLOBAL_gb_main);
533  GB_ERROR cfg_error;
534  GBT_config cfg(GLOBAL_gb_main, config_name, cfg_error);
535 
536  if (cfg.exists()) {
537  ED4_ROOT->create_hierarchy(cfg.get_definition(GBT_config::MIDDLE_AREA), cfg.get_definition(GBT_config::TOP_AREA)); // create internal hierarchy
538  found_config = 1;
539  }
540  else {
541  aw_message(GBS_global_string("Could not find configuration '%s'", config_name));
542  }
543  }
544 
545  if (!found_config) {
546  // create internal hierarchy
547 
548  char *as_mid = ED4_ROOT->database->make_string();
549  char *as_top = ED4_ROOT->database->make_top_bot_string();
550 
551  ED4_ROOT->create_hierarchy(as_mid, as_top);
552 
553  delete as_mid;
554  delete as_top;
555  }
556  }
557 
558  // now bind DB depending callbacks
560 
561  // Create Additional sequence (aminoacid) terminals to be used in Protein Viewer
562  if (ED4_ROOT->alignment_type == GB_AT_DNA) {
563  PV_CallBackFunction(ED4_ROOT->aw_root);
564  }
565 
568  e4_assert(!ED4_WinContext::have_context()); // no global context shall be active
569  ED4_ROOT->aw_root->main_loop(); // enter main-loop
570  }
571 
573  GB_close(GLOBAL_gb_main);
574  }
575 
576  bool have_aw_root = ED4_ROOT && ED4_ROOT->aw_root;
577  if (error) {
578  if (have_aw_root) aw_popup_ok(error.deliver());
579  else fprintf(stderr, "arb_edit4: Error: %s\n", error.deliver());
580  }
581  if (have_aw_root) delete ED4_ROOT->aw_root;
582 
583  return EXIT_SUCCESS;
584 }
585 
void ED4_selected_species_changed_cb(AW_root *aw_root)
Definition: ED4_cursor.cxx:499
static bool have_context()
Definition: ed4_class.hxx:1398
#define ED4_AWAR_SCROLL_SPEED_Y
Definition: ed4_awars.hxx:32
int MAXINFO_WIDTH
Definition: ED4_main.cxx:58
const char * GB_ERROR
Definition: arb_core.h:25
string result
GBDATA * GB_open(const char *path, const char *opent)
Definition: ad_load.cxx:1363
#define PFOLD_PAIRS
void ED4_create_NDS_awars(AW_root *root)
Definition: ED4_nds.cxx:55
AW_helix * helix
Definition: ed4_class.hxx:1446
ED4_EDITMODE
Definition: ed4_defs.hxx:30
#define ED4_AWAR_ANNOUNCE_CHECKSUM_CHANGES
Definition: ed4_awars.hxx:36
#define AWAR_EDIT_SECURITY_LEVEL
Definition: ed4_defs.hxx:94
#define AWAR_EDIT_TITLE_MODE
Definition: ed4_defs.hxx:107
#define ED4_AWAR_COMPRESS_SEQUENCE_GAPS
Definition: ed4_awars.hxx:23
__ATTR__USERESULT_TODO GB_ERROR ARB_init_global_awars(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main)
Definition: aw_root.hxx:198
static void ED4_gap_chars_changed(AW_root *root)
Definition: ED4_main.cxx:258
ED4_EDITMODE awar_edit_mode
Definition: ED4_main.cxx:67
#define ED4_AWAR_CREATE_FROM_CONS_REPL_EQUAL
Definition: ed4_awars.hxx:55
ED4_area_manager * top_area_man
Definition: ed4_class.hxx:1430
#define ED4_AWAR_REP_REPLACE_PATTERN
Definition: ed4_awars.hxx:64
virtual char * resolve_pointer_to_string_copy(int *str_len=NULp) const
Definition: ED4_base.cxx:228
static void ed4_create_mainDB_awars(AW_root *root)
Definition: ED4_main.cxx:285
ED4_terminal * get_first_terminal(int start_index=0) const
bool is_SAI_terminal() const
Definition: ed4_class.hxx:1851
ED4_group_manager * is_in_folded_group() const
Definition: ED4_base.cxx:20
static const int MIDDLE_AREA
Definition: ad_config.h:46
#define PFOLD_AWAR_SAI_FILTER
Filter SAIs for given criteria (string); used in option menu for SAI selection.
#define ED4_AWAR_FAST_CURSOR_JUMP
Definition: ed4_awars.hxx:28
#define AWAR_CURSOR_POSITION
bool DRAW
Definition: ED4_main.cxx:70
size_t not_found_counter
Definition: ED4_main.cxx:63
void redraw()
Definition: ed4_class.hxx:659
void aw_initstatus()
Definition: AW_status.cxx:766
ED4_area_manager * middle_area_man
Definition: ed4_class.hxx:1429
const char * init(GBDATA *gb_main)
Definition: BI_helix.cxx:299
void ED4_create_search_awars(AW_root *root)
Definition: ED4_search.cxx:735
void ED4_request_relayout()
#define ED4_AWAR_SCROLL_SPEED_X
Definition: ed4_awars.hxx:31
char * ARB_strdup(const char *str)
Definition: arb_string.h:27
long read_int() const
Definition: AW_awar.cxx:187
#define AWAR_EDIT_SECURITY_LEVEL_ALIGN
Definition: ed4_defs.hxx:95
#define AWAR_INSERT_MODE
Definition: ed4_defs.hxx:93
EDB_root_bact * database
Definition: ed4_class.hxx:1432
void ED4_create_consensus_awars(AW_root *aw_root)
AW_awar * set_minmax(float min, float max)
Definition: AW_awar.cxx:532
#define ED4_AWAR_COMPRESS_SEQUENCE_TYPE
Definition: ed4_awars.hxx:22
static const int TOP_AREA
Definition: ad_config.h:45
ed_key * edk
Definition: ed4_class.hxx:1452
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:204
void warning(int warning_num, const char *warning_message)
Definition: util.cxx:61
void PV_CallBackFunction(AW_root *root)
#define PFOLD_AWAR_SYMBOL_TEMPLATE_2
Symbols for the match quality as used for match method SECSTRUCT_SEQUENCE.
#define AWAR_EDIT_SECURITY_LEVEL_CHANGE
Definition: ed4_defs.hxx:96
static void redraw_cursor(ED4_window *win)
Definition: ED4_main.cxx:271
void ED4_trigger_instant_refresh()
void GBK_terminatef(const char *templat,...)
Definition: arb_msg.cxx:477
ED4_base * search_ID(const char *id) FINAL_OVERRIDE
static void ed4_create_all_awars(AW_root *root, const char *config_name)
Definition: ED4_main.cxx:299
char * pfold_pair_chars[PFOLD_PAIRS]
Symbols for the match quality (defined by PFOLD_MATCH_TYPE) as used for match methods SECSTRUCT_SECST...
#define EXIT_SUCCESS
Definition: arb_a2ps.c:154
Compare an amino acid sequence with a reference protein secondary structure.
void ED4_selected_SAI_changed_cb(AW_root *aw_root)
Definition: ED4_cursor.cxx:484
static void init_object_specs()
Definition: ED4_objspec.cxx:98
__ATTR__USERESULT GB_ERROR configure_macro_recording(AW_root *aw_root, const char *client_id, GBDATA *gb_main)
Definition: trackers.cxx:454
name_value_pair pfold_match_type_awars[]
Awars for the match type; binds the PFOLD_MATCH_TYPE to the corresponding awar name.
char * protstruct
Definition: ed4_class.hxx:1450
char * GBT_get_alignment_type_string(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:727
char * pfold_pairs[PFOLD_PAIRS]
Match pair definition (see PFOLD_MATCH_TYPE) as used for match methods SECSTRUCT_SECSTRUCT and SECSTR...
FILE * seq
Definition: rns.c:46
#define cb(action)
static char * add_area_for_gde(ED4_area_manager *area_man, uchar **&the_names, uchar **&the_sequences, long &allocated, long &numberspecies, long &maxalign, int show_sequence, int show_SAI, int show_helix, int show_consensus, int show_remark)
Definition: ED4_main.cxx:107
GBDATA * GLOBAL_gb_main
Definition: ED4_main.cxx:49
#define AWAR_EDIT_RIGHTWARD
Definition: ed4_extern.hxx:76
#define DEFAULT_CONFIGURATION
Definition: ad_config.h:27
#define e4_assert(bed)
Definition: ed4_class.hxx:11
#define NO_FIELD_SELECTED
void ED4_create_dot_missing_bases_awars(AW_root *aw_root, AW_default aw_def)
Definition: ED4_dots.cxx:219
AW_awar * add_callback(const RootCallback &cb)
Definition: AW_awar.cxx:234
GB_ERROR GDE_init(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main, GDE_get_sequences_cb get_sequences, GDE_format_alignment_cb format_ali, gde_window_type window_type)
Definition: GDE.cxx:486
#define PFOLD_AWAR_MATCH_METHOD
Selected method for computing the match quality (see PFOLD_MATCH_METHOD).
void ed4_change_edit_mode(AW_root *root)
#define ED4_AWAR_CREATE_FROM_CONS_ALL_UPPER
Definition: ed4_awars.hxx:58
ST_ML * STAT_create_ST_ML(GBDATA *gb_main)
Definition: ST_window.cxx:110
char * build_consensus_string(PosRange range) const
Definition: ed4_class.hxx:1655
GB_ERROR GB_await_error()
Definition: arb_msg.cxx:353
long helix_add_spacing
Definition: ed4_class.hxx:1448
static void setup(const char *gap_chars, GB_alignment_type ali_type_)
Definition: chartable.cxx:604
#define ED4_AWAR_CURSOR_TYPE
Definition: ed4_awars.hxx:29
bool exists() const
Definition: ad_config.h:48
const char * ED4_propertyName(int mode)
Definition: ED4_main.cxx:403
void set_and_realloc_gde_array(uchar **&the_names, uchar **&the_sequences, long &allocated, long &numberspecies, long &maxalign, const char *name, int name_len, const char *seq, int seq_len)
Definition: ED4_main.cxx:84
#define ED4_AWAR_CREATE_FROM_CONS_DATA_SOURCE
Definition: ed4_awars.hxx:59
AW_HEADER_MAIN ED4_root * ED4_ROOT
Definition: ED4_main.cxx:48
GB_ERROR deliver() const
Definition: arb_error.h:114
void ED4_compression_toggle_changed_cb(AW_root *root, bool hideChanged)
#define ED4_AWAR_SPECIES_TO_CREATE
Definition: ed4_awars.hxx:206
GB_ERROR ED4_pfold_set_SAI(char **protstruct, GBDATA *gb_main, const char *alignment_name, long *protstruct_len)
Sets the reference protein secondary structure SAI.
void create_awars(AW_root *root)
Definition: AWT_map_key.cxx:59
#define AWAR_SAI_GLOBAL
long ED4_counter
Definition: ED4_main.cxx:61
#define PFOLD_AWAR_SYMBOL_TEMPLATE
Symbols for the match quality as used for match methods SECSTRUCT_SECSTRUCT and SECSTRUCT_SEQUENCE_PR...
void aw_popup_ok(const char *msg)
void ED4_with_all_edit_windows(void(*cb)(ED4_window *))
Definition: ED4_main.cxx:264
ED4_terminal * get_last_terminal(int start_index=-1) const
char * alignment_name
Definition: ed4_class.hxx:1440
#define AWAR_FIELD_CHOSEN
Definition: ed4_defs.hxx:105
int SEQ_TERM_TEXT_YOFFSET
Definition: ED4_main.cxx:54
#define AWAR_EDIT_HELIX_SPACING
Definition: ed4_defs.hxx:108
ED4_window * first_window
Definition: ed4_class.hxx:1427
static void ED4_postcbcb(AW_window *aww)
Definition: ED4_main.cxx:435
ED4_terminal * get_next_terminal()
Definition: ED4_base.cxx:452
static void error(const char *msg)
Definition: mkptypes.cxx:96
void create_naligner_variables(AW_root *root, AW_default db1)
ED4_cursor cursor
Definition: ed4_class.hxx:727
int FLAG_WIDTH
Definition: ED4_main.cxx:59
#define ED4_AWAR_DIGITS_AS_REPEAT
Definition: ed4_awars.hxx:27
void ED4_createVisualizeSAI_Awars(AW_root *aw_root, AW_default aw_def)
#define ED4_AWAR_COMPRESS_SEQUENCE_PERCENT
Definition: ed4_awars.hxx:25
ASSERTING_CONSTEXPR_INLINE int info2bio(int infopos)
Definition: arb_defs.h:27
void replaceChars(char *s, char o, char n)
Definition: ED4_main.cxx:72
GBS_strstruct * not_found_message
Definition: ED4_main.cxx:64
void announce_useraction_in(AW_window *aww)
Definition: ED4_root.cxx:372
size_t size() const
Definition: BI_helix.hxx:88
#define AWAR_SPECIES_NAME
#define AWAR_SET_CURSOR_POSITION
#define AWAR_SAI_NAME
void ARB_recalloc(TYPE *&tgt, size_t oelem, size_t nelem)
Definition: arb_mem.h:49
void PV_CreateAwars(AW_root *root, AW_default aw_def)
#define PFOLD_AWAR_PAIR_TEMPLATE
Structure pairs that define the match quality (see pfold_pairs) as used for match methods SECSTRUCT_S...
#define PFOLD_PAIR_CHARS_2
Symbols for the match quality as used for match method SECSTRUCT_SEQUENCE in ED4_pfold_calculate_secs...
char * read_string() const
Definition: AW_awar.cxx:201
static void seq_colors_changed_cb()
Definition: ED4_main.cxx:439
const char * name
Name or description.
void ed4_changesecurity(AW_root *root)
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
long awar_edit_rightward
Definition: ED4_main.cxx:68
GB_alignment_type alignment_type
Definition: ed4_class.hxx:1441
void ED4_compression_changed_cb(AW_root *awr)
GB_alignment_type
Definition: arbdb_base.h:61
char * seq_2_helix(char *sequence, char undefsymbol= ' ')
Definition: AW_helix.cxx:92
#define AW_HEADER_MAIN
Definition: aw_window.hxx:36
bool move_cursor
Definition: ED4_main.cxx:69
void main_loop()
Definition: AW_root.cxx:625
bool is_consensus_terminal() const
Definition: ed4_class.hxx:1850
static void ED4_edit_direction_changed(AW_root *)
Definition: ED4_main.cxx:272
ED4_base * search_spec_child_rek(ED4_level level)
Definition: ED4_base.cxx:432
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:580
const char * anyGapChars()
long protstruct_len
Definition: ed4_class.hxx:1451
#define AWAR_EDIT_MODE
Definition: ed4_defs.hxx:92
TYPE * ARB_calloc(size_t nelem)
Definition: arb_mem.h:81
#define ED4_AWAR_CREATE_FROM_CONS_CREATE_POINTS
Definition: ed4_awars.hxx:57
#define ED4_AWAR_CREATE_FROM_CONS_REPL_POINT
Definition: ed4_awars.hxx:56
static char * ED4_create_sequences_for_gde(GBDATA **&the_species, uchar **&the_names, uchar **&the_sequences, long &numberspecies, long &maxalign)
Definition: ED4_main.cxx:220
#define PFOLD_AWAR_ENABLE
Enable structure match.
AW_awar * add_target_var(char **ppchr)
Definition: AW_awar.cxx:239
char * ARB_strndup(const char *start, int len)
Definition: arb_string.h:83
long terminal_add_spacing
Definition: ed4_class.hxx:1449
#define ED4_AWAR_SCROLL_MARGIN
Definition: ed4_awars.hxx:33
int ARB_main(int argc, char *argv[])
Definition: ED4_main.cxx:443
#define ED4_AWAR_COMPRESS_SEQUENCE_HIDE
Definition: ed4_awars.hxx:24
int value
Value attached to name.
void ED4_setup_gaps_and_alitype(const char *gap_chars, GB_alignment_type alitype)
Definition: ED4_main.cxx:254
int INFO_TERM_TEXT_YOFFSET
Definition: ED4_main.cxx:53
#define AWAR_CURSOR_POSITION_LOCAL
ED4_seq_colors * sequence_colors
Definition: ed4_class.hxx:1443
AW_root * aw_root
Definition: ed4_class.hxx:1424
static void ed4_bind_mainDB_awar_callbacks(AW_root *root)
Definition: ED4_main.cxx:276
#define AWAR_EDIT_TERMINAL_SPACING
Definition: ed4_defs.hxx:109
void aw_message(const char *msg)
Definition: AW_status.cxx:932
const char * get_definition(int area) const
Definition: ad_config.h:50
int TERMINAL_HEIGHT
Definition: ED4_main.cxx:51
unsigned char uchar
Definition: gde.hxx:21
void ED4_remote_set_cursor_cb(AW_root *awr)
void AWT_install_postcb_cb(AW_postcb_cb postcb_cb)
int MAXSEQUENCECHARACTERLENGTH
Definition: ED4_main.cxx:56
AW_window_simple * win
void shutdown_macro_recording(AW_root *aw_root)
Definition: trackers.cxx:470
#define NULp
Definition: cxxforward.h:97
AW_window * create_first_window()
Definition: ED4_root.cxx:1867
int MAXNAME_WIDTH
Definition: ED4_main.cxx:57
long max_seq_terminal_length
Definition: ED4_main.cxx:66
AW_default props_db
Definition: ed4_class.hxx:1425
void request_refresh_for_sequence_terminals()
Definition: ED4_root.cxx:106
#define ED4_AWAR_GAP_CHARS
Definition: ed4_awars.hxx:35
char * GBT_get_default_alignment(GBDATA *gb_main)
Definition: adali.cxx:675
char * resolve_pointer_to_string_copy(int *str_len=NULp) const FINAL_OVERRIDE
void AWT_install_cb_guards()
char * make_top_bot_string()
GB_transaction ta(gb_var)
ED4_returncode create_hierarchy(const char *area_string_middle, const char *area_string_top)
Definition: ED4_root.cxx:549
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:570
ARB_ERROR init_alignment()
Definition: ED4_root.cxx:503
#define ED4_AWAR_REP_SEARCH_PATTERN
Definition: ed4_awars.hxx:63
char * make_string()
void create_sina_variables(AW_root *root, AW_default db1)
ED4_manager * get_parent(ED4_level lev) const
Definition: ed4_class.hxx:1823
#define AWAR_EDIT_CONFIGURATION
Definition: ed4_defs.hxx:97
#define AW_ROOT_DEFAULT
Definition: aw_base.hxx:106
#define PFOLD_AWAR_SELECTED_SAI
Selected reference protein secondary structure SAI (i.e. the SAI that is used for structure compariso...
int is_species_name_terminal() const
Definition: ed4_class.hxx:1085
ST_ML * st_ml
Definition: ed4_class.hxx:1445
void GB_close(GBDATA *gbd)
Definition: arbdb.cxx:625
Adds support for protein structure prediction, comparison of two protein secondary structures and of ...
GB_write_int const char s
Definition: AW_awar.cxx:156