source: branches/help/ARBDB/arbdbt.h

Last change on this file was 18730, checked in by westram, 3 years ago
  • remove trailing whitespace from c source.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 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 (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' (leaf- plus inner-)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
70CONSTEXPR_INLINE int leafs_2_innerNodes(int leafs, TreeModel model) {
71    //! calculate the number of inner nodes in a tree with 'leafs' leafs
72    return leafs_2_nodes(leafs, model)-leafs;
73}
74CONSTEXPR_INLINE int nodes_2_innerNodes(int nodes, TreeModel model) {
75    //! calculate the number of inner nodes in a tree with 'nodes' (leaf- plus inner-)nodes
76    return nodes-nodes_2_leafs(nodes, model);
77}
78
79#define SRT_AUTOCORRECT_TREENAME " =:\n=:*=tree_*1:tree_tree_*=tree_*1"
80#define SRT_AUTOCORRECT_ALINAME  " =:\n=:*=ali_*1:ali_ali_*=ali_*1"
81
82typedef GB_ERROR (*species_callback)(GBDATA *gb_species, int *clientdata);
83
84#include <ad_t_prot.h>
85
86#define CHANGE_KEY_PATH             "presets/key_data"
87#define CHANGE_KEY_PATH_GENES       "presets/gene_key_data"
88#define CHANGE_KEY_PATH_EXPERIMENTS "presets/experiment_key_data"
89
90#define CHANGEKEY        "key"
91#define CHANGEKEY_NAME   "key_name"
92#define CHANGEKEY_TYPE   "key_type"
93#define CHANGEKEY_HIDDEN "key_hidden"
94
95
96#else
97#error arbdbt.h included twice
98#endif
99
100
Note: See TracBrowser for help on using the repository browser.