ARB
Classes | Macros | Typedefs | Functions | Variables
DI_matr.cxx File Reference
#include "di_protdist.hxx"
#include "di_clusters.hxx"
#include "di_view_matrix.hxx"
#include "di_awars.hxx"
#include <neighbourjoin.hxx>
#include <AP_filter.hxx>
#include <CT_ctree.hxx>
#include <ColumnStat.hxx>
#include <awt.hxx>
#include <awt_sel_boxes.hxx>
#include <awt_filter.hxx>
#include <aw_preset.hxx>
#include <aw_awars.hxx>
#include <aw_file.hxx>
#include <aw_msg.hxx>
#include <aw_root.hxx>
#include <gui_aliview.hxx>
#include <climits>
#include <ctime>
#include <cmath>
#include <arb_sort.h>
#include <arb_global_defs.h>
#include <macros.hxx>
#include <ad_cb.h>
#include <awt_TreeAwars.hxx>
#include <arb_defs.h>
Include dependency graph for DI_matr.cxx:

Go to the source code of this file.

Classes

class  BoundWindowCallback
 
struct  RecalcNeeded
 
struct  TreeOrderedSpecies
 

Macros

#define AWAR_DIST_BOOTSTRAP_COUNT   AWAR_DIST_PREFIX "bootstrap/count"
 
#define AWAR_DIST_CANCEL_CHARS   AWAR_DIST_PREFIX "cancel/chars"
 
#define AWAR_DIST_MATRIX_AUTO_RECALC   AWAR_DIST_PREFIX "recalc"
 
#define AWAR_DIST_COLUMN_STAT_NAME   AWAR_DIST_COLUMN_STAT_PREFIX "name"
 
#define AWAR_DIST_TREE_SORT_NAME   "tmp/" AWAR_DIST_TREE_PREFIX "sort_tree_name"
 
#define AWAR_DIST_TREE_COMP_NAME   "tmp/" AWAR_DIST_TREE_PREFIX "compr_tree_name"
 
#define AWAR_DIST_TREE_STD_NAME   AWAR_DIST_TREE_PREFIX "tree_name"
 
#define AWAR_DIST_MATRIX_AUTO_CALC_TREE   AWAR_DIST_TREE_PREFIX "autocalc"
 
#define AWAR_DIST_SAVE_MATRIX_TYPE   AWAR_DIST_SAVE_MATRIX_BASE "/type"
 
#define AWAR_DIST_SAVE_MATRIX_FILENAME   AWAR_DIST_SAVE_MATRIX_BASE "/file_name"
 

Typedefs

typedef std::map< const char
*, TreeNode *, charpLess
NamedNodes
 

Functions

static AP_matrixget_user_matrix ()
 
static void matrix_changed_cb ()
 
static unsigned update_cb (AW_root *aw_root)
 
void add_update_cb ()
 
void matrix_needs_recalc_cb ()
 
void tree_needs_recalc_cb ()
 
void compressed_matrix_needs_recalc_cb ()
 
static void auto_calc_changed_cb (AW_root *aw_root)
 
static AW_windowcreate_dna_matrix_window (AW_root *aw_root)
 
static void selected_tree_changed_cb ()
 
void DI_create_matrix_variables (AW_root *aw_root, AW_default def, AW_default db)
 
static int TreeOrderedSpecies_cmp (const void *p1, const void *p2, void *)
 
GB_ERROR link_to_tree (NamedNodes &named, TreeNode *node)
 
static TreeNodefindNode (TreeNode *node, const char *name)
 
static GB_ERROR init (NamedNodes &node, TreeNode *tree, const DI_ENTRY *const *const entries, size_t nentries)
 
static __ATTR__USERESULT GB_ERROR di_calculate_matrix (AW_root *aw_root, const WeightedFilter *weighted_filter, bool bootstrap_flag, bool show_warnings, bool *aborted_flag)
 
static void di_mark_by_distance (AW_window *aww, WeightedFilter *weighted_filter)
 
static GB_ERROR di_recalc_matrix ()
 
