24 #define AWAR_INSDEL "insdel/"
25 #define TMP_AWAR_INSDEL "tmp/" AWAR_INSDEL
27 #define AWAR_INSDEL_AMOUNT AWAR_INSDEL "nchar"
28 #define AWAR_INSDEL_DELETABLE AWAR_INSDEL "characters"
29 #define AWAR_INSDEL_RANGE AWAR_INSDEL "range"
30 #define AWAR_INSDEL_SAI AWAR_INSDEL "sainame"
31 #define AWAR_INSDEL_CONTAINS AWAR_INSDEL "contain"
32 #define AWAR_INSDEL_SAI_CHARS AWAR_INSDEL "saichars"
33 #define AWAR_INSDEL_AFFECTED TMP_AWAR_INSDEL "affected"
34 #define AWAR_INSDEL_WHAT TMP_AWAR_INSDEL "what"
35 #define AWAR_INSDEL_DIRECTION AWAR_INSDEL "direction"
55 const char *
get_ali()
const {
return ali; }
87 const char *what =
NULp;
89 case RANGES: what =
"selected ranges";
break;
103 if (!error) error = SELECTED.
track_ali(gb_main);
124 if (!saiName[0]) error =
NULp;
161 if (mode ==
DELETE) nchar = -nchar;
164 if (!error) error = SELECTED.
track_ali(gb_main);
174 if (!error) error = SELECTED.
track_ali(gb_main);
202 static AW_window_simple *aws =
NULp;
204 aws =
new AW_window_simple;
206 aws->init(root,
"INSDEL_COLUMNS",
"Insert/delete columns");
208 aws->load_xfig(
"insdel.fig");
209 aws->button_length(8);
213 aws->create_button(
"CLOSE",
"CLOSE",
"C");
217 aws->create_button(
"HELP",
"HELP",
"H");
219 aws->label_length(27);
222 aws->label(
"Sequence Position");
226 aws->label(
"How many Characters");
229 aws->at(
"characters");
230 aws->label(
"Delete Only (% = all)");
233 aws->auto_space(10, 0);
236 aws->callback(makeWindowCallback(
insdel_event,
INSERT)); aws->create_button(
"INSERT",
"INSERT",
"I");
237 aws->callback(makeWindowCallback(
insdel_event,
DELETE)); aws->create_button(
"DELETE",
"DELETE",
"D");
256 "*gaps_by_variability",
257 "Use to insert 2 gaps next to all\ncolumns with high variability",
258 "amount='2';chars='123';contain='1';direction='1';range='1';sai='POS_VAR_BY_PARSIMONY'",
261 "*erase_columns_without_data",
262 "selects all columns where \nMAX_FREQUENCY contains '='",
263 "chars='=';contain='1';deletable='-.';range='1';sai='MAX_FREQUENCY'",
269 static AW_window_simple *aws =
NULp;
271 aws =
new AW_window_simple;
273 aws->init(root,
"INSDEL_BY_SAI",
"Insert/delete using SAI");
275 aws->load_xfig(
"insdel_sai.fig");
276 aws->button_length(8);
280 aws->create_button(
"CLOSE",
"CLOSE",
"C");
284 aws->create_button(
"HELP",
"HELP",
"H");
291 aws->insert_option(
"ranges",
"r",
RANGES);
293 aws->update_option_menu();
295 aws->button_length(25);
302 aws->insert_option(
"contains",
"c",
CONTAINS);
304 aws->update_option_menu();
306 aws->at(
"characters");
309 aws->button_length(18);
314 aws->button_length(7);
318 aws->create_button(
"DELETE",
"DELETE",
"D");
320 aws->at(
"deletable");
325 aws->create_button(
"INSERT",
"INSERT",
"I");
330 aws->at(
"direction");
332 aws->insert_option(
"in front of",
"f",
INFRONTOF);
333 aws->insert_option(
"behind",
"b",
BEHIND);
334 aws->update_option_menu();
337 aws->button_length(15);
GB_ERROR GB_begin_transaction(GBDATA *gbd)
void set_ranges(const RangeList &new_ranges)
#define AWAR_CURSOR_POSITION
static void range_changed_cb(AW_root *root)
range_set::const_iterator iterator
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)
void GB_end_transaction_show_error(GBDATA *gbd, GB_ERROR error, void(*error_handler)(GB_ERROR))
AW_awar * set_minmax(float min, float max)
static StaticData SELECTED
const char * GBS_global_string(const char *templat,...)
void AW_POPDOWN(AW_window *window)
GB_ERROR ARB_insdel_columns(GBDATA *Main, const char *alignment_name, long pos, long count, const char *deletable_chars)
GBDATA * GBT_expect_SAI(GBDATA *gb_main, const char *name)
void awt_create_SAI_selection_button(GBDATA *gb_main, AW_window *aws, const char *varname, const SaiSelectionlistFilterCallback &fcb)
GB_ERROR ARB_delete_columns_using_SAI(GBDATA *Main, const char *alignment_name, const RangeList &ranges, const char *deletable_chars)
#define AWAR_INSDEL_DELETABLE
StaticData(const StaticData &other)
AW_awar * add_callback(const RootCallback &cb)
static GB_ERROR update_RangeList(AW_root *root, GBDATA *gb_main)
const char * get_ali() const
const char * read_char_pntr() const
GB_ERROR ARB_insert_columns_using_SAI(GBDATA *Main, const char *alignment_name, const RangeList &ranges, UseRange units, InsertWhere where, size_t amount)
GB_ERROR GB_await_error()
WindowCallback makeHelpCallback(const char *helpfile)
static void range_count_update_cb(AW_root *root)
static void error(const char *msg)
#define AWAR_INSDEL_AMOUNT
ASSERTING_CONSTEXPR_INLINE int info2bio(int infopos)
AW_window * create_insertDeleteBySAI_window(AW_root *root, GBDATA *gb_main)
#define AWAR_INSDEL_AFFECTED
static void insdel_sai_event(AW_window *aws, InsdelMode mode)
void create_insertDeleteColumn_variables(AW_root *root, AW_default props)
AW_awar * awar(const char *awar)
static void insdel_event(AW_window *aws, InsdelMode mode)
GBDATA * GBT_find_sequence(GBDATA *gb_species, const char *aliname)
#define AWAR_INSDEL_RANGE
ASSERTING_CONSTEXPR_INLINE int bio2info(int biopos)
#define AWAR_INSDEL_CONTAINS
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
static AWT_predefined_config insdel_by_SAI_predef_config[]
DECLARE_ASSIGNMENT_OPERATOR(StaticData)
GB_ERROR track_ali(GBDATA *gb_main)
RangeList build_RangeList_from_string(const char *SAI_data, const char *set_bytes, bool invert)
void aw_message(const char *msg)
static AWT_config_mapping_def insdel_by_SAI_config_def[]
GB_ERROR write_string(const char *aw_string)
char * GBT_get_default_alignment(GBDATA *gb_main)
bool contains(const CONT &container, const KEY &key)
AW_window * create_insertDeleteColumn_window(AW_root *root)
static int columns_of(const RangeList &ranges)
#define AWAR_INSDEL_DIRECTION
#define AWAR_INSDEL_SAI_CHARS
GB_transaction ta(gb_var)
GB_CSTR GB_read_char_pntr(GBDATA *gbd)
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
GB_ERROR GBT_check_data(GBDATA *Main, const char *alignment_name)
static void cleanup_when_closing(AW_window *)
const RangeList & get_ranges() const
static void update_RangeList_cb(AW_root *root)
GB_ERROR write_int(long aw_int)
void aw_message_if(GB_ERROR error)