ARB
MP_main.cxx
Go to the documentation of this file.
1 // ================================================================ //
2 // //
3 // File : MP_main.cxx //
4 // Purpose : //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // ================================================================ //
10 
11 #include <multi_probe.hxx>
12 
13 #include "MP_probe.hxx"
14 #include "MultiProbe.hxx"
15 #include "mp_proto.hxx"
16 
17 #include <TreeDisplay.hxx>
18 
19 #include <aw_root.hxx>
20 #include <aw_awar_defs.hxx>
21 #include <awt_canvas.hxx>
22 
25 char MP_probe_tab[256]; // zum checken, ob ein eingegebener Sondenstring ok ist
29 bool pt_server_different = false;
30 
32  aw_root = awr;
33  scr = canvas;
34  stc = NULp;
35  create_awars();
36  mp_window = new MP_Window(aw_root, canvas->gb_main);
37  p_eval = NULp;
38 }
39 
44 
45  delete p_eval;
46  delete stc;
47  delete mp_window;
48 
49  new_pt_server = true;
50 }
51 
53  delete p_eval;
54  p_eval = NULp;
55 }
56 
57 ProbeValuation *MP_Main::new_probe_eval(char **field, int size, int *array, int *single_mismatch) {
58  p_eval = new ProbeValuation(field, size, array, single_mismatch);
59  p_eval->set_act_gen(new Generation(p_eval->get_max_init_for_gen(), 1)); // erste Generation = Ausgangspopulation
60  return p_eval;
61 }
62 
63 void MP_Main::create_awars() {
64  aw_root->awar_string(MP_AWAR_SEQIN);
66  aw_root->awar_string(MP_AWAR_PROBELIST)->add_target_var(& mp_gl_awars.probelist);
68  aw_root->awar_int(MP_AWAR_COMPLEMENT, 1)->add_target_var(& mp_gl_awars.complement);
70  remembered_mismatches = 0; // derselbe initiale Wert wie mp_gl_awars.no_of_mismatches
71  aw_root->awar_int(MP_AWAR_PTSERVER)->add_target_var(& mp_gl_awars.ptserver);
74  aw_root->awar_int(MP_AWAR_NOOFPROBES)->add_target_var(& mp_gl_awars.no_of_probes)->write_int(3);
79 
80  aw_root->awar_int(MP_AWAR_EMPHASIS)->add_target_var(& mp_gl_awars.emphasis)->write_int(0);
81  aw_root->awar_float(MP_AWAR_GREYZONE)->add_target_var(& mp_gl_awars.greyzone)->write_float(0.0);
82  aw_root->awar_int(MP_AWAR_ECOLIPOS)->add_target_var(& mp_gl_awars.ecolipos)->write_int(0);
83 
84  aw_root->awar_int(MP_AWAR_AUTOADVANCE, 1);
85 }
86 
87 
88 static void create_tables() {
89  int i;
90 
91  // probe_tab
92  for (i=0; i<256; i++)
93  MP_probe_tab[i] = false;
94 
95  const unsigned char *true_chars = (const unsigned char *)"atgucnATGUCN";
96  for (i = 0; true_chars[i]; ++i) {
97  MP_probe_tab[true_chars[i]] = true;
98  }
99 }
100 
102  if (!mp_main) {
103  create_tables();
104  mp_main = new MP_Main(root, canvas);
105  }
106 
107  AW_window *aw = mp_main->get_mp_window()->get_window();
108  aw->show();
109 
110  return aw;
111 }
112 
long singlemismatches
Definition: MultiProbe.hxx:97
bool pt_server_different
Definition: MP_main.cxx:29
char * probelist
Definition: MultiProbe.hxx:89
void MP_gen_quality(AW_root *awr)
Definition: MP_noclass.cxx:89
AW_window_simple * get_window()
Definition: MultiProbe.hxx:164
#define MP_AWAR_RESULTPROBES
Definition: MultiProbe.hxx:52
long no_of_mismatches
Definition: MultiProbe.hxx:95
long emphasis
Definition: MultiProbe.hxx:101
#define MP_AWAR_NOOFPROBES
Definition: MultiProbe.hxx:54
#define MP_AWAR_QUALITY
Definition: MultiProbe.hxx:55
#define MP_AWAR_RESULTPROBESCOMMENT
Definition: MultiProbe.hxx:53
AW_window * create_multiprobe_window(AW_root *root, TREE_canvas *canvas)
Definition: MP_main.cxx:101
#define MP_AWAR_ECOLIPOS
Definition: MultiProbe.hxx:61
MP_Main * mp_main
Definition: MP_main.cxx:24
long ecolipos
Definition: MultiProbe.hxx:102
char * result_probes
Definition: MultiProbe.hxx:90
#define MP_AWAR_EMPHASIS
Definition: MultiProbe.hxx:60
void MP_gen_singleprobe(AW_root *awr)
Definition: MP_noclass.cxx:174
AW_awar * add_callback(const RootCallback &cb)
Definition: AW_awar.cxx:234
static void create_tables()
Definition: MP_main.cxx:88
void show()
Definition: AW_window.cxx:1658
int remembered_mismatches
Definition: MP_main.cxx:26
AW_awar * awar_float(const char *var_name, float default_value=0.0, AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:560
#define MP_AWAR_SELECTEDPROBES
Definition: MultiProbe.hxx:45
ProbeValuation * new_probe_eval(char **field, int size, int *array, int *mismatches)
Definition: MP_main.cxx:57
void destroy_probe_eval()
Definition: MP_main.cxx:52
char MP_probe_tab[256]
Definition: MP_main.cxx:25
#define QUALITYDEFAULT
Definition: MultiProbe.hxx:64
#define MP_AWAR_PROBELIST
Definition: MultiProbe.hxx:46
long complement
Definition: MultiProbe.hxx:94
int get_max_init_for_gen()
Definition: MP_probe.hxx:172
char * result_probes_comment
Definition: MultiProbe.hxx:91
long ptserver
Definition: MultiProbe.hxx:98
AW_awar * remove_callback(const RootCallback &cb)
Definition: AW_awar.cxx:527
bool new_pt_server
Definition: MP_noclass.cxx:33
#define MP_AWAR_WEIGHTEDMISMATCHES
Definition: MultiProbe.hxx:47
float outside_mismatches_difference
Definition: MultiProbe.hxx:92
float greyzone
Definition: MultiProbe.hxx:105
#define MP_AWAR_MISMATCHES
Definition: MultiProbe.hxx:49
void set_act_gen(Generation *g)
Definition: MP_probe.hxx:171
#define MP_AWAR_GREYZONE
Definition: MultiProbe.hxx:59
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:580
#define MP_AWAR_AUTOADVANCE
Definition: MultiProbe.hxx:62
long weightedmismatches
Definition: MultiProbe.hxx:93
AW_awar * add_target_var(char **ppchr)
Definition: AW_awar.cxx:239
#define MP_AWAR_SEQIN
Definition: MultiProbe.hxx:44
#define MP_AWAR_COMPLEMENT
Definition: MultiProbe.hxx:48
MP_Main(AW_root *awr, TREE_canvas *canvas)
Definition: MP_main.cxx:31
char * selected_probes
Definition: MultiProbe.hxx:88
#define MP_AWAR_QUALITYBORDER1
Definition: MultiProbe.hxx:58
#define NULp
Definition: cxxforward.h:97
long no_of_probes
Definition: MultiProbe.hxx:96
MP_Window * get_mp_window()
Definition: MultiProbe.hxx:143
awar_vars mp_gl_awars
Definition: MP_main.cxx:23
void MP_modify_selected(AW_root *awr)
Definition: MP_noclass.cxx:124
~MP_Main()
Definition: MP_main.cxx:40
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:570
#define MP_AWAR_PTSERVER
Definition: MultiProbe.hxx:50
GB_ERROR write_float(float aw_float)
#define MP_AWAR_SINGLEMISMATCHES
Definition: MultiProbe.hxx:56
#define MP_AWAR_OUTSIDEMISMATCHES
Definition: MultiProbe.hxx:57
long qualityborder_best
Definition: MultiProbe.hxx:100
long probe_quality
Definition: MultiProbe.hxx:99
int anz_elem_marked
Definition: MP_main.cxx:27
GB_ERROR write_int(long aw_int)
static void create_awars(AW_root *aw_root, AW_default def)
Definition: SEC_db.cxx:364
int anz_elem_unmarked
Definition: MP_main.cxx:28
GBDATA * gb_main
Definition: awt_canvas.hxx:336