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 | |
---|
46 | AW_window *MG_create_merge_alignment_window(AW_root *awr); |
---|
47 | AW_window *MG_create_merge_names_window(AW_root *awr); |
---|
48 | AW_window *MG_create_merge_species_window(AW_root *awr, bool dst_is_new); |
---|
49 | AW_window *MG_create_preserves_selection_window(AW_root *awr); |
---|
50 | AW_window *MG_create_merge_SAIs_window(AW_root *awr); |
---|
51 | AW_window *MG_create_merge_trees_window(AW_root *awr); |
---|
52 | AW_window *MG_create_merge_configs_window(AW_root *awr); |
---|
53 | |
---|
54 | AW_window *create_mg_check_fields_window(AW_root *aw_root); |
---|
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); |
---|
66 | GB_ERROR MG_expect_renamed(); |
---|
67 | |
---|
68 | int MG_copy_and_check_alignments(); |
---|
69 | |
---|
70 | // export of gene-species: |
---|
71 | |
---|
72 | void MG_create_gene_species_awars(AW_root *aw_root, AW_default aw_def); |
---|
73 | AW_window *MG_gene_species_create_field_transfer_def_window(AW_root *aw_root); |
---|
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) |
---|
80 | int mg_count_queried(GBDATA *gb_main); |
---|
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 |
---|