ARB
SEC_db.cxx
Go to the documentation of this file.
1 // =============================================================== //
2 // //
3 // File : SEC_db.cxx //
4 // Purpose : db interface //
5 // //
6 // Coded by Ralf Westram (coder@reallysoft.de) in August 2007 //
7 // Institute of Microbiology (Technical University Munich) //
8 // http://www.arb-home.de/ //
9 // //
10 // =============================================================== //
11 
12 #include "SEC_graphic.hxx"
13 #include "SEC_root.hxx"
14 #include "SEC_bonddef.hxx"
15 #include "SEC_toggle.hxx"
16 
17 #include <aw_awars.hxx>
18 #include <aw_file.hxx>
19 #include <aw_msg.hxx>
20 #include <aw_root.hxx>
21 #include <ed4_extern.hxx>
22 #include <arbdbt.h>
23 #include <ad_cb.h>
24 
25 #include <arb_defs.h>
26 
27 using namespace std;
28 
29 // -----------------------------------
30 // member function callbacks
31 
32 typedef void (SEC_db_interface::*interface_cb)(const SEC_dbcb *);
33 
34 struct SEC_dbcb {
37 
38  SEC_dbcb(SEC_db_interface *db, interface_cb cb) : instance(db), member_fun(cb) {}
39  void call() const { (instance->*member_fun)(this); }
40 };
41 
42 static void sec_dbcb(UNFIXED, const SEC_dbcb *cb) {
43  cb->call();
44 }
45 
46 // ----------------------
47 // SEC_seq_data
48 
49 SEC_seq_data::SEC_seq_data(GBDATA *gb_item, const char *aliname, const SEC_dbcb *cb) {
50  gb_name = GB_search(gb_item, "name", GB_FIND);
51  gb_data = GBT_find_sequence(gb_item, aliname);
52  change_cb = cb;
53  len = GB_read_string_count(gb_data);
54  Data = GB_read_string(gb_data);
55 
56  if (gb_name) GB_add_callback(gb_name, GB_CB_CHANGED_OR_DELETED, makeDatabaseCallback(sec_dbcb, change_cb));
57  if (gb_data) GB_add_callback(gb_data, GB_CB_CHANGED_OR_DELETED, makeDatabaseCallback(sec_dbcb, change_cb));
58 }
59 
61  if (gb_name) GB_remove_callback(gb_name, GB_CB_CHANGED_OR_DELETED, makeDatabaseCallback(sec_dbcb, change_cb));
62  if (gb_data) GB_remove_callback(gb_data, GB_CB_CHANGED_OR_DELETED, makeDatabaseCallback(sec_dbcb, change_cb));
63  free(Data);
64 }
65 
66 // -------------------
67 // pair defs
68 
69 #define AWAR_PAIRS(type) AWAR_SECEDIT_##type##_PAIRS
70 #define AWAR_PCHAR(type) AWAR_SECEDIT_##type##_PAIR_CHAR
71 
73  const char *awar_pairs;
74  const char *awar_pairchar;
75  const char *default_pairs;
76  const char *default_pairchar;
77 };
78 
79 #define PAIR_TYPES 5
81  { AWAR_PAIRS(STRONG), AWAR_PCHAR(STRONG), "GC AU AT", "-" },
82  { AWAR_PAIRS(NORMAL), AWAR_PCHAR(NORMAL), "GU GT", "." },
83  { AWAR_PAIRS(WEAK), AWAR_PCHAR(WEAK), "GA", "o" },
84  { AWAR_PAIRS(NO), AWAR_PCHAR(NO), "AA AC CC CU CT GG UU TT TU", "" },
85  { AWAR_PAIRS(USER), AWAR_PCHAR(USER), "", "" },
86 };
87 
88 GB_ERROR SEC_bond_def::update(AW_root *aw_root, const char *changed_awar_name) {
90 
91  if (changed_awar_name) {
92  int changed_pair_idx = -1;
93  for (int i = 0; i<PAIR_TYPES; ++i) {
94  if (strcmp(changed_awar_name, pairdef[i].awar_pairs) == 0) {
95  changed_pair_idx = i;
96  break;
97  }
98  }
99 
100  sec_assert(changed_pair_idx != -1);
101 
102  if (changed_pair_idx != -1) {
103  char *content = aw_root->awar(changed_awar_name)->read_string();
104 
105  for (int i = 0; i<PAIR_TYPES; ++i) {
106  if (i != changed_pair_idx) { // correct other pair strings
107  clear();
108  AW_awar *awar = aw_root->awar(pairdef[i].awar_pairs);
109 
110  char *oldP = awar->read_string();
111 
112  insert(oldP, '#');
113  insert(content, ' ');
114 
115  char *newP = get_pair_string('#');
116 
117  if (strcmp(oldP, newP) != 0) awar->write_string(newP);
118 
119  free(newP);
120  free(oldP);
121  }
122  }
123  free(content);
124  }
125  }
126 
127  clear();
128  for (int i = 0; !error && i<PAIR_TYPES; ++i) {
129  char *pairs = aw_root->awar(pairdef[i].awar_pairs)->read_string();
130  char *pairchar = aw_root->awar(pairdef[i].awar_pairchar)->read_string();
131 
132  error = insert(pairs, pairchar[0]);
133 
134  free(pairchar);
135  free(pairs);
136  }
137 
138  return error;
139 }
140 
141 static void pair_def_changed_cb(AW_root *aw_root, SEC_db_interface *db, const char *awar_name) {
142  AWT_auto_refresh allowed_on(db->canvas());
143  GB_ERROR err = db->bonds()->update(aw_root, awar_name);
144  if (err) aw_message(err);
145  db->canvas()->request_refresh();
146 }
147 
149  AW_root *aw_root = db->awroot();
150 
151  for (int i = 0; i<PAIR_TYPES; ++i) {
152  PairDefinition& pd = pairdef[i];
153  aw_root->awar(pd.awar_pairs) ->add_callback(makeRootCallback(pair_def_changed_cb, db, pd.awar_pairs));
154  aw_root->awar(pd.awar_pairchar)->add_callback(makeRootCallback(pair_def_changed_cb, db, (const char *)NULp));
155  }
156 
157  pair_def_changed_cb(aw_root, db, NULp);
158 }
159 
160 // --------------------------------------------------------------------------------
161 
162 void SEC_displayParams::reread(AW_root *aw_root, const ED4_plugin_host& host) {
163  show_helixNrs = aw_root->awar(AWAR_SECEDIT_SHOW_HELIX_NRS)->read_int();
164  distance_between_strands = aw_root->awar(AWAR_SECEDIT_DIST_BETW_STRANDS)->read_float();
165  show_bonds = (ShowBonds)aw_root->awar(AWAR_SECEDIT_SHOW_BONDS)->read_int();
166  show_curpos = (ShowCursorPos)aw_root->awar(AWAR_SECEDIT_SHOW_CURPOS)->read_int();
167 
168  hide_bases = aw_root->awar(AWAR_SECEDIT_HIDE_BASES)->read_int();
169  show_ecoli_pos = aw_root->awar(AWAR_SECEDIT_SHOW_ECOLI_POS)->read_int();
170  display_search = aw_root->awar(AWAR_SECEDIT_DISPLAY_SEARCH)->read_int();
171  display_sai = aw_root->awar(AWAR_SECEDIT_DISPLAY_SAI)->read_int() && host.SAIs_visualized();
172 
173  show_strSkeleton = aw_root->awar(AWAR_SECEDIT_SHOW_STR_SKELETON)->read_int();
174  skeleton_thickness = aw_root->awar(AWAR_SECEDIT_SKELETON_THICKNESS)->read_int();
175  bond_thickness = aw_root->awar(AWAR_SECEDIT_BOND_THICKNESS)->read_int();
176 
177  edit_rightward = aw_root->awar(AWAR_EDIT_RIGHTWARD)->read_int();
178 
179 #if defined(DEBUG)
180  show_debug = aw_root->awar(AWAR_SECEDIT_SHOW_DEBUG)->read_int();
181 #endif // DEBUG
182 }
183 
184 // --------------------------
185 // SEC_db_interface
186 
187 void SEC_db_interface::reload_sequence(const SEC_dbcb *cb) {
189  AWT_auto_refresh allowed_on(scr);
190 
191  char *species_name = aw_root->awar(AWAR_SPECIES_NAME)->read_string();
192  bool had_sequence = sequence;
193  GBDATA *gb_species = GBT_find_species(gb_main, species_name);
194 
195  delete sequence;
196  sequence = gb_species ? new SEC_seq_data(gb_species, aliname, cb) : NULp;
197  Host.announce_current_species(species_name);
198 
199  if (bool(sequence) != had_sequence) scr->request_zoom_reset();
200  if (sequence) gfx->request_update(SEC_UPDATE_SHOWN_POSITIONS);
201 
202  scr->request_refresh();
203 
204  free(species_name);
205 }
206 
207 void SEC_db_interface::reload_ecoli(const SEC_dbcb *cb) {
209  AWT_auto_refresh allowed_on(scr);
210 
211  delete ecoli_seq;
212  delete Ecoli;
213 
214  GBDATA *gb_ecoli = GBT_find_SAI(gb_main, "ECOLI");
215  if (gb_ecoli) {
216  ecoli_seq = new SEC_seq_data(gb_ecoli, aliname, cb);
217  Ecoli = new BI_ecoli_ref;
218 
219  Ecoli->init(ecoli_seq->sequence(), ecoli_seq->length());
220  }
221  else {
222  ecoli_seq = NULp;
223  Ecoli = NULp;
224  }
225 
226  gfx->request_update(SEC_UPDATE_SHOWN_POSITIONS);
227  scr->request_refresh();
228 }
229 
230 void SEC_db_interface::reload_helix(const SEC_dbcb *cb) {
232  AWT_auto_refresh allowed_on(scr);
233 
234  delete helix_nr; helix_nr = NULp;
235  delete helix_pos; helix_pos = NULp;
236  delete Helix; Helix = NULp;
237 
238  char *helix_pos_name = GBT_get_default_helix(gb_main);
239  GBDATA *gb_helix_pos = GBT_find_SAI(gb_main, helix_pos_name);
240  if (gb_helix_pos) {
241  char *helix_nr_name = GBT_get_default_helix_nr(gb_main);
242  GBDATA *gb_helix_nr = GBT_find_SAI(gb_main, helix_nr_name);
243 
244  if (gb_helix_nr) {
245  helix_pos = new SEC_seq_data(gb_helix_pos, aliname, cb);
246  helix_nr = new SEC_seq_data(gb_helix_nr, aliname, cb);
247  Helix = new BI_helix;
248 
249  GB_ERROR error = Helix->initFromData(helix_nr->sequence(), helix_pos->sequence(), helix_pos->length());
250  if (error) {
251  error = ta.close(error);
252  aw_message(error);
253  }
254  }
255 
256  free(helix_nr_name);
257  }
258  free(helix_pos_name);
259 
260  gfx->request_update(static_cast<SEC_update_request>(SEC_UPDATE_SHOWN_POSITIONS|SEC_UPDATE_RELOAD));
261  scr->request_refresh();
262 }
263 
264 void SEC_db_interface::update_positions(const SEC_dbcb *) {
265  AWT_auto_refresh allowed_on(scr);
266  displayBindingHelixPositions = aw_root->awar(AWAR_SECEDIT_DISPPOS_BINDING)->read_int();
267  displayEcoliPositions = aw_root->awar(AWAR_SECEDIT_DISPPOS_ECOLI)->read_int();
268 
269  gfx->sec_root->nail_cursor();
270  gfx->request_update(SEC_UPDATE_SHOWN_POSITIONS);
271  scr->request_refresh();
272 }
273 
274 void SEC_db_interface::relayout(const SEC_dbcb *) {
275  SEC_root *root = secroot();
276  AWT_auto_refresh allowed_on(scr);
277  root->reread_display_params(awroot(), Host);
278  root->nail_cursor();
279  gfx->request_update(SEC_UPDATE_RECOUNT);
280  scr->request_refresh();
281 }
282 
283 void SEC_db_interface::refresh(const SEC_dbcb *) {
284  SEC_root *root = secroot();
285  AWT_auto_refresh allowed_on(scr);
286  root->reread_display_params(awroot(), Host);
287  scr->request_refresh();
288 }
289 
290 void SEC_root::set_cursor(int abspos) {
291 
292  nail_cursor();
293  int nailedPos = nailedAbsPos;
294 
295  cursorAbsPos = abspos;
296 
297  {
298  AWT_auto_refresh allowed_on(db->canvas()); // @@@ try up-scope!
299  db->canvas()->request_refresh();
300  }
301 
302  nailedAbsPos = nailedPos;
303  position_cursor(false, false);
304 }
305 
306 void SEC_db_interface::cursor_changed(const SEC_dbcb *) {
307  SEC_root *root = secroot();
308  int seq_pos = bio2info(aw_root->awar_int(AWAR_CURSOR_POSITION)->read_int());
309 
310  root->set_cursor(seq_pos);
311 }
312 
313 void SEC_db_interface::alilen_changed(const SEC_dbcb *) {
314  AWT_auto_refresh allowed_on(scr);
315 #if defined(WARN_TODO)
316 #warning @@@reread alilen
317 #warning test changing ali length!
318 #endif
319  gfx->request_update(SEC_UPDATE_RELOAD);
320  scr->request_refresh();
321 }
322 
323 // --------------------------------------------------------------------------------
324 
325 static const char *update_pos_awars[] = {
328  NULp
329 };
330 
331 static const char *relayout_awars[] = {
333  NULp
334 };
335 
336 static const char *refresh_awars[] = {
349 #if defined(DEBUG)
351 #endif // DEBUG
352  NULp
353 };
354 
355 void SEC_db_interface::bind_awars(const char **awars, SEC_dbcb *cb) {
356  RootCallback awarcb = makeRootCallback(sec_dbcb, cb);
357  for (int i = 0; awars[i]; ++i) {
358  aw_root->awar(awars[i])->add_callback(awarcb);
359  }
360 }
361 
362 // --------------------------------------------------------------------------------
363 
364 static void create_awars(AW_root *aw_root, AW_default def) {
365  aw_root->awar_int(AWAR_SECEDIT_BASELINEWIDTH, 0, def)->set_minmax(0, 10);
366  aw_root->awar_string(AWAR_FOOTER);
367 
368  {
369  char *dir = ARB_strdup(GB_path_in_arbprop("secondary_structure"));
370  AW_create_fileselection_awars(aw_root, AWAR_SECEDIT_SAVEDIR, dir, ".ass", "noname.ass");
371  free(dir);
372  }
373 
374  aw_root->awar_float(AWAR_SECEDIT_DIST_BETW_STRANDS, 1, def)->set_minmax(0.01, 40);
375  aw_root->awar_int (AWAR_SECEDIT_SKELETON_THICKNESS, 1, def)->set_minmax(1, 10);
376  aw_root->awar_int (AWAR_SECEDIT_BOND_THICKNESS, 1, def)->set_minmax(1, 10);
377 
378 #if defined(DEBUG)
379  aw_root->awar_int(AWAR_SECEDIT_SHOW_DEBUG, 0, def);
380 #endif // DEBUG
381  aw_root->awar_int(AWAR_SECEDIT_SHOW_HELIX_NRS, 0, def);
382  aw_root->awar_int(AWAR_SECEDIT_SHOW_ECOLI_POS, 0, def);
383  aw_root->awar_int(AWAR_SECEDIT_SHOW_STR_SKELETON, 0, def);
384  aw_root->awar_int(AWAR_SECEDIT_HIDE_BASES, 0, def);
387  aw_root->awar_int(AWAR_SECEDIT_DISPLAY_SAI, 0, def);
388  aw_root->awar_int(AWAR_SECEDIT_DISPLAY_SEARCH, 0, def);
389  aw_root->awar_int(AWAR_SECEDIT_DISPPOS_BINDING, 0, def);
390  aw_root->awar_int(AWAR_SECEDIT_DISPPOS_ECOLI, 1, def);
391 
392  for (int i = 0; i<PAIR_TYPES; ++i) {
393  PairDefinition& pd = pairdef[i];
394  aw_root->awar_string(pd.awar_pairs, pd.default_pairs);
395  aw_root->awar_string(pd.awar_pairchar, pd.default_pairchar);
396  }
397 }
398 
399 // --------------------------------------------------------------------------------
400 
402  sequence(NULp),
403  Host(host_),
404  displayEcoliPositions(false),
405  ecoli_seq(NULp),
406  Ecoli(NULp),
407  displayBindingHelixPositions(true),
408  helix_nr(NULp),
409  helix_pos(NULp),
410  Helix(NULp),
411  gfx(Gfx),
412  scr(Scr),
413  gb_main(gfx->gb_main),
414  aw_root(gfx->aw_root)
415 {
416  AWT_auto_refresh allowed_on(Scr);
417  GB_transaction ta(gb_main);
418 
419  create_awars(aw_root, AW_ROOT_DEFAULT);
420 
421  aliname = GBT_get_default_alignment(gb_main);
422  sec_assert(aliname);
423  ali_length = GBT_get_alignment_len(gb_main, aliname);
424  displayPos = new bool[ali_length];
425  bonddef = new SEC_bond_def(GBT_get_alignment_type(gb_main, aliname));
426 
427  // awar and DB callbacks:
428 
429  sequence_cb = new SEC_dbcb(this, &SEC_db_interface::reload_sequence);
430  ecoli_cb = new SEC_dbcb(this, &SEC_db_interface::reload_ecoli);
431  helix_cb = new SEC_dbcb(this, &SEC_db_interface::reload_helix);
432  updatepos_cb = new SEC_dbcb(this, &SEC_db_interface::update_positions);
433  relayout_cb = new SEC_dbcb(this, &SEC_db_interface::relayout);
434  refresh_cb = new SEC_dbcb(this, &SEC_db_interface::refresh);
435  cursorpos_cb = new SEC_dbcb(this, &SEC_db_interface::cursor_changed);
436  alilen_changed_cb = new SEC_dbcb(this, &SEC_db_interface::alilen_changed);
437 
438  aw_root->awar_string(AWAR_SPECIES_NAME, "", gb_main)->add_callback(makeRootCallback(sec_dbcb, sequence_cb));
439  aw_root->awar_string(AWAR_CURSOR_POSITION, "", gb_main)->add_callback(makeRootCallback(sec_dbcb, cursorpos_cb));
440 
441  bind_awars(update_pos_awars, updatepos_cb);
442  bind_awars(relayout_awars, relayout_cb);
443  bind_awars(refresh_awars, refresh_cb);
444 
445  bind_bonddef_awars(this);
446 
447  {
448  GBDATA *gb_alignment = GBT_get_alignment(gb_main, aliname);
449  GBDATA *gb_alignment_len = GB_search(gb_alignment, "alignment_len", GB_FIND);
450  sec_assert(gb_alignment_len);
451  GB_add_callback(gb_alignment_len, GB_CB_CHANGED, makeDatabaseCallback(sec_dbcb, alilen_changed_cb));
452  }
453 
454  sequence_cb->call();
455  ecoli_cb->call();
456  helix_cb->call();
457  updatepos_cb->call();
458  relayout_cb->call();
459  refresh_cb->call();
460 
461  toggler = NULp;
462 }
463 
465  free(aliname);
466 
467  delete [] displayPos;
468 
469  delete sequence; sequence = NULp;
470 
471  delete ecoli_seq; ecoli_seq = NULp;
472  delete Ecoli; Ecoli = NULp;
473 
474  delete helix_nr; helix_nr = NULp;
475  delete helix_pos; helix_pos = NULp;
476  delete Helix; Helix = NULp;
477 
478  delete sequence_cb; sequence_cb = NULp;
479  delete ecoli_cb; ecoli_cb = NULp;
480  delete helix_cb; helix_cb = NULp;
481  delete updatepos_cb; updatepos_cb = NULp;
482  delete relayout_cb; relayout_cb = NULp;
483  delete refresh_cb; refresh_cb = NULp;
484  delete cursorpos_cb; cursorpos_cb = NULp;
485  delete alilen_changed_cb; alilen_changed_cb = NULp;
486 
487  delete toggler; toggler = NULp;
488 
489  delete bonddef; bonddef = NULp;
490 }
491 
492 SEC_root *SEC_db_interface::secroot() const { return gfx->sec_root; }
493 
494 // --------------------------------------------------------------------------------
495 
497  shown = 0;
498 
499  sec_assert(sequence && Helix);
500 
501  for (size_t pos = 0; pos<ali_length; ++pos) {
502  bool isPaired = Helix->pairtype(pos) != HELIX_NONE;
503  char base = baseAt(pos);
504 
505  if (isPaired) {
506  if (displayBindingHelixPositions) {
507  displayPos[pos] = true;
508  }
509  else {
510  char oppoBase = baseAt(Helix->opposite_position(pos));
511  displayPos[pos] = !(SEC_is_gap(base) && SEC_is_gap(oppoBase)); // display if one side of helix has base
512  }
513  }
514  else {
515  displayPos[pos] = !SEC_is_gap(base);
516  }
517 
518  shown += displayPos[pos];
519  }
520 
521  // add hidden ecoli positions
522  if (displayEcoliPositions && ecoli_seq) {
523  for (size_t pos = 0; pos<ali_length; ++pos) {
524  if (!displayPos[pos] && !SEC_is_gap(ecoli_seq->data(pos))) {
525  displayPos[pos] = true;
526  shown++;
527  }
528  }
529  }
530 }
531 
533  if (!toggler) toggler = new SEC_structure_toggler(gb_main, aliname, gfx);
534 }
535 
538 }
539 
540 // --------------------------------------------------------------------------------
541 
#define AWAR_SECEDIT_SHOW_CURPOS
Definition: SEC_db.hxx:41
const char * GB_ERROR
Definition: arb_core.h:25
#define AWAR_SECEDIT_SKELETON_THICKNESS
Definition: SEC_db.hxx:33
SEC_dbcb(SEC_db_interface *db, interface_cb cb)
Definition: SEC_db.cxx:38
GB_CSTR GB_path_in_arbprop(const char *relative_path)
Definition: adsocket.cxx:1130
static const char * update_pos_awars[]
Definition: SEC_db.cxx:325
GB_ERROR GB_add_callback(GBDATA *gbd, GB_CB_TYPE type, const DatabaseCallback &dbcb)
Definition: ad_cb.cxx:356
static void sec_dbcb(UNFIXED, const SEC_dbcb *cb)
Definition: SEC_db.cxx:42
#define AWAR_SECEDIT_DISPLAY_SEARCH
Definition: SEC_db.hxx:43
void request_refresh()
Definition: awt_canvas.hxx:362
#define AWAR_CURSOR_POSITION
void nail_cursor()
Definition: SEC_main.cxx:59
void update_shown_positions()
Definition: SEC_db.cxx:496
GBDATA * GBT_get_alignment(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:684
AWT_canvas * canvas() const
Definition: SEC_db.hxx:165
#define AWAR_SECEDIT_BASELINEWIDTH
Definition: SEC_db.hxx:29
SEC_db_interface * instance
Definition: SEC_db.cxx:35
char * ARB_strdup(const char *str)
Definition: arb_string.h:27
static void pair_def_changed_cb(AW_root *aw_root, SEC_db_interface *db, const char *awar_name)
Definition: SEC_db.cxx:141
virtual bool SAIs_visualized() const =0
long read_int() const
Definition: AW_awar.cxx:187
AW_awar * set_minmax(float min, float max)
Definition: AW_awar.cxx:532
size_t opposite_position(size_t pos) const
Definition: BI_helix.hxx:96
long GBT_get_alignment_len(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:706
STL namespace.
void update_shown_positions()
Definition: SEC_db.cxx:536
char data(size_t abspos) const
Definition: SEC_db.hxx:77
#define cb(action)
#define AWAR_EDIT_RIGHTWARD
Definition: ed4_extern.hxx:76
char * GBT_get_default_helix_nr(GBDATA *)
Definition: adtools.cxx:65
AW_awar * add_callback(const RootCallback &cb)
Definition: AW_awar.cxx:234
struct Unfixed_cb_parameter * UNFIXED
Definition: cb_base.h:15
#define AWAR_SECEDIT_BOND_THICKNESS
Definition: SEC_db.hxx:34
GBDATA * GBT_find_SAI(GBDATA *gb_main, const char *name)
Definition: aditem.cxx:177
const char * default_pairchar
Definition: SEC_db.cxx:76
size_t GB_read_string_count(GBDATA *gbd)
Definition: arbdb.cxx:910
void reread_display_params(AW_root *aw_root, const ED4_plugin_host &Host)
Definition: SEC_root.hxx:757
~SEC_seq_data()
Definition: SEC_db.cxx:60
#define AWAR_FOOTER
SEC_db_interface(SEC_graphic *Gfx, AWT_canvas *Scr, ED4_plugin_host &host_)
Definition: SEC_db.cxx:401
#define PAIR_TYPES
Definition: SEC_db.cxx:79
AW_awar * awar_float(const char *var_name, float default_value=0.0, AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:560
interface_cb member_fun
Definition: SEC_db.cxx:36
#define true
Definition: ureadseq.h:14
#define AWAR_SECEDIT_SHOW_STR_SKELETON
Definition: SEC_db.hxx:38
#define false
Definition: ureadseq.h:13
#define ED4_AWAR_SEARCH_RESULT_CHANGED
Definition: ed4_extern.hxx:75
#define AWAR_SECEDIT_SAVEDIR
Definition: SEC_db.hxx:30
static void error(const char *msg)
Definition: mkptypes.cxx:96
const char * default_pairs
Definition: SEC_db.cxx:75
#define AWAR_SECEDIT_HIDE_BASES
Definition: SEC_db.hxx:39
void AW_create_fileselection_awars(AW_root *awr, const char *awar_base, const char *directories, const char *filter, const char *file_name)
Definition: AW_file.cxx:72
void call() const
Definition: SEC_db.cxx:39
#define AWAR_SECEDIT_SHOW_DEBUG
Definition: SEC_db.hxx:35
#define AWAR_SECEDIT_SHOW_ECOLI_POS
Definition: SEC_db.hxx:37
SEC_root * secroot() const
Definition: SEC_db.cxx:492
GB_alignment_type GBT_get_alignment_type(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:740
void set_cursor(int abspos)
Definition: SEC_db.cxx:290
#define AWAR_SPECIES_NAME
void reread(AW_root *aw_root, const ED4_plugin_host &host)
Definition: SEC_db.cxx:162
void init(const char *seq, int size)
Definition: BI_basepos.hxx:109
char * read_string() const
Definition: AW_awar.cxx:201
#define AWAR_SECEDIT_SHOW_BONDS
Definition: SEC_db.hxx:40
#define AWAR_SECEDIT_SHOW_HELIX_NRS
Definition: SEC_db.hxx:36
#define AWAR_SECEDIT_DIST_BETW_STRANDS
Definition: SEC_db.hxx:32
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
Definition: arbdb.h:86
GBDATA * GBT_find_sequence(GBDATA *gb_species, const char *aliname)
Definition: adali.cxx:670
float read_float() const
Definition: AW_awar.cxx:180
AW_root * awroot() const
Definition: SEC_db.hxx:161
static PairDefinition pairdef[PAIR_TYPES]
Definition: SEC_db.cxx:80
ASSERTING_CONSTEXPR_INLINE int bio2info(int biopos)
Definition: arb_defs.h:26
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:580
GB_ERROR close(GB_ERROR error)
Definition: arbdbpp.cxx:32
BI_PAIR_TYPE pairtype(size_t pos) const
Definition: BI_helix.hxx:101
char * GB_read_string(GBDATA *gbd)
Definition: arbdb.cxx:903
#define AWAR_SECEDIT_DISPLAY_SAI
Definition: SEC_db.hxx:42
void GB_remove_callback(GBDATA *gbd, GB_CB_TYPE type, const DatabaseCallback &dbcb)
Definition: ad_cb.cxx:360
static const char * refresh_awars[]
Definition: SEC_db.cxx:336
void init_toggler() const
Definition: SEC_db.cxx:532
void(SEC_db_interface::* interface_cb)(const SEC_dbcb *)
Definition: SEC_db.cxx:32
#define AWAR_SECEDIT_DISPPOS_ECOLI
Definition: SEC_db.hxx:45
void aw_message(const char *msg)
Definition: AW_status.cxx:932
static const char * relayout_awars[]
Definition: SEC_db.cxx:331
#define AWAR_PAIRS(type)
Definition: SEC_db.cxx:69
char baseAt(size_t abspos) const
Definition: SEC_db.hxx:156
char * GBT_get_default_helix(GBDATA *)
Definition: adtools.cxx:64
#define NULp
Definition: cxxforward.h:97
GBDATA * GBT_find_species(GBDATA *gb_main, const char *name)
Definition: aditem.cxx:139
GB_ERROR write_string(const char *aw_string)
char * GBT_get_default_alignment(GBDATA *gb_main)
Definition: adali.cxx:675
SEC_bond_def * bonds() const
Definition: SEC_db.hxx:168
GB_ERROR update(AW_root *awr, const char *changed_awar_name)
Definition: SEC_db.cxx:88
bool SEC_is_gap(char c)
Definition: SEC_root.hxx:45
GB_transaction ta(gb_var)
const char * awar_pairchar
Definition: SEC_db.cxx:74
GBDATA * gb_main
Definition: adname.cxx:33
SEC_seq_data(GBDATA *gb_item, const char *aliname, const SEC_dbcb *reload_item)
Definition: SEC_db.cxx:49
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:570
const char * awar_pairs
Definition: SEC_db.cxx:73
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
Definition: adquery.cxx:531
#define sec_assert(cond)
Definition: SEC_defs.hxx:19
#define AWAR_PCHAR(type)
Definition: SEC_db.cxx:70
#define AW_ROOT_DEFAULT
Definition: aw_base.hxx:106
ShowBonds
Definition: SEC_root.hxx:621
static void create_awars(AW_root *aw_root, AW_default def)
Definition: SEC_db.cxx:364
ShowCursorPos
Definition: SEC_root.hxx:627
static void bind_bonddef_awars(SEC_db_interface *db)
Definition: SEC_db.cxx:148
#define AWAR_SECEDIT_DISPPOS_BINDING
Definition: SEC_db.hxx:44