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 
316  // @@@ reread alilen. test changing ali length!
317 
318  gfx->request_update(SEC_UPDATE_RELOAD);
319  scr->request_refresh();
320 }
321 
322 // --------------------------------------------------------------------------------
323 
324 static const char *update_pos_awars[] = {
327  NULp
328 };
329 
330 static const char *relayout_awars[] = {
332  NULp
333 };
334 
335 static const char *refresh_awars[] = {
348 #if defined(DEBUG)
350 #endif // DEBUG
351  NULp
352 };
353 
354 void SEC_db_interface::bind_awars(const char **awars, SEC_dbcb *cb) {
355  RootCallback awarcb = makeRootCallback(sec_dbcb, cb);
356  for (int i = 0; awars[i]; ++i) {
357  aw_root->awar(awars[i])->add_callback(awarcb);
358  }
359 }
360 
361 // --------------------------------------------------------------------------------
362 
363 static void create_awars(AW_root *aw_root, AW_default def) {
364  aw_root->awar_int(AWAR_SECEDIT_BASELINEWIDTH, 0, def)->set_minmax(0, 10);
365  aw_root->awar_string(AWAR_FOOTER);
366 
367  {
368  char *dir = ARB_strdup(GB_path_in_arbprop("secondary_structure"));
369  AW_create_fileselection_awars(aw_root, AWAR_SECEDIT_SAVEDIR, dir, ".ass", "noname.ass");
370  free(dir);
371  }
372 
373  aw_root->awar_float(AWAR_SECEDIT_DIST_BETW_STRANDS, 1, def)->set_minmax(0.01, 40);
374  aw_root->awar_int (AWAR_SECEDIT_SKELETON_THICKNESS, 1, def)->set_minmax(1, 10);
375  aw_root->awar_int (AWAR_SECEDIT_BOND_THICKNESS, 1, def)->set_minmax(1, 10);
376 
377 #if defined(DEBUG)
378  aw_root->awar_int(AWAR_SECEDIT_SHOW_DEBUG, 0, def);
379 #endif // DEBUG
380  aw_root->awar_int(AWAR_SECEDIT_SHOW_HELIX_NRS, 0, def);
381  aw_root->awar_int(AWAR_SECEDIT_SHOW_ECOLI_POS, 0, def);
382  aw_root->awar_int(AWAR_SECEDIT_SHOW_STR_SKELETON, 0, def);
383  aw_root->awar_int(AWAR_SECEDIT_HIDE_BASES, 0, def);
386  aw_root->awar_int(AWAR_SECEDIT_DISPLAY_SAI, 0, def);
387  aw_root->awar_int(AWAR_SECEDIT_DISPLAY_SEARCH, 0, def);
388  aw_root->awar_int(AWAR_SECEDIT_DISPPOS_BINDING, 0, def);
389  aw_root->awar_int(AWAR_SECEDIT_DISPPOS_ECOLI, 1, def);
390 
391  for (int i = 0; i<PAIR_TYPES; ++i) {
392  PairDefinition& pd = pairdef[i];
393  aw_root->awar_string(pd.awar_pairs, pd.default_pairs);
394  aw_root->awar_string(pd.awar_pairchar, pd.default_pairchar);
395  }
396 }
397 
398 // --------------------------------------------------------------------------------
399 
401  sequence(NULp),
402  Host(host_),
403  displayEcoliPositions(false),
404  ecoli_seq(NULp),
405  Ecoli(NULp),
406  displayBindingHelixPositions(true),
407  helix_nr(NULp),
408  helix_pos(NULp),
409  Helix(NULp),
410  gfx(Gfx),
411  scr(Scr),
412  gb_main(gfx->gb_main),
413  aw_root(gfx->aw_root)
414 {
415  AWT_auto_refresh allowed_on(Scr);
416  GB_transaction ta(gb_main);
417 
418  create_awars(aw_root, AW_ROOT_DEFAULT);
419 
420  aliname = GBT_get_default_alignment(gb_main);
421  sec_assert(aliname);
422  ali_length = GBT_get_alignment_len(gb_main, aliname);
423  displayPos = new bool[ali_length];
424  bonddef = new SEC_bond_def(GBT_get_alignment_type(gb_main, aliname));
425 
426  // awar and DB callbacks:
427 
428  sequence_cb = new SEC_dbcb(this, &SEC_db_interface::reload_sequence);
429  ecoli_cb = new SEC_dbcb(this, &SEC_db_interface::reload_ecoli);
430  helix_cb = new SEC_dbcb(this, &SEC_db_interface::reload_helix);
431  updatepos_cb = new SEC_dbcb(this, &SEC_db_interface::update_positions);
432  relayout_cb = new SEC_dbcb(this, &SEC_db_interface::relayout);
433  refresh_cb = new SEC_dbcb(this, &SEC_db_interface::refresh);
434  cursorpos_cb = new SEC_dbcb(this, &SEC_db_interface::cursor_changed);
435  alilen_changed_cb = new SEC_dbcb(this, &SEC_db_interface::alilen_changed);
436 
437  aw_root->awar_string(AWAR_SPECIES_NAME, "", gb_main)->add_callback(makeRootCallback(sec_dbcb, sequence_cb));
438  aw_root->awar_string(AWAR_CURSOR_POSITION, "", gb_main)->add_callback(makeRootCallback(sec_dbcb, cursorpos_cb));
439 
440  bind_awars(update_pos_awars, updatepos_cb);
441  bind_awars(relayout_awars, relayout_cb);
442  bind_awars(refresh_awars, refresh_cb);
443 
444  bind_bonddef_awars(this);
445 
446  {
447  GBDATA *gb_alignment = GBT_get_alignment(gb_main, aliname);
448  GBDATA *gb_alignment_len = GB_search(gb_alignment, "alignment_len", GB_FIND);
449  sec_assert(gb_alignment_len);
450  GB_add_callback(gb_alignment_len, GB_CB_CHANGED, makeDatabaseCallback(sec_dbcb, alilen_changed_cb));
451  }
452 
453  sequence_cb->call();
454  ecoli_cb->call();
455  helix_cb->call();
456  updatepos_cb->call();
457  relayout_cb->call();
458  refresh_cb->call();
459 
460  toggler = NULp;
461 }
462 
464  free(aliname);
465 
466  delete [] displayPos;
467 
468  delete sequence; sequence = NULp;
469 
470  delete ecoli_seq; ecoli_seq = NULp;
471  delete Ecoli; Ecoli = NULp;
472 
473  delete helix_nr; helix_nr = NULp;
474  delete helix_pos; helix_pos = NULp;
475  delete Helix; Helix = NULp;
476 
477  delete sequence_cb; sequence_cb = NULp;
478  delete ecoli_cb; ecoli_cb = NULp;
479  delete helix_cb; helix_cb = NULp;
480  delete updatepos_cb; updatepos_cb = NULp;
481  delete relayout_cb; relayout_cb = NULp;
482  delete refresh_cb; refresh_cb = NULp;
483  delete cursorpos_cb; cursorpos_cb = NULp;
484  delete alilen_changed_cb; alilen_changed_cb = NULp;
485 
486  delete toggler; toggler = NULp;
487 
488  delete bonddef; bonddef = NULp;
489 }
490 
491 SEC_root *SEC_db_interface::secroot() const { return gfx->sec_root; }
492 
493 // --------------------------------------------------------------------------------
494 
496  shown = 0;
497 
498  sec_assert(sequence && Helix);
499 
500  for (size_t pos = 0; pos<ali_length; ++pos) {
501  bool isPaired = Helix->pairtype(pos) != HELIX_NONE;
502  char base = baseAt(pos);
503 
504  if (isPaired) {
505  if (displayBindingHelixPositions) {
506  displayPos[pos] = true;
507  }
508  else {
509  char oppoBase = baseAt(Helix->opposite_position(pos));
510  displayPos[pos] = !(SEC_is_gap(base) && SEC_is_gap(oppoBase)); // display if one side of helix has base
511  }
512  }
513  else {
514  displayPos[pos] = !SEC_is_gap(base);
515  }
516 
517  shown += displayPos[pos];
518  }
519 
520  // add hidden ecoli positions
521  if (displayEcoliPositions && ecoli_seq) {
522  for (size_t pos = 0; pos<ali_length; ++pos) {
523  if (!displayPos[pos] && !SEC_is_gap(ecoli_seq->data(pos))) {
524  displayPos[pos] = true;
525  shown++;
526  }
527  }
528  }
529 }
530 
532  if (!toggler) toggler = new SEC_structure_toggler(gb_main, aliname, gfx);
533 }
534 
537 }
538 
539 // --------------------------------------------------------------------------------
540 
#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:1166
static const char * update_pos_awars[]
Definition: SEC_db.cxx:324
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:495
GBDATA * GBT_get_alignment(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:696
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:716
STL namespace.
void update_shown_positions()
Definition: SEC_db.cxx:535
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:400
#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:491
GB_alignment_type GBT_get_alignment_type(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:750
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:682
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:335
void init_toggler() const
Definition: SEC_db.cxx:531
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:330
#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:687
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:363
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