30 "don't count (ignore) ",
31 "if occurs most often => forget whole column",
32 "if occurs => forget whole column ",
33 "count, but do NOT use as maximum ",
34 "treat as uppercase character ",
35 "treat as regular character ",
61 if (alisel_window) alisel_window->
hide();
94 AWT_browser_forget_db(gb_main);
118 switch (whatChanged) {
137 for (gbd =
GB_child(gb_sai); gbd; gbd = gb2) {
141 if (!strcmp(key,
"name"))
continue;
142 if (!strncmp(key,
"ali_", 4))
continue;
152 for (gbd =
GB_child(gb_ali); gbd; gbd = gb2) {
156 if (!strcmp(key,
"data"))
continue;
157 if (!strcmp(key,
"_TYPE"))
continue;
178 error =
"Nothing calculated yet";
182 char *full_save_name =
NULp;
183 FILE *saveResults =
NULp;
202 char *data = ARB_calloc<char>(len+1);
206 for (
int x=0; x<len; x++) {
209 if (x<startcol || x>stopcol) {
213 float ml = markerline[x];
214 if (nr==2 && ml>0.0) {
216 fprintf(saveResults,
"%i\t%.2f\n", cnt, ml);
220 if (ml>=0.0 && ml>=minhom && ml<=maxhom) {
224 if (ml>=100.0) digit = 1;
227 if (ml>=10.0) digit =
int(ml/10);
237 if (digit<0) c =
'-';
238 else c =
'0' + digit%10;
251 fprintf(stderr,
"Note: Frequencies as well saved to '%s'\n", full_save_name);
257 "Start %li; Stop %li; Minhom %li%%; Maxhom %li%%",
258 startcol, stopcol, minhom, maxhom);
263 free(full_save_name);
266 if (!error) *gb_sai_ptr = gb_sai;
275 int fname_len = strlen(fname);
277 char *digit_appended = ARB_alloc<char>(fname_len+2);
278 memcpy(digit_appended, fname, fname_len);
279 strcpy(digit_appended+fname_len,
"0");
281 freeset(fname, digit_appended);
285 for (i=0; !error && i<3; i++) {
286 fname[fname_len] =
'0'+i;
305 for (
GBDATA *gbd =
GB_child(gb_sai), *gbnext; gbd; gbd = gbnext) {
309 if (!strcmp(key,
"name"))
continue;
310 if (!strncmp(key,
"ali_", 4))
continue;
320 for (
GBDATA *gbd =
GB_child(gb_ali), *gbnext; gbd; gbd = gbnext) {
324 if (!strcmp(key,
"bits"))
continue;
325 if (!strcmp(key,
"_TYPE"))
continue;
346 error =
"Nothing calculated yet";
356 char *bits = ARB_calloc<char>(len+1);
360 for (x=0; x<len; x++) {
363 if (x < startcol || x>stopcol) {
367 float ml = markerline[x];
369 if (ml>=0.0 && ml>=minhom && ml<=maxhom) bit = 1;
380 sprintf(buffer,
"FMX: Filter by Maximum Frequency: "
381 "Start %li; Stop %li; Minhom %li%%; Maxhom %li%%",
382 startcol, stopcol, minhom, maxhom);
398 AW_window_simple *aws =
new AW_window_simple;
401 aws->init(root,
"EXPORT_FREQUENCY_LINES",
"Export Frequency Lines");
404 aws->init(root,
"EXPORT_MARKER_LINE",
"Export Marker Line");
407 aws->load_xfig(
"phylo/save_markerline.fig");
411 aws->create_button(
"CLOSE",
"CLOSE",
"C");
415 aws->create_button(
"HELP",
"HELP",
"H");
425 else aws->callback(makeWindowCallback(
PH_save_ml_cb, ph_root));
426 aws->create_button(
"EXPORT",
"EXPORT",
"E");
433 awm->
init(aw_root,
"ARB_PHYLO",
"ARB_PHYLO", 830, 630);
437 const GcChangedCallback gcChangedCb = makeGcChangedCallback(
gc_changed_cb);
448 "NOT_MARKER$#A270C0",
462 AWT_create_debug_menu(awm);
518 AW_window_simple *aws =
new AW_window_simple;
520 aws->init(aw_root,
"SELECT_ALIGNMENT",
"ARB_PHYLO: Select alignment");
522 aws->button_length(10);
524 aws->at(
"which_alignment");
527 aws->auto_space(10, 10);
531 aws->create_button(
"OK",
"Ok",
"D");
533 aws->callback(makeWindowCallback(
ph_exit, ph_root));
534 aws->create_button(
"ABORT",
"Abort",
"D");
563 if (argc > 2 || (argc == 2 && strcmp(argv[1],
"--help") == 0)) {
564 fprintf(stderr,
"Usage: arb_phylo [database]\n");
568 const char *db_server = (argc == 2 ? argv[1] :
":");
588 AWT_announce_db_to_browser(gb_main,
GBS_global_string(
"ARB-database (%s)", db_server));
605 for (num_alignments = 0; alignment_names[num_alignments]; num_alignments++) {}
607 if (num_alignments > 1) {
#define AWAR_PHYLO_FILTER_STARTCOL
static PH_display * ph_display
AW_HEADER_MAIN const char * filter_text[FILTER_MODES]
GB_ERROR GB_write_bits(GBDATA *gbd, const char *bits, long size, const char *c_0)
void set_resize_callback(AW_area area, const WindowCallback &wcb)
AW_DB_selection * awt_create_SAI_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname, const SaiSelectionlistFilterCallback &fcb)
void GB_remove_on_exit(const char *filename)
void button_length(int length)
AW_device * get_device(AW_area area)
GBDATA * GB_child(GBDATA *father)
__ATTR__USERESULT_TODO GB_ERROR ARB_init_global_awars(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main)
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const WindowCallback &wcb)
GB_ERROR GB_write_string(GBDATA *gbd, const char *s)
AW_window * phylo_main_window
void load_xfig(const char *file, bool resize=true)
static AW_window * PH_save_markerline(AW_root *root, PH_root *ph_root, int multi_line)
const char * get_window_id() const
int ARB_main(int argc, char *argv[])
void GBT_get_alignment_names(ConstStrArray &names, GBDATA *gbd)
char * ARB_strdup(const char *str)
AW_window * PH_create_filter_window(AW_root *aw_root)
AW_awar * set_minmax(float min, float max)
const char * GBS_global_string(const char *templat,...)
long GBT_get_alignment_len(GBDATA *gb_main, const char *aliname)
void AW_POPDOWN(AW_window *window)
void AW_insert_common_property_menu_entries(AW_window_menu_modes *awmm)
__ATTR__USERESULT GB_ERROR configure_macro_recording(AW_root *aw_root, const char *client_id, GBDATA *gb_main)
GB_ERROR open(const char *db_server)
static bool valid_alignment_selected(AW_root *aw_root, GBDATA *gb_main)
AW_gc_manager * AW_manage_GC(AW_window *aww, const char *gc_base_name, AW_device *device, int base_drag, AW_GCM_AREA area, const GcChangedCallback &changecb, const char *default_background_color,...)
char buffer[MESSAGE_BUFFERSIZE]
GB_ERROR GB_push_transaction(GBDATA *gbd)
GB_ERROR GB_delete(GBDATA *&source)
char * GB_set_cache_size(GBDATA *gbd, size_t size)
const char * read_char_pntr() const
NOT4PERL GBDATA * GBT_add_data(GBDATA *species, const char *ali_name, const char *key, GB_TYPES type) __ATTR__DEPRECATED_TODO("better use GBT_create_sequence_data()")
GB_ERROR GB_await_error()
WindowCallback makeHelpCallback(const char *helpfile)
GB_CSTR GB_read_key_pntr(GBDATA *gbd)
#define AWAR_PHYLO_FILTER_STOPCOL
static void gc_changed_cb(GcChange whatChanged)
void GBK_terminate(const char *error) __ATTR__NORETURN
static PH_used_windows * windowList
void AW_save_properties(AW_window *aw)
void set_expose_callback(AW_area area, const WindowCallback &wcb)
void create_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
AW_window * AW_create_gc_window(AW_root *aw_root, AW_gc_manager *gcman)
void help_text(const char *id)
static void error(const char *msg)
FILE * GB_fopen_tempfile(const char *filename, const char *fmode, char **res_fullname)
AW_window * AW_preset_window(AW_root *root)
void PH_create_filter_variables(AW_root *aw_root, AW_default default_file, GBDATA *gb_main)
void ph_view_species_cb()
UserActionTracker * need_macro_ability()
char * read_string() const
#define AWAR_PHYLO_FILTER_MAXHOM
AW_awar * awar(const char *awar)
GB_ERROR GB_pop_transaction(GBDATA *gbd)
#define AWAR_PHYLO_FILTER_MINHOM
static AW_window_menu_modes_opengl * awm
void unlink_awars_from_DB(GBDATA *gb_main)
static void PH_save_ml_cb(AW_window *aww, PH_root *ph_root)
AW_DB_selection * awt_create_ALI_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname, const char *ali_type_match)
char * GB_unique_filename(const char *name_prefix, const char *suffix)
AW_root * AWT_create_root(const char *properties, const char *program, UserActionTracker *user_tracker)
void set_info_area_height(int height)
void set_bottom_area_height(int height)
void auto_space(int xspace, int yspace)
GB_ERROR close(GB_ERROR error)
static AW_window * create_phyl_main_window(AW_root *aw_root, PH_root *ph_root)
GBDATA * get_gb_main() const
static AW_window * create_select_alignment_window(AW_root *aw_root, AW_window *main_window, PH_root *ph_root)
void aw_message(const char *msg)
void insert_macro_menu_entry(AW_window *awm, bool prepend_separator)
__ATTR__NORETURN void aw_popup_exit(const char *msg)
void shutdown_macro_recording(AW_root *aw_root)
GB_ERROR GBT_set_startup_alignment(GBDATA *gb_main, const char *alignment_name)
static void startup_sequence_cb(AW_window *alisel_window, AW_window *main_window, PH_root *ph_root)
GB_ERROR write_string(const char *aw_string)
char * GBT_get_default_alignment(GBDATA *gb_main)
void AWT_install_cb_guards()
GBDATA * GB_nextChild(GBDATA *child)
GBDATA * GBT_find_or_create_SAI(GBDATA *gb_main, const char *name)
GB_transaction ta(gb_var)
void callback(const WindowCallback &cb)
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
static void PH_save_ml_multiline_cb(AW_window *aww, PH_root *ph_root)
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
static GB_ERROR PH_create_ml_multiline_SAI(GB_CSTR sai_name, int nr, GBDATA **gb_sai_ptr, PH_root *ph_root)
#define AWAR_PHYLO_FILTER_FILTER
#define AWAR_PHYLO_MARKERLINENAME
GB_ERROR ph_check_initialized()
static void create_variables(AW_root *aw_root, AW_default def, GBDATA *gb_main)
static __ATTR__NORETURN void ph_exit(AW_window *aw_window, PH_root *ph_root)
GB_ERROR write_int(long aw_int)
void aw_message_if(GB_ERROR error)
void GB_close(GBDATA *gbd)
#define AWAR_PHYLO_ALIGNMENT
void create_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, const char *color=NULp)