30 #define ST_ML_AWAR "tmp/st_ml/"
32 #define ST_ML_AWAR_COLSTAT_PREFIX ST_ML_AWAR "colstat/"
33 #define ST_ML_AWAR_COLSTAT_NAME ST_ML_AWAR_COLSTAT_PREFIX "name"
35 #define ST_ML_AWAR_FILTER_PREFIX ST_ML_AWAR "filter/"
36 #define ST_ML_AWAR_FILTER_ALIGNMENT ST_ML_AWAR_FILTER_PREFIX "alignment"
37 #define ST_ML_AWAR_FILTER_NAME ST_ML_AWAR_FILTER_PREFIX "name"
38 #define ST_ML_AWAR_FILTER_FILTER ST_ML_AWAR_FILTER_PREFIX "filter"
39 #define ST_ML_AWAR_FILTER_SIMPLIFY ST_ML_AWAR_FILTER_PREFIX "simplify"
41 #define ST_ML_AWAR_CQ_BUCKET_SIZE ST_ML_AWAR "bucket_size"
42 #define ST_ML_AWAR_CQ_MARKED_ONLY ST_ML_AWAR "marked_only"
43 #define ST_ML_AWAR_CQ_DEST_FIELD ST_ML_AWAR "dest_field"
44 #define ST_ML_AWAR_CQ_REPORT ST_ML_AWAR "report"
45 #define ST_ML_AWAR_CQ_KEEP_REPORTS ST_ML_AWAR "keep_reports"
71 AW_window_simple *aws =
new AW_window_simple;
72 aws->init(root,
"COLUMN_STATISTIC",
"COLUMN STATISTIC");
78 aws->create_button(
"CLOSE",
"CLOSE",
"C");
82 aws->create_button(
"HELP",
"HELP",
"H");
93 aws->callback(makeWindowCallback(
st_ok_cb, st_ml));
94 aws->create_button(
"GO",
"GO",
"G");
98 aws->button_length(20);
103 aws->insert_toggle(
"All species",
"A", 0);
104 aws->insert_toggle(
"Marked species",
"M", 1);
105 aws->update_toggle_field();
111 return new ST_ML(gb_main);
119 return st_ml->
get_color_string(species_name, node, start_ali_pos, end_ali_pos);
138 colstat =
new ColumnStat(gb_main, root, columnStatAwarName, awar_default_alignment);
139 filter =
new WeightedFilter(gb_main, root, filterAwarName,
NULp, awar_default_alignment);
150 int fieldsRemoved = 0;
151 int qualitiesRemoved = 0;
159 gb_species && !
error;
166 if (!error) fieldsRemoved++;
175 if (!error) qualitiesRemoved++;
185 note.
cat(
"Removed ");
186 if (fieldsRemoved>0) {
187 note.
nprintf(100,
"%i '%s'", fieldsRemoved, dest_field);
188 if (qualitiesRemoved>0) note.
cat(
" and ");
190 if (qualitiesRemoved>0) note.
nprintf(50,
"%i 'quality'", qualitiesRemoved);
191 else if (!fieldsRemoved && !qualitiesRemoved) note.
cat(
"no");
192 note.
cat(
" entries.");
224 if (!error && !keep_old_reports) {
234 error = ta.
close(error);
271 static AW_window_simple *aws =
NULp;
273 aws =
new AW_window_simple;
274 aws->init(root,
"CHIMERA_CHECK",
"Chimera Check of marked sequences");
275 aws->load_xfig(
"chimera_check.fig");
281 aws->create_button(
"CLOSE",
"CLOSE",
"C");
285 aws->create_button(
"HELP",
"HELP",
"H");
293 aws->insert_option(
"All in tree",
"t", 0);
294 aws->insert_option(
"Only marked and in tree",
"m", 1);
295 aws->update_option_menu();
315 aws->insert_option(
"No",
"N", 0);
316 aws->insert_option(
"to temporary entry",
"t", 1);
317 aws->insert_option(
"to permanent entry",
"p", 2);
318 aws->update_option_menu();
326 aws->create_button(
"DEL_ENTRIES",
"Remove them now!",
"R");
328 aws->button_length(10);
330 aws->callback(makeWindowCallback(
st_check_cb, cb_data));
331 aws->create_button(
"GO",
"GO",
"G");
GBDATA * get_gb_main() const
GB_ERROR calc_st_ml(const char *tree_name, const char *alignment_name, const char *species_names, int marked_only, ColumnStat *colstat, const WeightedFilter *weighted_filter) __ATTR__USERESULT
st_check_cb_data(GBDATA *gb_main_, AW_root *root, const char *columnStatAwarName, const char *filterAwarName, AW_awar *awar_default_alignment)
adfiltercbstruct * get_adfiltercbstruct()
AW_window * STAT_create_main_window(AW_root *root, ST_ML *st_ml)
void(* WindowCallbackSimple)(AW_window *)
ColumnStat * get_column_statistic()
void load_xfig(const char *file, bool resize=true)
void STAT_set_postcalc_callback(ST_ML *st_ml, WindowCallbackSimple postcalc_cb, AW_window *cb_win)
AW_window * COLSTAT_create_selection_window(AW_root *aw_root, ColumnStat *column_stat)
#define ST_ML_AWAR_CQ_DEST_FIELD
unsigned char ST_ML_Color
GB_ERROR GB_end_transaction(GBDATA *gbd, GB_ERROR error)
void AWT_insert_config_manager(AW_window *aww, AW_default default_file_, const char *id, const StoreConfigCallback &store_cb, const RestoreConfigCallback &load_or_reset_cb, const char *macro_id, const AWT_predefined_config *predef)
#define AWAR_DEFAULT_ALIGNMENT
AW_window * STAT_create_chimera_check_window(AW_root *root, GBDATA *gb_main)
#define ST_ML_AWAR_CQ_REPORT
static char * alignment_name
#define ST_ML_AWAR_CQ_BUCKET_SIZE
void AW_POPDOWN(AW_window *window)
void cat(const char *from)
GB_ERROR GB_push_transaction(GBDATA *gbd)
#define NO_FIELD_SELECTED
GB_ERROR GB_delete(GBDATA *&source)
AP_tree * find_node_by_name(const char *species_name)
void create_itemfield_selection_button(AW_window *aws, const FieldSelDef &selDef, const char *at)
#define ST_ML_AWAR_COLSTAT_NAME
ST_ML * STAT_create_ST_ML(GBDATA *gb_main)
GB_ERROR GB_await_error()
WindowCallback makeHelpCallback(const char *helpfile)
GB_ERROR st_ml_check_sequence_quality(GBDATA *gb_main, const char *tree_name, const char *alignment_name, ColumnStat *colstat, const WeightedFilter *weighted_filter, int bucket_size, int marked_only, st_report_enum report, const char *dest_field)
static void st_remove_entries_cb(AW_window *aww, GBDATA *gb_main)
static AWT_config_mapping_def chimera_config_mapping[]
CONSTEXPR long FIELD_FILTER_STRING_WRITEABLE
static void STAT_create_awars(AW_root *root, GBDATA *gb_main)
static void error(const char *msg)
void STAT_destroy_ST_ML(ST_ML *&st_ml)
bool STAT_update_ml_likelihood(ST_ML *st_ml, char *result[4], int &latest_update, const char *species_name, AP_tree *node)
AW_window * awt_create_select_filter_win(AW_root *aw_root, adfiltercbstruct *acbs)
const char * prepare_and_get_selected_itemfield(AW_root *awr, const char *awar_name, GBDATA *gb_main, const ItemSelector &itemtype, FailIfField failIf)
char * read_string() const
#define ST_ML_AWAR_CQ_MARKED_ONLY
#define ST_ML_AWAR_CQ_KEEP_REPORTS
AW_awar * awar(const char *awar)
#define ST_ML_AWAR_FILTER_SIMPLIFY
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
void set_postcalc_callback(WindowCallbackSimple postcalc_cb_, AW_window *cb_window_)
GB_ERROR close(GB_ERROR error)
bool update_ml_likelihood(char *result[4], int &latest_update, const char *species_name, AP_tree *node)
static void st_ok_cb(AW_window *aww, ST_ML *st_ml)
void nprintf(size_t maxlen, const char *templat,...) __ATTR__FORMAT_MEMBER(2)
AW_awar * map(const char *awarn)
ItemSelector & SPECIES_get_selector()
GBDATA * GBT_first_species(GBDATA *gb_main)
void aw_message(const char *msg)
static GB_ERROR st_remove_entries(AW_root *awr, GBDATA *gb_main, bool verbose)
GBDATA * GBT_next_species(GBDATA *gb_species)
const char * get_data() const
ST_ML_Color * get_color_string(const char *species_name, AP_tree *node, size_t start_ali_pos, size_t end_ali_pos)
AP_tree * STAT_find_node_by_name(ST_ML *st_ml, const char *species_name)
long GBT_get_species_count(GBDATA *gb_main)
GB_transaction ta(gb_var)
ST_ML_Color * STAT_get_color_string(ST_ML *st_ml, char *species_name, AP_tree *node, int start_ali_pos, int end_ali_pos)
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
void hide_or_notify(const char *error)
void create_column_statistic(AW_root *awr, const char *awarname, AW_awar *awar_default_alignment)
#define ST_ML_AWAR_FILTER_FILTER
GBDATA * GB_entry(GBDATA *father, const char *key)
void inc_and_check_user_abort(GB_ERROR &error)
void aw_message_if(GB_ERROR error)
#define ST_ML_AWAR_FILTER_ALIGNMENT
static void st_check_cb(AW_window *aww, st_check_cb_data *data)
void do_postcalc_callback()
#define ST_ML_AWAR_FILTER_NAME