static void di_view_matrix_cb (AW_window *aww, save_matrix_params *sparam)
 
static void di_save_matrix_cb (AW_window *aww)
 
AW_windowDI_create_save_matrix_window (AW_root *aw_root, save_matrix_params *save_params)
 
static AW_windowawt_create_select_cancel_window (AW_root *aw_root)
 
 STATIC_ASSERT (ARRAY_ELEMS(enum_trans_to_string)==DI_TRANSFORMATION_COUNT)
 
static void di_calculate_tree_cb (AW_window *aww, WeightedFilter *weighted_filter, bool bootstrap_flag)
 
static void di_autodetect_callback (AW_window *aww, GBDATA *gb_main)
 
static __ATTR__NORETURN void di_exit (AW_window *aww, GBDATA *gb_main)
 
static void di_calculate_full_matrix_cb (AW_window *aww, const WeightedFilter *weighted_filter)
 
static void di_calculate_compressed_matrix_cb (AW_window *aww, WeightedFilter *weighted_filter)
 
static void di_define_sort_tree_name_cb (AW_window *aww)
 
static void di_define_compression_tree_name_cb (AW_window *aww)
 
static void di_define_save_tree_name_cb (AW_window *aww)
 
AW_windowDI_create_matrix_window (AW_root *aw_root, GBDATA *gb_main)
 

Variables

DI_GLOBAL_MATRIX GLOBAL_MATRIX
 
static MatrixDisplaymatrixDisplay = NULp
 
static AP_userdef_matrix userdef_DNA_matrix (AP_MAX, AWAR_DIST_MATRIX_DNA_BASE)
 
static SmartPtr
< BoundWindowCallback
recalculate_matrix_cb
 
static SmartPtr
< BoundWindowCallback
recalculate_tree_cb
 
static GB_ERROR last_matrix_calculation_error = NULp
 
static RecalcNeeded need_recalc
 
CONSTEXPR unsigned UPDATE_DELAY = 200
 
static const charenum_trans_to_string []
 

Macro Definition Documentation

#define AWAR_DIST_BOOTSTRAP_COUNT   AWAR_DIST_PREFIX "bootstrap/count"
#define AWAR_DIST_CANCEL_CHARS   AWAR_DIST_PREFIX "cancel/chars"
#define AWAR_DIST_MATRIX_AUTO_RECALC   AWAR_DIST_PREFIX "recalc"
#define AWAR_DIST_COLUMN_STAT_NAME   AWAR_DIST_COLUMN_STAT_PREFIX "name"

Definition at line 51 of file DI_matr.cxx.

Referenced by DI_create_matrix_window().

#define AWAR_DIST_TREE_SORT_NAME   "tmp/" AWAR_DIST_TREE_PREFIX "sort_tree_name"
#define AWAR_DIST_TREE_COMP_NAME   "tmp/" AWAR_DIST_TREE_PREFIX "compr_tree_name"
#define AWAR_DIST_TREE_STD_NAME   AWAR_DIST_TREE_PREFIX "tree_name"
#define AWAR_DIST_MATRIX_AUTO_CALC_TREE   AWAR_DIST_TREE_PREFIX "autocalc"
#define AWAR_DIST_SAVE_MATRIX_TYPE   AWAR_DIST_SAVE_MATRIX_BASE "/type"
#define AWAR_DIST_SAVE_MATRIX_FILENAME   AWAR_DIST_SAVE_MATRIX_BASE "/file_name"

Definition at line 59 of file DI_matr.cxx.

Referenced by di_save_matrix_cb().

Typedef Documentation

typedef std::map<const char*, TreeNode*, charpLess> NamedNodes

Definition at line 763 of file DI_matr.cxx.

Function Documentation

