| 1 | // ==================================================================== // |
|---|
| 2 | // // |
|---|
| 3 | // File : merge.hxx // |
|---|
| 4 | // Purpose : Local header for usage inside directory MERGE // |
|---|
| 5 | // // |
|---|
| 6 | // // |
|---|
| 7 | // Copyright Department of Microbiology (Technical University Munich) // |
|---|
| 8 | // // |
|---|
| 9 | // Visit our web site at: http://www.arb-home.de/ // |
|---|
| 10 | // // |
|---|
| 11 | // ==================================================================== // |
|---|
| 12 | |
|---|
| 13 | #ifndef MERGE_HXX |
|---|
| 14 | #define MERGE_HXX |
|---|
| 15 | |
|---|
| 16 | #ifndef AW_BASE_HXX |
|---|
| 17 | #include <aw_base.hxx> |
|---|
| 18 | #endif |
|---|
| 19 | #ifndef ARB_ASSERT_H |
|---|
| 20 | #include <arb_assert.h> |
|---|
| 21 | #endif |
|---|
| 22 | #ifndef ARBDB_BASE_H |
|---|
| 23 | #include <arbdb_base.h> |
|---|
| 24 | #endif |
|---|
| 25 | |
|---|
| 26 | #define mg_assert(bed) arb_assert(bed) |
|---|
| 27 | |
|---|
| 28 | #define AWAR_MERGE_SAV "merge/" |
|---|
| 29 | #define AWAR_MERGE_TMP "tmp/" AWAR_MERGE_SAV |
|---|
| 30 | |
|---|
| 31 | #define AWAR_MERGE_TMP_SRC AWAR_MERGE_TMP "src/" |
|---|
| 32 | #define AWAR_MERGE_TMP_DST AWAR_MERGE_TMP "dst/" |
|---|
| 33 | |
|---|
| 34 | #define AWAR_DB_SRC AWAR_MERGE_TMP_SRC "db" |
|---|
| 35 | #define AWAR_DB_DST AWAR_MERGE_TMP_DST "db" |
|---|
| 36 | |
|---|
| 37 | inline const char *awar_name_tmp(int db_nr, const char *name) { |
|---|
| 38 | mg_assert(db_nr == 1 || db_nr == 2); // @@@ replace these magics (throughout whole library) |
|---|
| 39 | static char buffer[256]; |
|---|
| 40 | sprintf(buffer, "%s%s", db_nr == 1 ? AWAR_MERGE_TMP_SRC : AWAR_MERGE_TMP_DST, name); |
|---|
| 41 | return buffer; |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | AW_window *MG_create_merge_alignment_window(AW_root *awr); |
|---|
| 45 | AW_window *MG_create_merge_names_window(AW_root *awr); |
|---|
| 46 | AW_window *MG_create_merge_species_window(AW_root *awr, bool dst_is_new); |
|---|
| 47 | AW_window *MG_create_preserves_selection_window(AW_root *awr); |
|---|
| 48 | AW_window *MG_create_merge_SAIs_window(AW_root *awr); |
|---|
| 49 | AW_window *MG_create_merge_trees_window(AW_root *awr); |
|---|
| 50 | AW_window *MG_create_merge_configs_window(AW_root *awr); |
|---|
| 51 | |
|---|
| 52 | AW_window *create_mg_check_fields_window(AW_root *aw_root); |
|---|
| 53 | |
|---|
| 54 | void MG_create_config_awar(AW_root *aw_root, AW_default aw_def); |
|---|
| 55 | void MG_create_trees_awar(AW_root *aw_root, AW_default aw_def); |
|---|
| 56 | void MG_create_extendeds_awars(AW_root *aw_root, AW_default aw_def); |
|---|
| 57 | void MG_create_species_awars(AW_root *aw_root, AW_default aw_def); |
|---|
| 58 | void MG_create_rename_awars(AW_root *aw_root, AW_default aw_def); |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | void MG_create_db_dependent_rename_awars(AW_root *aw_root, GBDATA *gb_src, GBDATA *gb_dst); |
|---|
| 62 | |
|---|
| 63 | void MG_set_renamed(bool renamed, AW_root *aw_root, const char *reason); |
|---|
| 64 | GB_ERROR MG_expect_renamed(); |
|---|
| 65 | |
|---|
| 66 | int MG_copy_and_check_alignments(); |
|---|
| 67 | |
|---|
| 68 | // export of gene-species: |
|---|
| 69 | |
|---|
| 70 | void MG_create_gene_species_awars(AW_root *aw_root, AW_default aw_def); |
|---|
| 71 | AW_window *MG_gene_species_create_field_transfer_def_window(AW_root *aw_root); |
|---|
| 72 | 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 |
|---|
| 73 | |
|---|
| 74 | #define AWAR_REMAP_SPECIES_LIST AWAR_MERGE_SAV "remap_species_list" |
|---|
| 75 | #define AWAR_REMAP_ENABLE AWAR_MERGE_SAV "remap_enable" |
|---|
| 76 | |
|---|
| 77 | #define IS_QUERIED_SPECIES(gb_species) GB_user_flag(gb_species, GB_USERFLAG_QUERY) |
|---|
| 78 | int mg_count_queried(GBDATA *gb_main); |
|---|
| 79 | |
|---|
| 80 | const char *MG_left_AWAR_SPECIES_NAME(); |
|---|
| 81 | |
|---|
| 82 | #ifndef MG_MERGE_HXX |
|---|
| 83 | #include "mg_merge.hxx" |
|---|
| 84 | #endif |
|---|
| 85 | |
|---|
| 86 | inline GBDATA *get_gb_main(int db_nr) { |
|---|
| 87 | mg_assert(db_nr == 1 || db_nr == 2); |
|---|
| 88 | return db_nr == 1 ? GLOBAL_gb_src : GLOBAL_gb_dst; |
|---|
| 89 | } |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | #else |
|---|
| 93 | #error merge.hxx included twice |
|---|
| 94 | #endif // MERGE_HXX |
|---|