ARB
Classes | Macros | Typedefs | Enumerations | Functions | Variables
PARS_main.cxx File Reference
#include "PerfMeter.h"
#include "pars_main.hxx"
#include "pars_klprops.hxx"
#include "pars_awars.h"
#include "ap_tree_nlen.hxx"
#include "ap_main.hxx"
#include <ColumnStat.hxx>
#include <gui_aliview.hxx>
#include <macros.hxx>
#include <nds.h>
#include <TreeCallbacks.hxx>
#include <aw_awars.hxx>
#include <aw_preset.hxx>
#include <aw_msg.hxx>
#include <aw_root.hxx>
#include <aw_question.hxx>
#include <awt.hxx>
#include <awt_sel_boxes.hxx>
#include <awt_filter.hxx>
#include <awt_config_manager.hxx>
#include <arb_progress.h>
#include <arb_misc.h>
#include <arb_defs.h>
#include <arb_global_defs.h>
#include <ad_cb.h>
#include <list>
#include <map>
Include dependency graph for PARS_main.cxx:

Go to the source code of this file.

Classes

class  InsertData
 
class  AP_subtree
 
struct  EdgeBetween
 
struct  BestEdge
 
struct  NodeInsertOrder
 
class  PartialSequence
 
class  LowDataCheck
 

Macros

#define AWAR_COLUMNSTAT_BASE   "tmp/pars/colstat"
 
#define AWAR_COLUMNSTAT_NAME   AWAR_COLUMNSTAT_BASE "/name"
 
#define AWT_TREE_PARS(ntw)   DOWNCAST(AWT_graphic_parsimony*, (ntw)->gfx)
 
#define _STRGIZE(x)   #x
 
#define INT2STR(i)   _STRGIZE(i)
 

Typedefs

typedef vector< AP_tree_nlen * > InsertedSpecies
 
typedef
InsertedSpecies::const_iterator 
InsertSpeciesIterator
 

Enumerations

enum  AddWhat { NT_ADD_MARKED, NT_ADD_SELECTED }
 

Functions

AWT_graphic_parsimonyglobal_tree ()
 
AP_pars_root * global_tree_root ()
 
static void set_keep_ghostnodes ()
 
static void delete_kept_ghostnodes ()
 
static __ATTR__NORETURN void pars_exit (AW_window *aww)
 
static void AP_user_push_cb (AW_window *aww)
 
static void AP_user_pop_cb (AW_window *aww, TREE_canvas *ntw)
 
static int sort_sequences_by_length (const char *, long leaf0_ptr, const char *, long leaf1_ptr)
 
static long transform_gbd_to_leaf (const char *key, long val, void *)
 
static long toInserted (const char *, long val, void *cd_toInsert)
 
int maxAllowedInsertions (int inTree)
 
int calcInsertNow (int toInsert, int inTree)
 
static long calc_steps (int toInsert, int inTree)
 
static void insert_species_into_tree (const InsertSpeciesIterator begin, const InsertSpeciesIterator end, arb_progress &progress)
 
static void insert_all_species_into_tree (GB_HASH *&hash)
 
static void nt_add (AWT_graphic_parsimony *agt, AddWhat what, bool quick)
 
static GB_ERROR nt_best_partial_match_rec (list< PartialSequence > &partial, const AP_tree_nlen *tree)
 
static void count_partial_and_full (const AP_tree_nlen *at, int *partial, int *full, int *zombies, int default_value, bool define_if_undef)
 
static const AP_tree_nlen * find_least_deep_leaf (const AP_tree_nlen *at, int depth, int *min_depth)
 
AP_tree_nlen * find_least_deep_leaf (AP_tree_nlen *at, int depth, int *min_depth)
 
static void push_partial (const char *, long val, void *cd_partial)
 
static void nt_add_partial (AWT_graphic_parsimony *agt)
 
static void NT_add_partial_and_update (UNFIXED, TREE_canvas *ntw)
 
static void nt_add_and_update (AWT_canvas *ntw, AddWhat what, bool quick)
 
static void NT_add_and_NNI (UNFIXED, TREE_canvas *ntw, AddWhat what)
 
