ARB
merge.hxx
Go to the documentation of this file.
1 // ==================================================================== //
2 // //
3 // File : merge.hxx //
4 // Purpose : Local header for usage inside directory MERGE //
5 // //
6 // Copyright Department of Microbiology (Technical University Munich) //
7 // Visit our web site at: http://www.arb-home.de/ //
8 // //
9 // ==================================================================== //
10 
11 #ifndef MERGE_HXX
12 #define MERGE_HXX
13 
14 #ifndef AW_BASE_HXX
15 #include <aw_base.hxx>
16 #endif
17 #ifndef ARB_ASSERT_H
18 #include <arb_assert.h>
19 #endif
20 #ifndef ARBDB_BASE_H
21 #include <arbdb_base.h>
22 #endif
23 
24 #define mg_assert(bed) arb_assert(bed)
25 
26 #define AWAR_MERGE_SAV "merge/"
27 #define AWAR_MERGE_TMP "tmp/" AWAR_MERGE_SAV
28 
29 #define AWAR_MERGE_TMP_SRC AWAR_MERGE_TMP "src/"
30 #define AWAR_MERGE_TMP_DST AWAR_MERGE_TMP "dst/"
31 
32 #define AWAR_DB_SRC AWAR_MERGE_TMP_SRC "db"
33 #define AWAR_DB_DST AWAR_MERGE_TMP_DST "db"
34 
35 enum DbSel { SRC_DB = 1, DST_DB = 2 };
36 
37 inline bool validDb(DbSel db) { return db == SRC_DB || db == DST_DB; }
38 
39 inline const char *awar_name_tmp(DbSel db, const char *name) {
40  mg_assert(validDb(db));
41  static char buffer[256];
42  sprintf(buffer, "%s%s", db == SRC_DB ? AWAR_MERGE_TMP_SRC : AWAR_MERGE_TMP_DST, name);
43  return buffer;
44 }
45 
48 AW_window *MG_create_merge_species_window(AW_root *awr, bool dst_is_new);
53 
55 
56 void MG_create_config_awar(AW_root *aw_root, AW_default aw_def);
57 void MG_create_trees_awar(AW_root *aw_root, AW_default aw_def);
58 void MG_create_extendeds_awars(AW_root *aw_root, AW_default aw_def);
59 void MG_create_species_awars(AW_root *aw_root, AW_default aw_def);
60 void MG_create_rename_awars(AW_root *aw_root, AW_default aw_def);
61 
62 
63 void MG_create_db_dependent_rename_awars(AW_root *aw_root, GBDATA *gb_src, GBDATA *gb_dst);
64 
65 void MG_set_renamed(bool renamed, AW_root *aw_root, const char *reason);
67 
69 
70 // export of gene-species:
71 
72 void MG_create_gene_species_awars(AW_root *aw_root, AW_default aw_def);
74 GB_ERROR MG_export_fields(AW_root *aw_root, GBDATA *gb_src, GBDATA *gb_dst, GB_HASH *error_suppressor, GB_HASH *source_organism_hash); // export defined fields
75 
76 #define AWAR_REMAP_SPECIES_LIST AWAR_MERGE_SAV "remap_species_list"
77 #define AWAR_REMAP_ENABLE AWAR_MERGE_SAV "remap_enable"
78 
79 #define IS_QUERIED_SPECIES(gb_species) GB_user_flag(gb_species, GB_USERFLAG_QUERY)
81 
82 const char *MG_left_AWAR_SPECIES_NAME();
83 
84 #ifndef MG_MERGE_HXX
85 #include "mg_merge.hxx"
86 #endif
87 
88 inline GBDATA *get_gb_main(DbSel db) {
89  mg_assert(validDb(db));
90  return db == SRC_DB ? GLOBAL_gb_src : GLOBAL_gb_dst;
91 }
92 
93 
94 #else
95 #error merge.hxx included twice
96 #endif // MERGE_HXX
AW_window * create_mg_check_fields_window(AW_root *aw_root)
void MG_create_trees_awar(AW_root *aw_root, AW_default aw_def)
Definition: MG_trees.cxx:33
const char * GB_ERROR
Definition: arb_core.h:25
const char * awar_name_tmp(DbSel db, const char *name)
Definition: merge.hxx:39
AW_window * MG_gene_species_create_field_transfer_def_window(AW_root *aw_root)
int MG_copy_and_check_alignments()
Definition: merge.hxx:35
GB_ERROR MG_expect_renamed()
Definition: MG_names.cxx:119
GB_ERROR MG_export_fields(AW_root *aw_root, GBDATA *gb_src, GBDATA *gb_dst, GB_HASH *error_suppressor, GB_HASH *source_organism_hash)
char buffer[MESSAGE_BUFFERSIZE]
Definition: seq_search.cxx:34
GBDATA * GLOBAL_gb_dst
Definition: MG_main.cxx:32
void MG_create_db_dependent_rename_awars(AW_root *aw_root, GBDATA *gb_src, GBDATA *gb_dst)
Definition: MG_names.cxx:58
AW_window * MG_create_merge_trees_window(AW_root *awr)
Definition: MG_trees.cxx:207
#define mg_assert(bed)
Definition: merge.hxx:24
bool validDb(DbSel db)
Definition: merge.hxx:37
void MG_create_extendeds_awars(AW_root *aw_root, AW_default aw_def)
void MG_create_species_awars(AW_root *aw_root, AW_default aw_def)
Definition: MG_species.cxx:65
long mg_count_queried(GBDATA *gb_main)
DbSel
Definition: merge.hxx:35
void MG_set_renamed(bool renamed, AW_root *aw_root, const char *reason)
Definition: MG_names.cxx:114
AW_window * MG_create_merge_species_window(AW_root *awr, bool dst_is_new)
GBDATA * GLOBAL_gb_src
Definition: MG_main.cxx:31
AW_window * MG_create_merge_names_window(AW_root *awr)
Definition: MG_names.cxx:173
void MG_create_rename_awars(AW_root *aw_root, AW_default aw_def)
Definition: MG_names.cxx:32
void MG_create_gene_species_awars(AW_root *aw_root, AW_default aw_def)
#define AWAR_MERGE_TMP_DST
Definition: merge.hxx:30
AW_window * MG_create_preserves_selection_window(AW_root *awr)
Definition: merge.hxx:35
AW_window * MG_create_merge_SAIs_window(AW_root *awr)
#define AWAR_MERGE_TMP_SRC
Definition: merge.hxx:29
AW_window * MG_create_merge_configs_window(AW_root *awr)
Definition: MG_configs.cxx:122
GBDATA * gb_main
Definition: adname.cxx:33
AW_window * MG_create_merge_alignment_window(AW_root *awr)
GBDATA * get_gb_main(DbSel db)
Definition: merge.hxx:88
void MG_create_config_awar(AW_root *aw_root, AW_default aw_def)
Definition: MG_configs.cxx:31
const char * MG_left_AWAR_SPECIES_NAME()
Definition: MG_species.cxx:63