ARB
PH_main.cxx
Go to the documentation of this file.
1 // =============================================================== //
2 // //
3 // File : PH_main.cxx //
4 // Purpose : //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // =============================================================== //
10 
11 #include "phylo.hxx"
12 #include "phwin.hxx"
13 #include "PH_display.hxx"
14 
15 #include <awt_sel_boxes.hxx>
16 #include <aw_preset.hxx>
17 #include <aw_awar.hxx>
18 #include <aw_msg.hxx>
19 #include <awt.hxx>
20 #include <aw_root.hxx>
21 #include <arbdbt.h>
22 #include <arb_strarray.h>
23 
24 #include <macros.hxx>
25 #include <aw_question.hxx>
26 
28 
29 const char *filter_text[FILTER_MODES] = {
30  "don't count (ignore) ", // DONT_COUNT
31  "if occurs most often => forget whole column", // SKIP_COLUMN_IF_MAX
32  "if occurs => forget whole column ", // SKIP_COLUMN_IF_OCCUR
33  "count, but do NOT use as maximum ", // COUNT_DONT_USE_MAX
34  "treat as uppercase character ", // TREAT_AS_UPPERCASE
35  "treat as regular character ", // TREAT_AS_REGULAR
36 };
37 
39  GB_transaction ta(gb_main);
40  const char *aliname = aw_root->awar(AWAR_PHYLO_ALIGNMENT)->read_char_pntr();
41  if (GBT_get_alignment_len(gb_main, aliname)<1) {
43  return false;
44  }
45  return true;
46 }
47 
48 static void startup_sequence_cb(AW_window *alisel_window, AW_window *main_window, PH_root *ph_root) {
49  AW_root *aw_root = main_window->get_root();
50  GBDATA *gb_main = ph_root->get_gb_main();
51 
52  if (valid_alignment_selected(aw_root, gb_main)) {
53  char *use = aw_root->awar(AWAR_PHYLO_ALIGNMENT)->read_string();
54  PHDATA *phd = new PHDATA(aw_root, ph_root);
55 
56  GB_ERROR error = GBT_set_startup_alignment(gb_main, use); // freeze default alignment in ARB_PHYLO (AFAIK it is not used, but will prevent wrong future use)
57  if (error) {
58  aw_message(error);
59  }
60  else {
61  if (alisel_window) alisel_window->hide();
62 
64  phd->load(use);
65  phd->ROOT = phd;
66 
67  long len = PHDATA::ROOT->get_seq_len(); // @@@ off by one?
69  aw_root->awar(AWAR_PHYLO_FILTER_STARTCOL)->set_minmax(0, len);
70  aw_root->awar(AWAR_PHYLO_FILTER_STOPCOL)->set_minmax(0, len);
71 
72  main_window->activate();
74  }
75  }
76  else {
77  if (alisel_window) {
78  aw_message("Please select a valid alignment");
79  }
80  else {
81  GBK_terminate("Expected to have a valid alignment");
82  }
83  }
84 }
85 
86 __ATTR__NORETURN static void ph_exit(AW_window *aw_window, PH_root *ph_root) {
87  AW_root *aw_root = aw_window->get_root();
88  shutdown_macro_recording(aw_root);
89 
90  GBDATA *gb_main = ph_root->get_gb_main();
91  if (gb_main) {
92  aw_root->unlink_awars_from_DB(gb_main);
93 #if defined(DEBUG)
94  AWT_browser_forget_db(gb_main);
95 #endif // DEBUG
96  GB_close(gb_main);
97  }
98 
99  exit(EXIT_SUCCESS);
100 }
101 
102 
103 void expose_cb() {
107  }
108 }
109 
110 static void resize_cb() {
114  }
115 }
116 
117 static void gc_changed_cb(GcChange whatChanged) {
118  switch (whatChanged) {
120  ph_assert(0); // not used atm
121  FALLTHROUGH; // in NDEBUG
122  case GC_COLOR_CHANGED:
123  expose_cb();
124  break;
125  case GC_FONT_CHANGED:
126  resize_cb();
127  break;
128  }
129 }
130 
131 static GB_ERROR PH_create_ml_multiline_SAI(GB_CSTR sai_name, int nr, GBDATA **gb_sai_ptr, PH_root *ph_root) {
132  GBDATA *gb_sai = GBT_find_or_create_SAI(ph_root->get_gb_main(), sai_name);
133  GBDATA *gbd, *gb2;
135 
136  if (!error) {
137  for (gbd = GB_child(gb_sai); gbd; gbd = gb2) {
138  gb2 = GB_nextChild(gbd);
139 
140  const char *key = GB_read_key_pntr(gbd);
141  if (!strcmp(key, "name")) continue;
142  if (!strncmp(key, "ali_", 4)) continue;
143 
144  error = GB_delete(gbd);
145  if (error) break;
146  }
147  }
148 
149  if (!error) {
150  GBDATA *gb_ali = GB_search(gb_sai, PHDATA::ROOT->use, GB_FIND);
151  if (gb_ali) {
152  for (gbd = GB_child(gb_ali); gbd; gbd = gb2) {
153  gb2 = GB_nextChild(gbd);
154 
155  const char *key = GB_read_key_pntr(gbd);
156  if (!strcmp(key, "data")) continue;
157  if (!strcmp(key, "_TYPE")) continue;
158 
159  error = GB_delete(gbd);
160  if (error) break;
161  }
162  }
163  }
164 
165  GBDATA *gb_data = NULp, *gb_TYPE = NULp;
166 
167  if (!error) {
168  gb_data = GBT_add_data(gb_sai, PHDATA::ROOT->use, "data", GB_STRING);
169  if (!gb_data) error = GB_await_error();
170  }
171 
172  if (!error) {
173  gb_TYPE = GBT_add_data(gb_sai, PHDATA::ROOT->use, "_TYPE", GB_STRING);
174  if (!gb_TYPE) error = GB_await_error();
175  }
176 
177  if (!error && !PHDATA::ROOT->markerline) {
178  error = "Nothing calculated yet";
179  }
180 
181  if (!error) {
182  char *full_save_name = NULp;
183  FILE *saveResults = NULp;
184  if (nr == 2) {
185  char *save_name = GB_unique_filename("conservationProfile", "gnu");
186  saveResults = GB_fopen_tempfile(save_name, "w+", &full_save_name);
187  GB_remove_on_exit(full_save_name);
188  free(save_name);
189 
190  if (!saveResults) error = GB_await_error();
191  }
192 
193  if (!error) {
195  long minhom = main_win->get_root()->awar(AWAR_PHYLO_FILTER_MINHOM)->read_int();
196  long maxhom = main_win->get_root()->awar(AWAR_PHYLO_FILTER_MAXHOM)->read_int();
197  long startcol = main_win->get_root()->awar(AWAR_PHYLO_FILTER_STARTCOL)->read_int();
198  long stopcol = main_win->get_root()->awar(AWAR_PHYLO_FILTER_STOPCOL)->read_int();
199  float *markerline = PHDATA::ROOT->markerline;
200  long len = PHDATA::ROOT->get_seq_len();
201 
202  char *data = ARB_calloc<char>(len+1);
203  int cnt = 0;
204 
205 
206  for (int x=0; x<len; x++) {
207  char c;
208 
209  if (x<startcol || x>stopcol) {
210  c = '.';
211  }
212  else {
213  float ml = markerline[x];
214  if (nr==2 && ml>0.0) {
215  ph_assert(saveResults);
216  fprintf(saveResults, "%i\t%.2f\n", cnt, ml);
217  cnt++;
218  }
219 
220  if (ml>=0.0 && ml>=minhom && ml<=maxhom) {
221  int digit = -1;
222  switch (nr) {
223  case 0: // hundred
224  if (ml>=100.0) digit = 1;
225  break;
226  case 1: // ten
227  if (ml>=10.0) digit = int(ml/10);
228  break;
229  case 2: // one
230  digit = int(ml);
231  break;
232  default:
233  ph_assert(0);
234  break;
235  }
236 
237  if (digit<0) c = '-';
238  else c = '0' + digit%10;
239  }
240  else {
241  c = '-';
242  }
243  }
244 
245  data[x] = c;
246  }
247  data[len] = 0;
248 
249  if (saveResults) {
250  fclose(saveResults);
251  fprintf(stderr, "Note: Frequencies as well saved to '%s'\n", full_save_name);
252  }
253 
254  error = GB_write_string(gb_data, data);
255  if (!error) {
256  const char *buffer = GBS_global_string("FMX: Filter by Maximum Frequency: "
257  "Start %li; Stop %li; Minhom %li%%; Maxhom %li%%",
258  startcol, stopcol, minhom, maxhom);
259  error = GB_write_string(gb_TYPE, buffer);
260  }
261  free(data);
262  }
263  free(full_save_name);
264  }
265 
266  if (!error) *gb_sai_ptr = gb_sai;
267  return error;
268 }
269 
270 static void PH_save_ml_multiline_cb(AW_window *aww, PH_root *ph_root) {
271  GB_transaction ta(ph_root->get_gb_main());
272 
273  GB_ERROR error = NULp;
274  char *fname = aww->get_root()->awar(AWAR_PHYLO_MARKERLINENAME)->read_string();
275  int fname_len = strlen(fname);
276  {
277  char *digit_appended = ARB_alloc<char>(fname_len+2);
278  memcpy(digit_appended, fname, fname_len);
279  strcpy(digit_appended+fname_len, "0");
280 
281  freeset(fname, digit_appended);
282  }
283  GBDATA *gb_sai[3];
284  int i;
285  for (i=0; !error && i<3; i++) {
286  fname[fname_len] = '0'+i;
287  error = PH_create_ml_multiline_SAI(fname, i, &gb_sai[i], ph_root);
288  }
289 
290  delete fname;
291 
292  aw_message_if(ta.close(error));
293 }
294 
295 static void PH_save_ml_cb(AW_window *aww, PH_root *ph_root) {
296  GBDATA *gb_main = ph_root->get_gb_main();
297  GB_transaction ta(gb_main);
298 
299  char *fname = aww->get_root()->awar(AWAR_PHYLO_MARKERLINENAME)->read_string();
300  GBDATA *gb_sai = GBT_find_or_create_SAI(gb_main, fname);
301 
303 
304  if (!error) {
305  for (GBDATA *gbd = GB_child(gb_sai), *gbnext; gbd; gbd = gbnext) {
306  gbnext = GB_nextChild(gbd);
307 
308  const char *key = GB_read_key_pntr(gbd);
309  if (!strcmp(key, "name")) continue;
310  if (!strncmp(key, "ali_", 4)) continue;
311 
312  error = GB_delete(gbd);
313  if (error) break;
314  }
315  }
316 
317  if (!error) {
318  GBDATA *gb_ali = GB_search(gb_sai, PHDATA::ROOT->use, GB_FIND);
319  if (gb_ali) {
320  for (GBDATA *gbd = GB_child(gb_ali), *gbnext; gbd; gbd = gbnext) {
321  gbnext = GB_nextChild(gbd);
322 
323  const char *key = GB_read_key_pntr(gbd);
324  if (!strcmp(key, "bits")) continue;
325  if (!strcmp(key, "_TYPE")) continue;
326 
327  error = GB_delete(gbd);
328  if (error) break;
329  }
330  }
331  }
332 
333  GBDATA *gb_bits = NULp, *gb_TYPE = NULp;
334 
335  if (!error) {
336  gb_bits = GBT_add_data(gb_sai, PHDATA::ROOT->use, "bits", GB_BITS);
337  if (!gb_bits) error = GB_await_error();
338  }
339 
340  if (!error) {
341  gb_TYPE = GBT_add_data(gb_sai, PHDATA::ROOT->use, "_TYPE", GB_STRING);
342  if (!gb_TYPE) error = GB_await_error();
343  }
344 
345  if (!error && !PHDATA::ROOT->markerline) {
346  error = "Nothing calculated yet";
347  }
348 
349  if (!error) {
351  long minhom = main_win->get_root()->awar(AWAR_PHYLO_FILTER_MINHOM)->read_int();
352  long maxhom = main_win->get_root()->awar(AWAR_PHYLO_FILTER_MAXHOM)->read_int();
353  long startcol = main_win->get_root()->awar(AWAR_PHYLO_FILTER_STARTCOL)->read_int();
354  long stopcol = main_win->get_root()->awar(AWAR_PHYLO_FILTER_STOPCOL)->read_int();
355  long len = PHDATA::ROOT->get_seq_len();
356  char *bits = ARB_calloc<char>(len+1);
357  int x;
358  float *markerline = PHDATA::ROOT->markerline;
359 
360  for (x=0; x<len; x++) {
361  int bit;
362 
363  if (x < startcol || x>stopcol) {
364  bit = 0;
365  }
366  else {
367  float ml = markerline[x];
368 
369  if (ml>=0.0 && ml>=minhom && ml<=maxhom) bit = 1;
370  else bit = 0;
371 
372  }
373  bits[x] = '0'+bit;
374  }
375 
376  error = GB_write_bits(gb_bits, bits, len, "0");
377 
378  if (!error) {
379  char buffer[1024];
380  sprintf(buffer, "FMX: Filter by Maximum Frequency: "
381  "Start %li; Stop %li; Minhom %li%%; Maxhom %li%%",
382  startcol, stopcol, minhom, maxhom);
383 
384  error = GB_write_string(gb_TYPE, buffer);
385  }
386  free(bits);
387  }
388  free(fname);
389  aw_message_if(ta.close(error));
390 }
391 
392 
393 static AW_window *PH_save_markerline(AW_root *root, PH_root *ph_root, int multi_line) {
394  // multi_line ==1 -> save three SAI's usable as column percentage
395 
397 
398  AW_window_simple *aws = new AW_window_simple;
399 
400  if (multi_line) {
401  aws->init(root, "EXPORT_FREQUENCY_LINES", "Export Frequency Lines");
402  }
403  else {
404  aws->init(root, "EXPORT_MARKER_LINE", "Export Marker Line");
405  }
406 
407  aws->load_xfig("phylo/save_markerline.fig");
408 
409  aws->callback(AW_POPDOWN);
410  aws->at("close");
411  aws->create_button("CLOSE", "CLOSE", "C");
412 
413  aws->callback(makeHelpCallback("ph_export_markerline.hlp"));
414  aws->at("help");
415  aws->create_button("HELP", "HELP", "H");
416 
417  aws->at("name");
418  aws->create_input_field(AWAR_PHYLO_MARKERLINENAME);
419 
420  aws->at("box");
422 
423  aws->at("save");
424  if (multi_line) aws->callback(makeWindowCallback(PH_save_ml_multiline_cb, ph_root));
425  else aws->callback(makeWindowCallback(PH_save_ml_cb, ph_root));
426  aws->create_button("EXPORT", "EXPORT", "E");
427 
428  return aws;
429 }
430 
431 static AW_window *create_phyl_main_window(AW_root *aw_root, PH_root *ph_root) {
433  awm->init(aw_root, "ARB_PHYLO", "ARB_PHYLO", 830, 630);
434 
435  // create menus and menu inserts with callbacks
436 
437  const GcChangedCallback gcChangedCb = makeGcChangedCallback(gc_changed_cb);
438 
439  AW_gc_manager *gcmiddle =
440  AW_manage_GC(awm,
441  awm->get_window_id(),
444  gcChangedCb,
445  "#C4B6D0",
446  "#SEQUENCE$#000000",
447  "#MARKER$#E0F570",
448  "NOT_MARKER$#A270C0",
449  NULp);
450 
451  AW_manage_GC(awm,
452  "ARB_PHYLO_BOTTOM",
455  gcChangedCb,
456  "lightgrey",
457  "#FOOTER",
458  NULp);
459 
460 
461 #if defined(DEBUG)
462  AWT_create_debug_menu(awm);
463 #endif // DEBUG
464 
465  // File menu
466  awm->create_menu("File", "F");
467  awm->insert_menu_topic("export_filter", "Export Filter", "E", "ph_export_markerline.hlp", AWM_ALL, makeCreateWindowCallback(PH_save_markerline, ph_root, 0));
468  awm->insert_menu_topic("export_freq", "Export Frequencies", "F", "ph_export_markerline.hlp", AWM_ALL, makeCreateWindowCallback(PH_save_markerline, ph_root, 1));
469  insert_macro_menu_entry(awm, false);
470 
471  awm->insert_menu_topic("quit", "Quit", "Q", "quit.hlp", AWM_ALL, makeWindowCallback(ph_exit, ph_root));
472 
473  // Calculate menu
474  awm->create_menu("Calculate", "C");
475  awm->insert_menu_topic("calc_column_filter", "Column Filter", "F", "no help", AWM_ALL, makeWindowCallback(ph_calc_filter_cb));
476 
477  // Config menu
478  awm->create_menu("Config", "o");
479  awm->insert_menu_topic("config_column_filter", "Column Filter", "F", "no help", AWM_ALL, PH_create_filter_window);
480 
481  // Properties menu
482  awm->create_menu("Properties", "P");
483  awm->insert_menu_topic("props_menu", "Frame settings ...", "F", "props_frame.hlp", AWM_ALL, AW_preset_window);
484  awm->insert_menu_topic("props_data", "Colors and Fonts ...", "C", "color_props.hlp", AWM_ALL, makeCreateWindowCallback(AW_create_gc_window, gcmiddle));
485  awm->sep______________();
487  awm->sep______________();
488  awm->insert_menu_topic("save_props", "Save Properties (phylo.arb)", "S", "savedef.hlp", AWM_ALL, AW_save_properties);
489 
490 
491  // set window areas
492  awm->set_info_area_height(30);
493  awm->at(5, 2);
494  awm->auto_space(5, -2);
495 
496  awm->callback(makeWindowCallback(ph_exit, ph_root));
497  awm->button_length(0);
498  awm->help_text("quit.hlp");
499  awm->create_button("QUIT", "QUIT");
500 
501  awm->callback(makeHelpCallback("phylo.hlp"));
502  awm->button_length(0);
503  awm->create_button("HELP", "HELP", "H");
504 
505 
506  awm->set_bottom_area_height(120);
507 
508  awm->set_expose_callback(AW_MIDDLE_AREA, makeWindowCallback(expose_cb));
509  awm->set_resize_callback(AW_MIDDLE_AREA, makeWindowCallback(resize_cb));
510  awm->set_expose_callback(AW_BOTTOM_AREA, makeWindowCallback(display_status_cb));
511  awm->set_resize_callback(AW_BOTTOM_AREA, makeWindowCallback(display_status_cb));
512 
513  return awm;
514 }
515 
516 
517 static AW_window *create_select_alignment_window(AW_root *aw_root, AW_window *main_window, PH_root *ph_root) {
518  AW_window_simple *aws = new AW_window_simple;
519 
520  aws->init(aw_root, "SELECT_ALIGNMENT", "ARB_PHYLO: Select alignment");
521  aws->load_xfig("phylo/select_ali.fig");
522  aws->button_length(10);
523 
524  aws->at("which_alignment");
526 
527  aws->auto_space(10, 10);
528 
529  aws->at("ok");
530  aws->callback(makeWindowCallback(startup_sequence_cb, main_window, ph_root));
531  aws->create_button("OK", "Ok", "D");
532 
533  aws->callback(makeWindowCallback(ph_exit, ph_root));
534  aws->create_button("ABORT", "Abort", "D");
535 
536  return aws;
537 }
538 
539 
540 
542  memset((char *) this, 0, sizeof(PH_used_windows));
543 }
544 
545 // initialize 'globals'
549 
550 static void create_variables(AW_root *aw_root, AW_default def, GBDATA *gb_main) {
551  aw_root->awar_string(AWAR_PHYLO_ALIGNMENT, "", def);
552  aw_root->awar_string(AWAR_PHYLO_FILTER_FILTER, "", def);
553  PH_create_filter_variables(aw_root, def, gb_main);
554 }
555 
556 int ARB_main(int argc, char *argv[]) {
557  aw_initstatus();
558 
559  GB_shell shell;
560  AW_root *aw_root = AWT_create_root("phylo.arb", "ARB_PHYLO", need_macro_ability());
561 
562  int exitcode = EXIT_SUCCESS;
563  if (argc > 2 || (argc == 2 && strcmp(argv[1], "--help") == 0)) {
564  fprintf(stderr, "Usage: arb_phylo [database]\n");
565  exitcode = EXIT_FAILURE;
566  }
567  else {
568  const char *db_server = (argc == 2 ? argv[1] : ":");
569 
570  PH_used_windows *puw = new PH_used_windows;
571  PH_display *phd = new PH_display;
572 
573  PH_root *ph_root = new PH_root;
574  GB_ERROR error = ph_root->open(db_server);
575 
576  if (!error) error = configure_macro_recording(aw_root, "ARB_PHYLO", ph_root->get_gb_main());
577  if (!error) {
578  GBDATA *gb_main = ph_root->get_gb_main();
579 
580  // create arb_phylo awars :
581  create_variables(aw_root, AW_ROOT_DEFAULT, gb_main);
582  ARB_init_global_awars(aw_root, AW_ROOT_DEFAULT, gb_main);
583 #if defined(DEBUG)
584  AWT_create_db_browser_awars(aw_root, AW_ROOT_DEFAULT);
585 #endif // DEBUG
586 
587 #if defined(DEBUG)
588  AWT_announce_db_to_browser(gb_main, GBS_global_string("ARB-database (%s)", db_server));
589 #endif // DEBUG
590 
591  // create main window :
592 
593  puw->phylo_main_window = create_phyl_main_window(aw_root, ph_root);
594  puw->windowList = puw;
595 
596  phd->ph_display = phd;
597 
598  // loading database
599  GB_push_transaction(gb_main);
600 
601  ConstStrArray alignment_names;
602  GBT_get_alignment_names(alignment_names, gb_main);
603 
604  int num_alignments;
605  for (num_alignments = 0; alignment_names[num_alignments]; num_alignments++) {}
606 
607  if (num_alignments > 1) {
608  char *defaultAli = GBT_get_default_alignment(gb_main);
609  if (!defaultAli) {
611  defaultAli = ARB_strdup("");
612  }
613  aw_root->awar(AWAR_PHYLO_ALIGNMENT)->write_string(defaultAli);
614  create_select_alignment_window(aw_root, puw->phylo_main_window, ph_root)->show();
615  free(defaultAli);
616  }
617  else {
618  aw_root->awar(AWAR_PHYLO_ALIGNMENT)->write_string(alignment_names[0]);
620  }
621  GB_pop_transaction(gb_main);
622 
624  aw_root->main_loop();
625  }
626 
627  if (error) {
628  aw_popup_exit(error);
629  exitcode = EXIT_FAILURE;
630  }
631  }
632 
633  delete aw_root;
634  return exitcode;
635 }
636 
#define AWAR_PHYLO_FILTER_STARTCOL
Definition: phylo.hxx:29
void display_status_cb()
Definition: PH_display.cxx:331
const char * GB_ERROR
Definition: arb_core.h:25
static PH_display * ph_display
Definition: PH_display.hxx:44
AW_HEADER_MAIN const char * filter_text[FILTER_MODES]
Definition: PH_main.cxx:29
GB_ERROR GB_write_bits(GBDATA *gbd, const char *bits, long size, const char *c_0)
Definition: arbdb.cxx:1418
void set_resize_callback(AW_area area, const WindowCallback &wcb)
Definition: AW_window.cxx:816
AW_DB_selection * awt_create_SAI_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname, const SaiSelectionlistFilterCallback &fcb)
void GB_remove_on_exit(const char *filename)
Definition: adsocket.cxx:1258
void button_length(int length)
Definition: AW_at.cxx:288
static void resize_cb()
Definition: PH_main.cxx:110
AW_device * get_device(AW_area area)
Definition: AW_window.cxx:537
GBDATA * GB_child(GBDATA *father)
Definition: adquery.cxx:322
__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
Definition: arbdb.h:69
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const WindowCallback &wcb)
Definition: AW_window.cxx:595
GB_ERROR GB_write_string(GBDATA *gbd, const char *s)
Definition: arbdb.cxx:1387
AW_window * phylo_main_window
Definition: phwin.hxx:21
void load_xfig(const char *file, bool resize=true)
Definition: AW_window.cxx:720
static AW_window * PH_save_markerline(AW_root *root, PH_root *ph_root, int multi_line)
Definition: PH_main.cxx:393
const char * get_window_id() const
Definition: aw_window.hxx:375
int ARB_main(int argc, char *argv[])
Definition: PH_main.cxx:556
void at(int x, int y)
Definition: AW_at.cxx:93
void aw_initstatus()
Definition: AW_status.cxx:966
void expose_cb()
Definition: PH_main.cxx:103
void GBT_get_alignment_names(ConstStrArray &names, GBDATA *gbd)
Definition: adali.cxx:317
char * ARB_strdup(const char *str)
Definition: arb_string.h:27
long read_int() const
Definition: AW_awar.cxx:184
AW_window * PH_create_filter_window(AW_root *aw_root)
Definition: PH_filt.cxx:416
AW_awar * set_minmax(float min, float max)
Definition: AW_awar.cxx:530
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:203
long GBT_get_alignment_len(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:833
void AW_POPDOWN(AW_window *window)
Definition: AW_window.cxx:52
void AW_insert_common_property_menu_entries(AW_window_menu_modes *awmm)
Definition: AW_preset.cxx:1445
#define EXIT_SUCCESS
Definition: arb_a2ps.c:154
__ATTR__USERESULT GB_ERROR configure_macro_recording(AW_root *aw_root, const char *client_id, GBDATA *gb_main)
Definition: trackers.cxx:459
GB_ERROR open(const char *db_server)
Definition: PH_root.cxx:14
static bool valid_alignment_selected(AW_root *aw_root, GBDATA *gb_main)
Definition: PH_main.cxx:38
AW_gc_manager * AW_manage_GC(AW_window *aww, const char *gc_base_name, AW_device *device, int base_drag, AW_GCM_AREA area, const GcChangedCallback &changecb, const char *default_background_color,...)
Definition: AW_preset.cxx:969
char buffer[MESSAGE_BUFFERSIZE]
Definition: seq_search.cxx:34
GB_ERROR GB_push_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2494
void activate()
Definition: aw_window.hxx:365
GB_ERROR GB_delete(GBDATA *&source)
Definition: arbdb.cxx:1916
char * GB_set_cache_size(GBDATA *gbd, size_t size)
Definition: adcache.cxx:294
const char * read_char_pntr() const
Definition: AW_awar.cxx:168
GcChange
Definition: aw_base.hxx:94
NOT4PERL GBDATA * GBT_add_data(GBDATA *species, const char *ali_name, const char *key, GB_TYPES type) __ATTR__DEPRECATED_TODO("better use GBT_create_sequence_data()")
Definition: adali.cxx:597
GB_ERROR GB_await_error()
Definition: arb_msg.cxx:342
void show()
Definition: AW_window.cxx:1683
WindowCallback makeHelpCallback(const char *helpfile)
Definition: aw_window.hxx:106
GB_CSTR GB_read_key_pntr(GBDATA *gbd)
Definition: arbdb.cxx:1656
#define AWAR_PHYLO_FILTER_STOPCOL
Definition: phylo.hxx:30
void ph_calc_filter_cb()
Definition: PH_display.cxx:44
static void gc_changed_cb(GcChange whatChanged)
Definition: PH_main.cxx:117
void GBK_terminate(const char *error) __ATTR__NORETURN
Definition: arb_msg.cxx:509
void clear_window()
Definition: PH_display.hxx:50
static PH_used_windows * windowList
Definition: phwin.hxx:20
void AW_save_properties(AW_window *aw)
Definition: AW_preset.cxx:1452
float * markerline
Definition: phylo.hxx:153
void GB_clear_error()
Definition: arb_msg.cxx:354
void set_expose_callback(AW_area area, const WindowCallback &wcb)
Definition: AW_window.cxx:765
void create_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:472
AW_window * AW_create_gc_window(AW_root *aw_root, AW_gc_manager *gcman)
Definition: AW_preset.cxx:1373
void help_text(const char *id)
Definition: AW_window.cxx:116
static void error(const char *msg)
Definition: mkptypes.cxx:96
void init(AW_root *root, const char *wid, const char *windowname, int width, int height)
Definition: AW_window.cxx:2402
FILE * GB_fopen_tempfile(const char *filename, const char *fmode, char **res_fullname)
Definition: adsocket.cxx:1176
AW_window * AW_preset_window(AW_root *root)
Definition: AW_preset.cxx:1920
#define ph_assert(cond)
Definition: phylo.hxx:24
void PH_create_filter_variables(AW_root *aw_root, AW_default default_file, GBDATA *gb_main)
Definition: PH_filt.cxx:371
void ph_view_species_cb()
Definition: PH_display.cxx:27
UserActionTracker * need_macro_ability()
Definition: trackers.cxx:455
char * read_string() const
Definition: AW_awar.cxx:198
#define AWAR_PHYLO_FILTER_MAXHOM
Definition: phylo.hxx:32
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
GB_ERROR GB_pop_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2524
#define AWAR_PHYLO_FILTER_MINHOM
Definition: phylo.hxx:31
Definition: arbdb.h:86
#define EXIT_FAILURE
Definition: arb_a2ps.c:157
static AW_window_menu_modes_opengl * awm
void unlink_awars_from_DB(GBDATA *gb_main)
Definition: AW_root.cxx:635
static void PH_save_ml_cb(AW_window *aww, PH_root *ph_root)
Definition: PH_main.cxx:295
#define AW_HEADER_MAIN
Definition: aw_window.hxx:36
AW_DB_selection * awt_create_ALI_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname, const char *ali_type_match)
char * GB_unique_filename(const char *name_prefix, const char *suffix)
Definition: adsocket.cxx:1233
void main_loop()
Definition: AW_root.cxx:625
AW_root * AWT_create_root(const char *properties, const char *program, UserActionTracker *user_tracker)
void set_info_area_height(int height)
Definition: AW_window.cxx:796
void display()
Definition: PH_display.cxx:150
void set_bottom_area_height(int height)
Definition: AW_window.cxx:801
void auto_space(int xspace, int yspace)
Definition: AW_at.cxx:259
GB_ERROR close(GB_ERROR error)
Definition: arbdbpp.cxx:35
const int FILTER_MODES
Definition: phylo.hxx:52
#define PH_DB_CACHE_SIZE
Definition: phylo.hxx:55
void resized()
Definition: PH_display.cxx:98
static AW_window * create_phyl_main_window(AW_root *aw_root, PH_root *ph_root)
Definition: PH_main.cxx:431
GBDATA * get_gb_main() const
Definition: phylo.hxx:103
static AW_window * create_select_alignment_window(AW_root *aw_root, AW_window *main_window, PH_root *ph_root)
Definition: PH_main.cxx:517
void aw_message(const char *msg)
Definition: AW_status.cxx:1142
void hide()
Definition: AW_window.cxx:1835
void insert_macro_menu_entry(AW_window *awm, bool prepend_separator)
Definition: macro_gui.cxx:233
AW_root * get_root()
Definition: aw_window.hxx:359
__ATTR__NORETURN void aw_popup_exit(const char *msg)
void shutdown_macro_recording(AW_root *aw_root)
Definition: trackers.cxx:475
#define NULp
Definition: cxxforward.h:116
GB_ERROR GBT_set_startup_alignment(GBDATA *gb_main, const char *alignment_name)
Definition: adali.cxx:768
#define __ATTR__NORETURN
Definition: attributes.h:56
static void startup_sequence_cb(AW_window *alisel_window, AW_window *main_window, PH_root *ph_root)
Definition: PH_main.cxx:48
GB_ERROR write_string(const char *aw_string)
char * GBT_get_default_alignment(GBDATA *gb_main)
Definition: adali.cxx:747
void sep______________()
Definition: AW_window.cxx:753
static PHDATA * ROOT
Definition: phylo.hxx:151
void AWT_install_cb_guards()
GBDATA * GB_nextChild(GBDATA *child)
Definition: adquery.cxx:326
#define FALLTHROUGH
Definition: cxxforward.h:130
GBDATA * GBT_find_or_create_SAI(GBDATA *gb_main, const char *name)
Definition: aditem.cxx:65
char * load(char *&use)
Definition: PH_data.cxx:28
GB_transaction ta(gb_var)
void callback(const WindowCallback &cb)
Definition: AW_window.cxx:133
long get_seq_len()
Definition: phylo.hxx:172
GBDATA * gb_main
Definition: adname.cxx:32
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:570
static void PH_save_ml_multiline_cb(AW_window *aww, PH_root *ph_root)
Definition: PH_main.cxx:270
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
Definition: adquery.cxx:531
static GB_ERROR PH_create_ml_multiline_SAI(GB_CSTR sai_name, int nr, GBDATA **gb_sai_ptr, PH_root *ph_root)
Definition: PH_main.cxx:131
const char * GB_CSTR
Definition: arbdb_base.h:25
#define AWAR_PHYLO_FILTER_FILTER
Definition: phylo.hxx:27
#define AWAR_PHYLO_MARKERLINENAME
Definition: phylo.hxx:39
#define AW_ROOT_DEFAULT
Definition: aw_base.hxx:106
GB_ERROR ph_check_initialized()
Definition: PH_display.cxx:39
static void create_variables(AW_root *aw_root, AW_default def, GBDATA *gb_main)
Definition: PH_main.cxx:550
static __ATTR__NORETURN void ph_exit(AW_window *aw_window, PH_root *ph_root)
Definition: PH_main.cxx:86
GB_ERROR write_int(long aw_int)
void aw_message_if(GB_ERROR error)
Definition: aw_msg.hxx:21
void GB_close(GBDATA *gbd)
Definition: arbdb.cxx:655
#define AWAR_PHYLO_ALIGNMENT
Definition: phylo.hxx:26
void create_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, const char *color=NULp)
Definition: AW_button.cxx:448
bool digit(int ch)