static void NT_add_quick (UNFIXED, TREE_canvas *ntw, AddWhat what)
 
static void nt_reAdd (AWT_graphic_parsimony *agt, AddWhat what, bool quick)
 
static void nt_reAdd_and_update (AWT_canvas *ntw, AddWhat what, bool quick)
 
static void NT_reAdd_and_NNI (UNFIXED, TREE_canvas *ntw, AddWhat what)
 
static void NT_reAdd_quick (UNFIXED, TREE_canvas *ntw, AddWhat what)
 
static void calc_branchlengths_and_reorder (AWT_graphic_parsimony *agt)
 
static void NT_calc_branchlengths_reorder_and_update (AW_window *, TREE_canvas *ntw)
 
static void NT_bootstrap (AW_window *, TREE_canvas *ntw, bool limit_only)
 
static void optimizeTree (AWT_graphic_parsimony *agt, const KL_Settings &settings)
 
static void NT_optimize (AW_window *, TREE_canvas *ntw)
 
static void recursiveNNI (AWT_graphic_parsimony *agt, EdgeSpec whichEdges)
 
static void NT_recursiveNNI (AW_window *, TREE_canvas *ntw)
 
static int calculate_default_random_repeat (long leafs)
 
static void update_random_repeat (AW_root *awr, AWT_graphic_parsimony *agt)
 
static void mixtree_and_calclengths (AWT_graphic_parsimony *agt, int repeat, int percent, EdgeSpec whichEdges)
 
static void randomMixTree (AW_window *aww, TREE_canvas *ntw)
 
static AW_windowcreateOptimizeWindow (AW_root *aw_root, TREE_canvas *ntw)
 
static GB_ERROR pars_check_size (AW_root *awr, GB_ERROR &warning, const adfiltercbstruct *filterDef)
 
static void pars_reset_optimal_parsimony (AW_window *aww)
 
static void PARS_infomode_cb (UNFIXED, TREE_canvas *canvas, AWT_COMMAND_MODE mode)
 
static void pars_start_cb (AW_window *aw_parent, WeightedFilter *wfilt, const PARS_commands *cmds)
 
static AW_windowcreate_pars_init_window (AW_root *awr, const PARS_commands *cmds)
 
static void create_optimize_vars (AW_root *aw_root, AW_default props)
 
static void pars_create_all_awars (AW_root *awr, AW_default aw_def, GBDATA *gb_main)
 
void PARS_map_viewer (GBDATA *gb_species, AD_MAP_VIEWER_TYPE vtype)
 
int ARB_main (int argc, char *argv[])
 

Variables

static ArbParsimonyGLOBAL_PARS = NULp
 
AP_mainap_main
 
static AWT_config_mapping_def optimizer_config_mapping []
 
static AWT_predefined_config optimizer_predefined_configs []
 
static AW_rootAD_map_viewer_aw_root = NULp
 

Macro Definition Documentation

#define AWAR_COLUMNSTAT_BASE   "tmp/pars/colstat"

Definition at line 53 of file PARS_main.cxx.

#define AWAR_COLUMNSTAT_NAME   AWAR_COLUMNSTAT_BASE "/name"

Definition at line 54 of file PARS_main.cxx.

Referenced by create_pars_init_window().

#define AWT_TREE_PARS (   ntw)    DOWNCAST(AWT_graphic_parsimony*, (ntw)->gfx)
#define _STRGIZE (   x)    #x
#define INT2STR (   i)    _STRGIZE(i)

Referenced by pars_start_cb().

Typedef Documentation

typedef vector<AP_tree_nlen*> InsertedSpecies

Definition at line 215 of file PARS_main.cxx.

typedef InsertedSpecies::const_iterator InsertSpeciesIterator

Definition at line 291 of file PARS_main.cxx.

Enumeration Type Documentation

enum AddWhat
Enumerator
NT_ADD_MARKED 
NT_ADD_SELECTED 

Definition at line 617 of file PARS_main.cxx.

Function Documentation

AWT_graphic_parsimony* global_tree ( )
inline

Definition at line 60 of file PARS_main.cxx.

References ArbParsimony::get_tree().