static AP_matrix* get_user_matrix ( )
static
static void matrix_changed_cb ( )
static
static unsigned update_cb ( AW_root aw_root)
static
void add_update_cb ( )
inline
void matrix_needs_recalc_cb ( )
inline
void tree_needs_recalc_cb ( )
inline
void compressed_matrix_needs_recalc_cb ( )
inline
static void auto_calc_changed_cb ( AW_root aw_root)
static
static AW_window* create_dna_matrix_window ( AW_root aw_root)
static
static void selected_tree_changed_cb ( )
static
void DI_create_matrix_variables ( AW_root aw_root,
AW_default  def,
AW_default  db 
)
static int TreeOrderedSpecies_cmp ( const void *  p1,
const void *  p2,
void *   
)
static

Definition at line 379 of file DI_matr.cxx.

References TreeOrderedSpecies::order_index.

Referenced by MatrixOrder::applyTo().

GB_ERROR link_to_tree ( NamedNodes named,
TreeNode node 
)

Definition at line 765 of file DI_matr.cxx.

References error(), GBS_global_string(), TreeNode::is_leaf(), TreeNode::name, and NULp.

Referenced by init().

static TreeNode* findNode ( TreeNode node,
const char name 
)
static

Definition at line 787 of file DI_matr.cxx.

References TreeNode::is_leaf(), TreeNode::name, and NULp.

Referenced by init().

static GB_ERROR init ( NamedNodes node,
TreeNode tree,
const DI_ENTRY *const *const  entries,
size_t  nentries 
)
static
static __ATTR__USERESULT GB_ERROR di_calculate_matrix ( AW_root aw_root,
const WeightedFilter weighted_filter,
bool  bootstrap_flag,
bool  show_warnings,
bool *  aborted_flag 
)
static
static void di_mark_by_distance ( AW_window aww,
WeightedFilter weighted_filter 
)
static
static GB_ERROR di_recalc_matrix ( )
static
static void di_view_matrix_cb ( AW_window aww,
save_matrix_params sparam 
)
static
static void di_save_matrix_cb ( AW_window aww)
static
AW_window* DI_create_save_matrix_window ( AW_root aw_root,
save_matrix_params save_params 
)
static AW_window* awt_create_select_cancel_window ( AW_root aw_root)
static

Definition at line 1142 of file DI_matr.cxx.

References AW_POPDOWN(), AWAR_DIST_CANCEL_CHARS, and AW_window::load_xfig().

Referenced by DI_create_matrix_window().

static void di_calculate_tree_cb ( AW_window aww,
WeightedFilter weighted_filter,
bool  bootstrap_flag 
)
static
static void di_autodetect_callback ( AW_window aww,
GBDATA gb_main 
)
static
static __ATTR__NORETURN void di_exit ( AW_window aww,
GBDATA gb_main 
)
static
static void di_calculate_full_matrix_cb ( AW_window aww,
const WeightedFilter weighted_filter 
)
static
static void di_calculate_compressed_matrix_cb ( AW_window aww,
WeightedFilter weighted_filter 
)
static
static void di_define_sort_tree_name_cb ( AW_window aww)
static
static void di_define_compression_tree_name_cb ( AW_window aww)
static
static void di_define_save_tree_name_cb ( AW_window aww)
static
AW_window* DI_create_matrix_window ( AW_root aw_root,
GBDATA gb_main 
)

Definition at line 1531 of file DI_matr.cxx.

