source: tags/ms_r17q3/ARBDB/arbdbt.h

Last change on this file was 16508, checked in by westram, 7 years ago
  • reintegrates 'macros' into 'trunk'
    • introduce generic input prompt (related #179)
    • use it instead of locally generated windows:
      • species (rename + create)
      • alignment (rename, copy + create)
      • experiments (rename, copy + create)
      • genes (rename, copy + extract)
      • mergetool (rename SAI + configs)
      • SAIviz color translation (copy + create)
    • fixed bugs in mergetool ([16503],[16504])
  • adds: log:branches/macros@16484:16507
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1#ifndef ARBDBT_H
2#define ARBDBT_H
3
4#ifndef ARBDB_H
5#include <arbdb.h>
6#endif
7#ifndef DOWNCAST_H
8#include <downcast.h>
9#endif
10
11#define gb_assert(cond) arb_assert(cond)
12
13#define GBT_SPECIES_INDEX_SIZE       10000L
14#define GBT_SAI_INDEX_SIZE           1000L
15
16#define GB_GROUP_NAME_MAX 256
17
18#define DEFAULT_BRANCH_LENGTH 0.1
19
20#define ERROR_CONTAINER_PATH    "tmp/message/pending"
21
22#define REMOTE_BASE              "tmp/remote/"
23#define MACRO_TRIGGER_CONTAINER  REMOTE_BASE "trigger"
24#define MACRO_TRIGGER_TERMINATED MACRO_TRIGGER_CONTAINER "/terminated"
25#define MACRO_TRIGGER_RECORDING  MACRO_TRIGGER_CONTAINER "/recording"
26#define MACRO_TRIGGER_ERROR      MACRO_TRIGGER_CONTAINER "/error"
27#define MACRO_TRIGGER_TRACKED    MACRO_TRIGGER_CONTAINER "/tracked"
28
29enum GBT_RemarkType { REMARK_NONE, REMARK_BOOTSTRAP, REMARK_OTHER };
30
31enum GBT_TreeRemoveType {
32    GBT_REMOVE_MARKED   = 1,
33    GBT_REMOVE_UNMARKED = 2,
34    GBT_REMOVE_ZOMBIES  = 4,
35
36    // please keep AWT_RemoveType in sync with GBT_TreeRemoveType
37    // see ../SL/AP_TREE/AP_Tree.hxx@sync_GBT_TreeRemoveType__AWT_RemoveType
38
39    // combined defines:
40    GBT_KEEP_MARKED = GBT_REMOVE_UNMARKED|GBT_REMOVE_ZOMBIES,
41};
42
43enum GBT_ORDER_MODE {
44    GBT_BEHIND, 
45    GBT_INFRONTOF, 
46};
47
48enum TreeModel { ROOTED = 0, UNROOTED = 1 };
49
50CONSTEXPR_INLINE int nodes_2_edges(int nodes) { return nodes-1; }
51CONSTEXPR_INLINE int edges_2_nodes(int nodes) { return nodes+1; }
52
53CONSTEXPR_INLINE int leafs_2_nodes(int leafs, TreeModel model) {
54    //! calculate the number of nodes (leaf- plus inner-nodes) in a tree with 'leafs' leafs
55    return 2*leafs-1-int(model);
56}
57CONSTEXPR_INLINE int nodes_2_leafs(int nodes, TreeModel model) {
58    //! calculate the number of leafs in a tree with 'nodes' nodes
59    return (nodes+1+int(model))/2;
60}
61CONSTEXPR_INLINE int leafs_2_edges(int leafs, TreeModel model) {
62    //! calculate the number of edges in a tree with 'leafs' leafs
63    return nodes_2_edges(leafs_2_nodes(leafs, model));
64}
65CONSTEXPR_INLINE int edges_2_leafs(int edges, TreeModel model) {
66    //! calculate the number of leafs in a tree with 'edges' edges
67    return nodes_2_leafs(edges_2_nodes(edges), model);
68}
69
70#define SRT_AUTOCORRECT_TREENAME " =:\n=:*=tree_*1:tree_tree_*=tree_*1"
71#define SRT_AUTOCORRECT_ALINAME  " =:\n=:*=ali_*1:ali_ali_*=ali_*1"
72
73typedef GB_ERROR (*species_callback)(GBDATA *gb_species, int *clientdata);
74
75#include <ad_t_prot.h>
76
77#define CHANGE_KEY_PATH             "presets/key_data"
78#define CHANGE_KEY_PATH_GENES       "presets/gene_key_data"
79#define CHANGE_KEY_PATH_EXPERIMENTS "presets/experiment_key_data"
80
81#define CHANGEKEY        "key"
82#define CHANGEKEY_NAME   "key_name"
83#define CHANGEKEY_TYPE   "key_type"
84#define CHANGEKEY_HIDDEN "key_hidden"
85
86
87#else
88#error arbdbt.h included twice
89#endif
90
91
Note: See TracBrowser for help on using the repository browser.