Referenced by delete_kept_ghostnodes(), global_tree_root(), and pars_start_cb().

AP_pars_root* global_tree_root ( )
inline

Definition at line 61 of file PARS_main.cxx.

References AWT_graphic_parsimony::get_tree_root(), and global_tree().

Referenced by pars_start_cb().

static void set_keep_ghostnodes ( )
static
static void delete_kept_ghostnodes ( )
static
static __ATTR__NORETURN void pars_exit ( AW_window aww)
static
static void AP_user_push_cb ( AW_window aww)
static
static void AP_user_pop_cb ( AW_window aww,
TREE_canvas ntw 
)
static
static int sort_sequences_by_length ( const char ,
long  leaf0_ptr,
const char ,
long  leaf1_ptr 
)
static

Definition at line 164 of file PARS_main.cxx.

References ap_assert, and cmp.

Referenced by insert_all_species_into_tree().

static long transform_gbd_to_leaf ( const char key,
long  val,
void *   
)
static
static long toInserted ( const char ,
long  val,
void *  cd_toInsert 
)
static

Definition at line 217 of file PARS_main.cxx.

Referenced by insert_all_species_into_tree().

int maxAllowedInsertions ( int  inTree)
inline

Definition at line 225 of file PARS_main.cxx.

Referenced by calcInsertNow(), and insert_all_species_into_tree().

int calcInsertNow ( int  toInsert,
int  inTree 
)
inline

Definition at line 229 of file PARS_main.cxx.

References maxAllowedInsertions(), and min.

Referenced by calc_steps(), and insert_all_species_into_tree().

static long calc_steps ( int  toInsert,
int  inTree 
)
static

Definition at line 234 of file PARS_main.cxx.

References ap_assert, calcInsertNow(), leafs_2_edges(), and UNROOTED.

Referenced by insert_all_species_into_tree().

static void insert_species_into_tree ( const InsertSpeciesIterator  begin,
const InsertSpeciesIterator  end,
arb_progress progress 
)
static
static void insert_all_species_into_tree ( GB_HASH *&  hash)
static
static void nt_add ( AWT_graphic_parsimony agt,
AddWhat  what,
bool  quick 
)
static
static GB_ERROR nt_best_partial_match_rec ( list< PartialSequence > &  partial,
const AP_tree_nlen *  tree 
)
static

Definition at line 863 of file PARS_main.cxx.

References error(), GB_await_error(), GBT_is_partial(), and NULp.

Referenced by nt_add_partial().

static void count_partial_and_full ( const AP_tree_nlen *  at,
int partial,
int full,
int zombies,
int  default_value,
bool  define_if_undef 
)
static

Definition at line 890 of file PARS_main.cxx.

References GBT_is_partial().

Referenced by nt_add_partial().

static const AP_tree_nlen* find_least_deep_leaf ( const AP_tree_nlen *  at,
int  depth,
int min_depth 
)
static

Definition at line 907 of file PARS_main.cxx.

References NULp.

Referenced by find_least_deep_leaf(), and nt_add_partial().

AP_tree_nlen* find_least_deep_leaf ( AP_tree_nlen *  at,
int  depth,
int min_depth 
)
inline

Definition at line 925 of file PARS_main.cxx.

References find_least_deep_leaf().

static void push_partial ( const char ,
long  val,
void *  cd_partial 
)
static

Definition at line 929 of file PARS_main.cxx.

Referenced by nt_add_partial().

static void nt_add_partial ( AWT_graphic_parsimony agt)
static
static void NT_add_partial_and_update ( UNFIXED  ,
TREE_canvas ntw 
)
static

Definition at line 1135 of file PARS_main.cxx.

References AWT_TREE_PARS, and nt_add_partial().

Referenced by pars_start_cb().

static void nt_add_and_update ( AWT_canvas ntw,
AddWhat  what,
bool  quick 
)
static

Definition at line 1143 of file PARS_main.cxx.

References AWT_TREE_PARS, and nt_add().

Referenced by NT_add_and_NNI(), and NT_add_quick().

static void NT_add_and_NNI ( UNFIXED  ,
TREE_canvas ntw,
AddWhat  what 
)
static