References ARB_in_expert_mode(), AW_window::at(), AW_insert_common_property_menu_entries(), AW_preset_window(), AW_save_properties(), AW_root::awar(), save_matrix_params::awar_base, AWAR_DIST_ALIGNMENT, AWAR_DIST_BOOTSTRAP_COUNT, AWAR_DIST_CANCEL_CHARS, AWAR_DIST_COLUMN_STAT_NAME, AWAR_DIST_CORR_TRANS, AWAR_DIST_FILTER_NAME, AWAR_DIST_MATRIX_AUTO_CALC_TREE, AWAR_DIST_MATRIX_AUTO_RECALC, AWAR_DIST_MATRIX_DNA_ENABLED, AWAR_DIST_MAX_DIST, AWAR_DIST_MIN_DIST, AWAR_DIST_SAVE_MATRIX_BASE, AWAR_DIST_TREE_COMP_NAME, AWAR_DIST_TREE_CURR_NAME, AWAR_DIST_TREE_SORT_NAME, AWAR_DIST_TREE_STD_NAME, AWAR_DIST_WHICH_SPECIES, AW_root::awar_string(), AWM_ALL, AWM_EXP, awt_create_ALI_selection_list(), awt_create_select_cancel_window(), awt_create_select_filter_win(), awt_create_TREE_selection_list(), AW_window::button_length(), AW_window::callback(), COLSTAT_create_selection_window(), AW_window::create_autosize_button(), AW_window::create_button(), create_dna_matrix_window(), AW_window::create_input_field(), AW_window::create_menu(), AW_window::create_option_menu(), AW_window::create_toggle(), di_autodetect_callback(), di_calculate_compressed_matrix_cb(), di_calculate_full_matrix_cb(), di_calculate_tree_cb(), DI_create_cluster_detection_window(), DI_create_save_matrix_window(), di_define_compression_tree_name_cb(), di_define_save_tree_name_cb(), di_define_sort_tree_name_cb(), di_exit(), di_mark_by_distance(), DI_TRANSFORMATION_CATEGORIES_BARKER, DI_TRANSFORMATION_CATEGORIES_CHEMICAL, DI_TRANSFORMATION_CATEGORIES_HALL, DI_TRANSFORMATION_FELSENSTEIN, DI_TRANSFORMATION_FELSENSTEIN_VOIGT, DI_TRANSFORMATION_FROM_TREE, DI_TRANSFORMATION_JUKES_CANTOR, DI_TRANSFORMATION_KIMURA, DI_TRANSFORMATION_NONE, DI_TRANSFORMATION_OLSEN, DI_TRANSFORMATION_OLSEN_VOIGT, DI_TRANSFORMATION_PAM, DI_TRANSFORMATION_SIMILARITY, di_view_matrix_cb(), GB_pop_transaction(), GB_push_transaction(), WeightedFilter::get_adfiltercbstruct(), WeightedFilter::get_column_stat(), AW_window::get_root(), AW_window_simple_menu::init(), AW_window::insert_default_option(), AW_window::insert_help_topic(), insert_macro_menu_entry(), AW_window::insert_menu_topic(), AW_window::insert_option(), AW_window::label(), AW_window::load_xfig(), makeHelpCallback(), AW_window::sens_mask(), AW_window::sep______________(), AW_window::update_option_menu(), save_matrix_params::weighted_filter, and AW_awar::write_int().

Referenced by ARB_main().

Variable Documentation

DI_GLOBAL_MATRIX GLOBAL_MATRIX

Definition at line 63 of file DI_matr.cxx.

Referenced by MatrixDisplay::get_matrix().

MatrixDisplay* matrixDisplay = NULp
static

Definition at line 65 of file DI_matr.cxx.

Referenced by di_view_matrix_cb().

AP_userdef_matrix userdef_DNA_matrix(AP_MAX, AWAR_DIST_MATRIX_DNA_BASE)
static
SmartPtr<BoundWindowCallback> recalculate_matrix_cb
static

Definition at line 89 of file DI_matr.cxx.

SmartPtr<BoundWindowCallback> recalculate_tree_cb
static

Definition at line 90 of file DI_matr.cxx.

GB_ERROR last_matrix_calculation_error = NULp
static
RecalcNeeded need_recalc
static

Definition at line 108 of file DI_matr.cxx.

CONSTEXPR unsigned UPDATE_DELAY = 200

Definition at line 110 of file DI_matr.cxx.

Referenced by add_update_cb().

const char* enum_trans_to_string[]
static
Initial value:
= {
"none",
"similarity",
"jukes_cantor",
"felsenstein",
"pam",
"hall",
"barker",
"chemical",
"kimura",
"olsen",
"felsenstein voigt",
"olsen voigt",
"max ml",
NULp,
}
#define NULp
Definition: cxxforward.h:97

Definition at line 1157 of file DI_matr.cxx.