ARB
NT_import.cxx
Go to the documentation of this file.
1 // =============================================================== //
2 // //
3 // File : NT_import.cxx //
4 // Purpose : //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // =============================================================== //
10 
11 #include "NT_local.h"
12 
13 #include <dbui.h>
14 #include <GEN.hxx>
15 #include <mg_merge.hxx>
16 #include <macros.hxx>
17 
18 #include <awti_import.hxx>
19 #include <awt.hxx>
20 #include <awt_canvas.hxx>
21 
22 #include <aw_awar.hxx>
23 #include <aw_root.hxx>
24 #include <aw_msg.hxx>
25 
26 #include <arbdbt.h>
27 
28 static void nt_seq_load_cb(AW_root *awr, TREE_canvas *ntw) {
33  if (!error) error = NT_format_all_alignments(GLOBAL.gb_main);
35  if (!error) aww->activate();
36 
37  AWTI_cleanup_importer(); // closes import DB
38 
41 
42  if (awr->awar(AWAR_IMPORT_AUTOCONF)->read_int()) {
44  }
45 }
46 
47 
51  AW_root *awr = aww->get_root();
52 
53  AWTI_open_import_window(awr, NULp, false, GLOBAL.gb_main, makeRootCallback(nt_seq_load_cb, ntw));
55 
57 
58  // change awar values (import window just opened!)
59 
60  int gb_main_is_genom_db;
61  {
64 
65  gb_main_is_genom_db = GEN_is_genome_db(GLOBAL.gb_main, 0);
66  IF_ASSERTION_USED(int gb_merge_is_genom_db =) GEN_is_genome_db(GLOBAL_gb_src, gb_main_is_genom_db);
67 
68  nt_assert(gb_main_is_genom_db == gb_merge_is_genom_db);
69  }
70 
71 
73 
74  {
76 
77  char *ali_name = GBT_get_default_alignment(GLOBAL.gb_main);
78  char *ali_type = GBT_get_alignment_type_string(GLOBAL.gb_main, ali_name);
79 
80  if (!ali_type) aw_message(GB_await_error());
81 
82  AWTI_import_set_ali_and_type(awr, ali_name, ali_type, GLOBAL.gb_main);
83 
84  free(ali_type);
85  free(ali_name);
86  }
87 }
88 
GB_ERROR NT_format_all_alignments(GBDATA *gb_main)
Definition: NT_main.cxx:52
AW_window * create_species_query_window(AW_root *aw_root, GBDATA *gb_main)
const char * GB_ERROR
Definition: arb_core.h:25
void query_update_list()
void NT_create_config_after_import(TREE_canvas *ntw, bool imported_from_scratch)
Definition: NT_edconf.cxx:1302
static void nt_seq_load_cb(AW_root *awr, TREE_canvas *ntw)
Definition: NT_import.cxx:28
void AWTI_set_importDB_pointer(GBDATA *&dbPtr)
long read_int() const
Definition: AW_awar.cxx:187
void AWTI_cleanup_importer()
char * GBT_get_alignment_type_string(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:727
void activate()
Definition: aw_window.hxx:354
GBDATA * GLOBAL_gb_dst
Definition: MG_main.cxx:32
GB_ERROR GB_await_error()
Definition: arb_msg.cxx:353
static void error(const char *msg)
Definition: mkptypes.cxx:96
#define AWAR_IMPORT_AUTOCONF
Definition: awti_import.hxx:26
void NT_import_sequences(AW_window *aww, TREE_canvas *ntw)
Definition: NT_import.cxx:48
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
GBDATA * GLOBAL_gb_src
Definition: MG_main.cxx:31
#define nt_assert(cond)
Definition: NT_local.h:27
bool got_macro_ability(AW_root *aw_root)
Definition: trackers.cxx:475
GB_ERROR MERGE_sequences_simple(AW_root *awr)
Definition: MG_species.cxx:737
#define IF_ASSERTION_USED(x)
Definition: arb_assert.h:308
void aw_message(const char *msg)
Definition: AW_status.cxx:932
AW_root * get_root()
Definition: aw_window.hxx:348
#define NULp
Definition: cxxforward.h:97
GBDATA * gb_main
Definition: NT_local.h:36
char * GBT_get_default_alignment(GBDATA *gb_main)
Definition: adali.cxx:675
void AWTI_open_import_window(AW_root *awr, const char *def_importname, bool do_exit, GBDATA *gb_main, const RootCallback &after_import_cb)
GB_transaction ta(gb_var)
bool GEN_is_genome_db(GBDATA *gb_main, int default_value)
Definition: adGene.cxx:20
#define AWAR_IMPORT_GENOM_DB
Definition: awti_import.hxx:25
GB_ERROR write_int(long aw_int)
void AWTI_import_set_ali_and_type(AW_root *awr, const char *ali_name, const char *ali_type, GBDATA *gbmain)
NT_global GLOBAL
Definition: NT_main.cxx:44
void unquery_all()