Definition at line 1148 of file PARS_main.cxx.

References nt_add_and_update().

Referenced by pars_start_cb().

static void NT_add_quick ( UNFIXED  ,
TREE_canvas ntw,
AddWhat  what 
)
static

Definition at line 1149 of file PARS_main.cxx.

References nt_add_and_update().

Referenced by pars_start_cb().

static void nt_reAdd ( AWT_graphic_parsimony agt,
AddWhat  what,
bool  quick 
)
static
static void nt_reAdd_and_update ( AWT_canvas ntw,
AddWhat  what,
bool  quick 
)
static

Definition at line 1162 of file PARS_main.cxx.

References AWT_TREE_PARS, and nt_reAdd().

Referenced by NT_reAdd_and_NNI(), and NT_reAdd_quick().

static void NT_reAdd_and_NNI ( UNFIXED  ,
TREE_canvas ntw,
AddWhat  what 
)
static

Definition at line 1167 of file PARS_main.cxx.

References nt_reAdd_and_update().

Referenced by pars_start_cb().

static void NT_reAdd_quick ( UNFIXED  ,
TREE_canvas ntw,
AddWhat  what 
)
static

Definition at line 1168 of file PARS_main.cxx.

References nt_reAdd_and_update().

Referenced by pars_start_cb().

static void calc_branchlengths_and_reorder ( AWT_graphic_parsimony agt)
static
static void NT_calc_branchlengths_reorder_and_update ( AW_window ,
TREE_canvas ntw 
)
static

Definition at line 1178 of file PARS_main.cxx.

References AWT_TREE_PARS, and calc_branchlengths_and_reorder().

Referenced by pars_start_cb().

static void NT_bootstrap ( AW_window ,
TREE_canvas ntw,
bool  limit_only 
)
static
static void optimizeTree ( AWT_graphic_parsimony agt,
const KL_Settings settings 
)
static
static void NT_optimize ( AW_window ,
TREE_canvas ntw 
)
static

Definition at line 1200 of file PARS_main.cxx.

References AWT_canvas::awr, AWT_TREE_PARS, and optimizeTree().

Referenced by createOptimizeWindow().

static void recursiveNNI ( AWT_graphic_parsimony agt,
EdgeSpec  whichEdges 
)
static
static void NT_recursiveNNI ( AW_window ,
TREE_canvas ntw 
)
static

Definition at line 1224 of file PARS_main.cxx.

References AWT_canvas::awr, AWT_TREE_PARS, recursiveNNI(), and KL_Settings::whichEdges.

Referenced by createOptimizeWindow().

static int calculate_default_random_repeat ( long  leafs)
static

Definition at line 1230 of file PARS_main.cxx.

Referenced by update_random_repeat().

static void update_random_repeat ( AW_root awr,
AWT_graphic_parsimony agt 
)
static
static void mixtree_and_calclengths ( AWT_graphic_parsimony agt,
int  repeat,
int  percent,
EdgeSpec  whichEdges 
)
static
static void randomMixTree ( AW_window aww,
TREE_canvas ntw 
)
static
static AW_window* createOptimizeWindow ( AW_root aw_root,
TREE_canvas ntw 
)
static
static GB_ERROR pars_check_size ( AW_root awr,
GB_ERROR warning,
const adfiltercbstruct filterDef 
)
static
static void pars_reset_optimal_parsimony ( AW_window aww)
static
static void PARS_infomode_cb ( UNFIXED  ,
TREE_canvas canvas,
AWT_COMMAND_MODE  mode 
)
static

Definition at line 1506 of file PARS_main.cxx.

References AWT_trigger_remote_action(), AWT_canvas::gb_main, nt_mode_event(), and NULp.

Referenced by pars_start_cb().

static void pars_start_cb ( AW_window aw_parent,
WeightedFilter wfilt,
const PARS_commands cmds 
)
static

Definition at line 1511 of file PARS_main.cxx.

