source: branches/items/MERGE/merge.hxx

Last change on this file was 17262, checked in by westram, 6 years ago
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
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
35enum DbSel { SRC_DB = 1, DST_DB = 2 };
36
37inline bool validDb(DbSel db) { return db == SRC_DB || db == DST_DB; }
38
39inline 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
46AW_window *MG_create_merge_alignment_window(AW_root *awr);
47AW_window *MG_create_merge_names_window(AW_root *awr);
48AW_window *MG_create_merge_species_window(AW_root *awr, bool dst_is_new);
49AW_window *MG_create_preserves_selection_window(AW_root *awr);
50AW_window *MG_create_merge_SAIs_window(AW_root *awr);
51AW_window *MG_create_merge_trees_window(AW_root *awr);
52AW_window *MG_create_merge_configs_window(AW_root *awr);
53
54AW_window *create_mg_check_fields_window(AW_root *aw_root);
55
56void MG_create_config_awar(AW_root *aw_root, AW_default aw_def);
57void MG_create_trees_awar(AW_root *aw_root, AW_default aw_def);
58void MG_create_extendeds_awars(AW_root *aw_root, AW_default aw_def);
59void MG_create_species_awars(AW_root *aw_root, AW_default aw_def);
60void MG_create_rename_awars(AW_root *aw_root, AW_default aw_def);
61
62
63void MG_create_db_dependent_rename_awars(AW_root *aw_root, GBDATA *gb_src, GBDATA *gb_dst);
64
65void     MG_set_renamed(bool renamed, AW_root *aw_root, const char *reason);
66GB_ERROR MG_expect_renamed();
67
68int MG_copy_and_check_alignments();
69
70// export of gene-species:
71
72void       MG_create_gene_species_awars(AW_root *aw_root, AW_default aw_def);
73AW_window *MG_gene_species_create_field_transfer_def_window(AW_root *aw_root);
74GB_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)
80long mg_count_queried(GBDATA *gb_main);
81
82const char *MG_left_AWAR_SPECIES_NAME();
83
84#ifndef MG_MERGE_HXX
85#include "mg_merge.hxx"
86#endif
87
88inline 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
Note: See TracBrowser for help on using the repository browser.