84 const char *name,
int name_len,
const char *
seq,
int seq_len)
86 if (allocated==numberspecies) {
87 long new_allocated = (allocated*3)/2;
91 allocated = new_allocated;
99 if (seq_len>maxalign) {
107 long &allocated,
long &numberspecies,
long &maxalign,
108 int show_sequence,
int show_SAI,
int show_helix,
int show_consensus,
int show_remark)
123 if (!sequence_term)
goto end_of_loop;
124 sequence_terminal = sequence_term->to_sequence_terminal();
129 bool is_consensus =
false;
134 show = show_consensus;
141 show = show_sequence;
154 e4_assert(seq && strlen(seq) ==
size_t(seq_len));
158 if (folded_group_man) {
159 if (folded_group_man==group_manager) {
164 char *new_name = ARB_alloc<char>(name_len+2);
166 sprintf(new_name,
"-%s", name);
167 freeset(name, new_name);
184 if (show_helix && !is_SAI && ED4_ROOT->
helix->
size()) {
189 if (show_remark && !is_consensus) {
193 if (remark_name_term) {
201 set_and_realloc_gde_array(the_names, the_sequences, allocated, numberspecies, maxalign, name, name_len, remark, remark_len);
212 if (terminal==last)
break;
234 long allocated = 100;
240 char *err =
add_area_for_gde(ED4_ROOT->
top_area_man, the_names, the_sequences, allocated, numberspecies, maxalign, top, tops, toph, topk, topr);
242 err =
add_area_for_gde(ED4_ROOT->
middle_area_man, the_names, the_sequences, allocated, numberspecies, maxalign, middle, middles, middleh, middlek, middler);
245 if (allocated!=(numberspecies+1)) {
247 ARB_recalloc(the_sequences, allocated, numberspecies+1);
318 int def_sec_level = 0;
416 const char *data_path =
":";
417 char *config_name =
NULp;
419 if (argc > 1 && ((strcmp(argv[1],
"-h") == 0) || (strcmp(argv[1],
"--help") == 0))) {
421 "Usage: arb_edit4 [options] database\n"
422 " database name of database or ':' to connect to arb-database-server\n"
430 if (argc > 1 && strcmp(argv[1],
"-c") == 0) {
431 config_name =
new char[strlen(argv[2])+1];
432 strcpy(config_name, argv[2]);
433 argc -= 2; argv += 2;
456 AWT_announce_db_to_browser(gb_main,
GBS_global_string(
"ARB database (%s)", data_path));
479 warning = ED4_ROOT->
helix->
init(gb_main);
498 bool found_config =
false;
504 GBT_config cfg(gb_main, config_name, cfg_error);
516 aw_popup_ok(
"The editor needs a configuration stored in database.\n"
517 "Cannot continue and will terminate now.");
540 bool have_aw_root = ED4_ROOT && ED4_ROOT->
aw_root;
543 else fprintf(stderr,
"arb_edit4: Error: %s\n", error.
deliver());
545 if (have_aw_root)
delete ED4_ROOT->
aw_root;
void ED4_selected_species_changed_cb(AW_root *aw_root)
static bool have_context()
#define ED4_AWAR_SCROLL_SPEED_Y
GBDATA * GB_open(const char *path, const char *opent)
void ED4_create_NDS_awars(AW_root *root)
#define ED4_AWAR_ANNOUNCE_CHECKSUM_CHANGES
#define AWAR_EDIT_SECURITY_LEVEL
#define AWAR_EDIT_TITLE_MODE
#define ED4_AWAR_COMPRESS_SEQUENCE_GAPS
__ATTR__USERESULT_TODO GB_ERROR ARB_init_global_awars(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main)
static void ED4_gap_chars_changed(AW_root *root)
ED4_EDITMODE awar_edit_mode
#define ED4_AWAR_CREATE_FROM_CONS_REPL_EQUAL
ED4_area_manager * top_area_man
#define ED4_AWAR_REP_REPLACE_PATTERN
virtual char * resolve_pointer_to_string_copy(int *str_len=NULp) const
static void ed4_create_mainDB_awars(AW_root *root)
ED4_terminal * get_first_terminal(int start_index=0) const
bool is_SAI_terminal() const
ED4_group_manager * is_in_folded_group() const
static const int MIDDLE_AREA
#define PFOLD_AWAR_SAI_FILTER
Filter SAIs for given criteria (string); used in option menu for SAI selection.
#define ED4_AWAR_FAST_CURSOR_JUMP
#define AWAR_CURSOR_POSITION
ED4_area_manager * middle_area_man
void ED4_create_search_awars(AW_root *root)
void ED4_request_relayout()
#define ED4_AWAR_SCROLL_SPEED_X
char * ARB_strdup(const char *str)
#define AWAR_EDIT_SECURITY_LEVEL_ALIGN
void ED4_create_consensus_awars(AW_root *aw_root)
AW_awar * set_minmax(float min, float max)
#define ED4_AWAR_COMPRESS_SEQUENCE_TYPE
static const int TOP_AREA
const char * GBS_global_string(const char *templat,...)
void warning(int warning_num, const char *warning_message)
void PV_CallBackFunction(AW_root *root)
#define PFOLD_AWAR_SYMBOL_TEMPLATE_2
Symbols for the match quality as used for match method SECSTRUCT_SEQUENCE.
#define AWAR_EDIT_SECURITY_LEVEL_CHANGE
static void redraw_cursor(ED4_window *win)
void ED4_trigger_instant_refresh()
void GBK_terminatef(const char *templat,...)
ED4_base * search_ID(const char *id) FINAL_OVERRIDE
static void ed4_create_all_awars(AW_root *root, const char *config_name)
char * pfold_pair_chars[PFOLD_PAIRS]
Symbols for the match quality (defined by PFOLD_MATCH_TYPE) as used for match methods SECSTRUCT_SECST...
Compare an amino acid sequence with a reference protein secondary structure.
void ED4_selected_SAI_changed_cb(AW_root *aw_root)
static void init_object_specs()
__ATTR__USERESULT GB_ERROR configure_macro_recording(AW_root *aw_root, const char *client_id, GBDATA *gb_main)
name_value_pair pfold_match_type_awars[]
Awars for the match type; binds the PFOLD_MATCH_TYPE to the corresponding awar name.
char * pfold_pairs[PFOLD_PAIRS]
Match pair definition (see PFOLD_MATCH_TYPE) as used for match methods SECSTRUCT_SECSTRUCT and SECSTR...
static char * add_area_for_gde(ED4_area_manager *area_man, uchar **&the_names, uchar **&the_sequences, long &allocated, long &numberspecies, long &maxalign, int show_sequence, int show_SAI, int show_helix, int show_consensus, int show_remark)
#define AWAR_EDIT_RIGHTWARD
#define DEFAULT_CONFIGURATION
#define NO_FIELD_SELECTED
void ED4_create_dot_missing_bases_awars(AW_root *aw_root, AW_default aw_def)
AW_awar * add_callback(const RootCallback &cb)
GB_ERROR GDE_init(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main, GDE_get_sequences_cb get_sequences, GDE_format_alignment_cb format_ali, gde_window_type window_type)
#define PFOLD_AWAR_MATCH_METHOD
Selected method for computing the match quality (see PFOLD_MATCH_METHOD).
void ed4_change_edit_mode(AW_root *root)
#define ED4_AWAR_CREATE_FROM_CONS_ALL_UPPER
ST_ML * STAT_create_ST_ML(GBDATA *gb_main)
char * build_consensus_string(PosRange range) const
GB_ERROR GB_await_error()
static void setup(const char *gap_chars, GB_alignment_type ali_type_)
#define ED4_AWAR_CURSOR_TYPE
void set_and_realloc_gde_array(uchar **&the_names, uchar **&the_sequences, long &allocated, long &numberspecies, long &maxalign, const char *name, int name_len, const char *seq, int seq_len)
#define ED4_AWAR_CREATE_FROM_CONS_DATA_SOURCE
AW_HEADER_MAIN ED4_root * ED4_ROOT
void ED4_compression_toggle_changed_cb(AW_root *root, bool hideChanged)
#define ED4_AWAR_SPECIES_TO_CREATE
GB_ERROR ED4_pfold_set_SAI(char **protstruct, GBDATA *gb_main, const char *alignment_name, long *protstruct_len)
Sets the reference protein secondary structure SAI.
void create_awars(AW_root *root)
#define PFOLD_AWAR_SYMBOL_TEMPLATE
Symbols for the match quality as used for match methods SECSTRUCT_SECSTRUCT and SECSTRUCT_SEQUENCE_PR...
void aw_popup_ok(const char *msg)
GBDATA * get_gb_main() const
void ED4_with_all_edit_windows(void(*cb)(ED4_window *))
ED4_terminal * get_last_terminal(int start_index=-1) const
#define AWAR_FIELD_CHOSEN
int SEQ_TERM_TEXT_YOFFSET
#define AWAR_EDIT_HELIX_SPACING
ED4_window * first_window
static void ED4_postcbcb(AW_window *aww)
ED4_terminal * get_next_terminal()
static void error(const char *msg)
void create_naligner_variables(AW_root *root, AW_default db1)
#define ED4_AWAR_DIGITS_AS_REPEAT
void ED4_createVisualizeSAI_Awars(AW_root *aw_root, AW_default aw_def)
#define ED4_AWAR_COMPRESS_SEQUENCE_PERCENT
ASSERTING_CONSTEXPR_INLINE int info2bio(int infopos)
void replaceChars(char *s, char o, char n)
GBS_strstruct * not_found_message
void announce_useraction_in(AW_window *aww)
#define AWAR_SPECIES_NAME
#define AWAR_SET_CURSOR_POSITION
void ARB_recalloc(TYPE *&tgt, size_t oelem, size_t nelem)
void PV_CreateAwars(AW_root *root, AW_default aw_def)
#define PFOLD_AWAR_PAIR_TEMPLATE
Structure pairs that define the match quality (see pfold_pairs) as used for match methods SECSTRUCT_S...
#define PFOLD_PAIR_CHARS_2
Symbols for the match quality as used for match method SECSTRUCT_SEQUENCE in ED4_pfold_calculate_secs...
char * read_string() const
static void seq_colors_changed_cb()
const char * name
Name or description.
void ed4_changesecurity(AW_root *root)
AW_awar * awar(const char *awar)
void ED4_exit() __ATTR__NORETURN
GB_alignment_type alignment_type
void ED4_create_detect_bad_alignment_awars(AW_root *aw_root, AW_default aw_def)
void ED4_compression_changed_cb(AW_root *awr)
bool is_consensus_terminal() const
static void ED4_edit_direction_changed(AW_root *)
ED4_base * search_spec_child_rek(ED4_level level)
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
const char * anyGapChars()
TYPE * ARB_calloc(size_t nelem)
#define ED4_AWAR_CREATE_FROM_CONS_CREATE_POINTS
#define ED4_AWAR_CREATE_FROM_CONS_REPL_POINT
static char * ED4_create_sequences_for_gde(GBDATA **&the_species, uchar **&the_names, uchar **&the_sequences, long &numberspecies, long &maxalign)
#define PFOLD_AWAR_ENABLE
Enable structure match.
AW_awar * add_target_var(char **ppchr)
char * ARB_strndup(const char *start, int len)
long terminal_add_spacing
#define ED4_AWAR_SCROLL_MARGIN
int ARB_main(int argc, char *argv[])
#define ED4_AWAR_COMPRESS_SEQUENCE_HIDE
int value
Value attached to name.
void ED4_setup_gaps_and_alitype(const char *gap_chars, GB_alignment_type alitype)
const char * get_alignment_name() const
int INFO_TERM_TEXT_YOFFSET
#define AWAR_CURSOR_POSITION_LOCAL
ED4_seq_colors * sequence_colors
static void ed4_bind_mainDB_awar_callbacks(AW_root *root)
#define AWAR_EDIT_TERMINAL_SPACING
void aw_message(const char *msg)
const char * get_definition(int area) const
void ED4_remote_set_cursor_cb(AW_root *awr)
void AWT_install_postcb_cb(AW_postcb_cb postcb_cb)
int MAXSEQUENCECHARACTERLENGTH
void shutdown_macro_recording(AW_root *aw_root)
AW_window * create_first_window()
long max_seq_terminal_length
void request_refresh_for_sequence_terminals()
#define ED4_AWAR_GAP_CHARS
char * resolve_pointer_to_string_copy(int *str_len=NULp) const FINAL_OVERRIDE
void AWT_install_cb_guards()
char * seq_2_helix(char *sequence, char undefsymbol= ' ') const
GB_transaction ta(gb_var)
ED4_returncode create_hierarchy(const char *area_string_middle, const char *area_string_top)
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
ARB_ERROR init_alignment()
#define ED4_AWAR_REP_SEARCH_PATTERN
void create_sina_variables(AW_root *root, AW_default db1)
ED4_manager * get_parent(ED4_level lev) const
GB_ERROR init(GBDATA *gb_main)
#define AWAR_EDIT_CONFIGURATION
#define PFOLD_AWAR_SELECTED_SAI
Selected reference protein secondary structure SAI (i.e. the SAI that is used for structure compariso...
int is_species_name_terminal() const
void GB_close(GBDATA *gbd)
Adds support for protein structure prediction, comparison of two protein secondary structures and of ...
GB_write_int const char s