References PARS_commands::add_marked, PARS_commands::add_selected, AP_JUMP_BY_BUTTON, AP_LIST_SIMPLE, AP_TREE_NORMAL, AP_TREE_RADIAL, AP_user_pop_cb(), AP_user_push_cb(), AW_window::at(), AW_window::at_newline(), AW_window::at_x(), AW_window::auto_space(), aw_ask_sure(), AW_AT_MAXSIZE, AW_create_gc_window(), AW_insert_common_property_menu_entries(), aw_message(), aw_popup_exit(), AW_preset_window(), AW_save_properties(), AW_root::awar(), AWAR_BEST_PARSIMONY, AWAR_FOOTER, AWAR_FOOTER_MAX_LEN, AWAR_PARSIMONY, AWAR_STACKPOINTER, AWAR_TREE, AWM_ALL, AWT_create_nds_window(), AWT_KEEP_MARKED, AWT_MODE_EMPTY, AWT_MODE_GROUP, AWT_MODE_INFO, AWT_MODE_KERNINGHAN, AWT_MODE_LZOOM, AWT_MODE_MARK, AWT_MODE_MOVE, AWT_MODE_NNI, AWT_MODE_OPTIMIZE, AWT_MODE_SELECT, AWT_MODE_SETROOT, AWT_MODE_SWAP, AWT_MODE_ZOOM, AWT_popup_print_window(), AWT_popup_tree_export_window(), AWT_REMOVE_MARKED, AWT_REMOVE_NO_SEQUENCE, AWT_REMOVE_ZOMBIES, AWT_TREE_PARS, BIG_BRANCHES_TO_TOP, AW_window::button_length(), PARS_commands::calc_bootstrap, PARS_commands::calc_branch_lengths, AW_window::callback(), AW_window::close_sub_menu(), LowDataCheck::count(), AW_window::create_button(), create_kernighan_properties_window(), AW_window::create_menu(), AW_window::create_mode(), createOptimizeWindow(), error(), GB_begin_transaction(), GB_commit_transaction(), GB_end_transaction(), gb_main, AWT_canvas::gb_main, GBS_global_string(), GBS_global_string_copy(), AWT_canvas::gc_manager, ArbParsimony::generate_tree(), WeightedFilter::get_adfiltercbstruct(), AW_window::get_at_position(), AW_window::get_at_yposition(), AP_main::get_gb_main(), LowDataCheck::get_inner(), LowDataCheck::get_leafs(), AW_window::get_root(), AWT_graphic_tree::get_tree_style(), AW_window::get_window_id(), global_tree(), global_tree_root(), AW_window::help_text(), AW_window::hide(), AW_window_menu_modes::init(), AP_tree_edge::initialize(), AW_window::insert_help_topic(), insert_macro_menu_entry(), AW_window::insert_menu_topic(), AW_window::insert_sub_menu(), INT2STR, AW_window::label(), AW_window::label_length(), AW_at_storage::make(), makeHelpCallback(), MIN_SEQUENCE_LENGTH, NT_add_and_NNI(), NT_ADD_MARKED, NT_add_partial_and_update(), NT_add_quick(), NT_ADD_SELECTED, NT_bootstrap(), NT_calc_branchlengths_reorder_and_update(), NT_insert_collapse_submenu(), NT_insert_mark_submenus(), NT_jump_cb(), nt_mode_event(), NT_reAdd_and_NNI(), NT_reAdd_quick(), NT_reload_tree_event(), NT_remove_bootstrap(), NT_remove_leafs(), NT_reset_lzoom_cb(), NT_reset_pzoom_cb(), NT_resort_tree_cb(), NT_set_tree_style(), NULp, pars_check_size(), pars_exit(), PARS_infomode_cb(), pars_reset_optimal_parsimony(), PARS_tree_init(), PARS_commands::quit, AW_window::restore_at_from(), rootNode(), AW_window::sep______________(), AW_window::set_bottom_area_height(), AW_window::set_info_area_height(), set_keep_ghostnodes(), AWT_graphic_tree::set_tree_style(), AW_window::shadow_width(), AW_window::show(), arb_progress::subtitle(), ta, TREE_create_settings_window(), TREE_install_update_callbacks(), update_random_repeat(), and warning().

Referenced by create_pars_init_window().

static AW_window* create_pars_init_window ( AW_root awr,
const PARS_commands cmds 
)
static
static void create_optimize_vars ( AW_root aw_root,
AW_default  props 
)
static
static void pars_create_all_awars ( AW_root awr,
AW_default  aw_def,
GBDATA gb_main 
)
static
void PARS_map_viewer ( GBDATA gb_species,
AD_MAP_VIEWER_TYPE  vtype 
)
int ARB_main ( int  argc,
char argv[] 
)

Variable Documentation

ArbParsimony* GLOBAL_PARS = NULp
static

Definition at line 58 of file PARS_main.cxx.

AP_main* ap_main
AWT_config_mapping_def optimizer_config_mapping[]
static
Initial value:
= {
{ AWAR_OPTI_MARKED_ONLY, "marked_only" },
{ AWAR_OPTI_SKIP_FOLDED, "skip_folded" },
{ AWAR_RAND_PERCENT, "rand_percent" },
{ AWAR_KL_MAXDEPTH, "maxdepth" },
{ AWAR_KL_INCDEPTH, "incdepth" },
{ AWAR_KL_STATIC_ENABLED, "static" },
{ AWAR_KL_STATIC_DEPTH1, "s_depth1" },
{ AWAR_KL_STATIC_DEPTH2, "s_depth2" },
{ AWAR_KL_STATIC_DEPTH3, "s_depth3" },
{ AWAR_KL_STATIC_DEPTH4, "s_depth4" },
{ AWAR_KL_STATIC_DEPTH5, "s_depth5" },
{ AWAR_KL_DYNAMIC_ENABLED, "dynamic" },
{ AWAR_KL_DYNAMIC_START, "start" },
{ AWAR_KL_DYNAMIC_MAXX, "maxx" },
{ AWAR_KL_DYNAMIC_MAXY, "maxy" },
{ NULp, NULp }
}
#define AWAR_KL_DYNAMIC_MAXY
Definition: pars_awars.h:43
#define AWAR_KL_DYNAMIC_MAXX
Definition: pars_awars.h:42
#define AWAR_KL_STATIC_DEPTH4
Definition: pars_awars.h:37
#define AWAR_KL_INCDEPTH
Definition: pars_awars.h:31
#define AWAR_KL_STATIC_DEPTH1
Definition: pars_awars.h:34
#define AWAR_KL_DYNAMIC_START
Definition: pars_awars.h:41
#define AWAR_OPTI_SKIP_FOLDED
Definition: pars_awars.h:25
#define AWAR_KL_STATIC_DEPTH2
Definition: pars_awars.h:35
#define AWAR_RAND_PERCENT
Definition: pars_awars.h:28
#define AWAR_OPTI_MARKED_ONLY
Definition: pars_awars.h:24
#define AWAR_KL_STATIC_DEPTH5
Definition: pars_awars.h:38
#define NULp
Definition: cxxforward.h:97
#define AWAR_KL_MAXDEPTH
Definition: pars_awars.h:30
#define AWAR_KL_DYNAMIC_ENABLED
Definition: pars_awars.h:40
#define AWAR_KL_STATIC_ENABLED
Definition: pars_awars.h:33
#define AWAR_KL_STATIC_DEPTH3
Definition: pars_awars.h:36

Definition at line 1271 of file PARS_main.cxx.

AWT_predefined_config optimizer_predefined_configs[]
static
Initial value:
= {
{
"*minimum_static_reduction",
"Sets paths allowed by static reduction to maximum\n(causing the minimal reduction)",
"s_depth1='8';s_depth2='6';s_depth3='6';s_depth4='6';s_depth5='6';static='1'"
},
{
"*whole_tree_level8",
"Level-8-optimization of whole tree\n(no path reduction)",
"dynamic='0';incdepth='0';marked_only='0';maxdepth='8';skip_folded='0';static='0'"
},
{ NULp, NULp, NULp }
}
#define NULp
Definition: cxxforward.h:97

Definition at line 1296 of file PARS_main.cxx.

AW_root* AD_map_viewer_aw_root = NULp
static

Definition at line 1978 of file PARS_main.cxx.