ARB
Classes | Macros | Enumerations | Functions | Variables
ad_trees.cxx File Reference
#include "tree_position.h"
#include "ad_trees.h"
#include "NT_tree_cmp.h"
#include <CT_ctree.hxx>
#include <TreeAdmin.h>
#include <TreeRead.h>
#include <TreeWrite.h>
#include <TreeCallbacks.hxx>
#include <awt_sel_boxes.hxx>
#include <awt_modules.hxx>
#include <awt_TreeAwars.hxx>
#include <aw_awars.hxx>
#include <aw_edit.hxx>
#include <aw_file.hxx>
#include <aw_msg.hxx>
#include <aw_root.hxx>
#include <aw_select.hxx>
#include <arb_strbuf.h>
#include <arb_file.h>
#include <arb_diff.h>
#include <arb_defs.h>
#include <cctype>
#include <awt_config_manager.hxx>
Include dependency graph for ad_trees.cxx:

Go to the source code of this file.

Classes

class  CombinedPosInfo
 
class  SortByTopo
 

Macros

#define AWAR_TREE_SAV   "ad_tree/"
 
#define AWAR_TREE_TMP   "tmp/ad_tree/"
 
#define AWAR_TREE_SECURITY   AWAR_TREE_TMP "tree_security"
 
#define AWAR_TREE_REM   AWAR_TREE_TMP "tree_rem"
 
#define AWAR_TREE_IMPORT   AWAR_TREE_TMP "import_tree"
 
#define AWAR_GROUPXFER_SAV   AWAR_TREE_SAV "groupxfer/"
 
#define AWAR_GROUPXFER_SOURCE   AWAR_GROUPXFER_SAV "restrict"
 
#define AWAR_GROUPXFER_OVERWRITE_MODE   AWAR_GROUPXFER_SAV "overwrite"
 
#define AWAR_GROUPXFER_INGROUP_ABS   AWAR_GROUPXFER_SAV "ingroup/abs"
 
#define AWAR_GROUPXFER_INGROUP_REL   AWAR_GROUPXFER_SAV "ingroup/rel"
 
#define AWAR_GROUPXFER_INGROUP_LIM   AWAR_GROUPXFER_SAV "ingroup/lim"
 
#define AWAR_GROUPXFER_OUTGROUP_ABS   AWAR_GROUPXFER_SAV "outgroup/abs"
 
#define AWAR_GROUPXFER_OUTGROUP_REL   AWAR_GROUPXFER_SAV "outgroup/rel"
 
#define AWAR_GROUPXFER_OUTGROUP_LIM   AWAR_GROUPXFER_SAV "outgroup/lim"
 
#define AWAR_GROUPXFER_UNKNOWN_ABS   AWAR_GROUPXFER_SAV "unknown"
 
#define AWAR_GROUPXFER_KEELING   AWAR_GROUPXFER_SAV "keeling"
 
#define AWAR_GROUPXFER_ACI   AWAR_GROUPXFER_SAV "aci"
 
#define AWAR_TREE_EXPORT_FILEBASE   AWAR_TREE_TMP "export_tree"
 
#define AWAR_TREE_EXPORT_FILTER   AWAR_TREE_EXPORT_FILEBASE "/filter"
 
#define AWAR_TREE_EXPORT_NAME   AWAR_TREE_EXPORT_FILEBASE "/file_name"
 
#define AWAR_TREE_EXPORT_SAV   AWAR_TREE_SAV "export_tree/"
 
#define AWAR_TREE_EXPORT_FORMAT   AWAR_TREE_EXPORT_SAV "format"
 
#define AWAR_TREE_EXPORT_NDS   AWAR_TREE_EXPORT_SAV "NDS"
 
#define AWAR_TREE_EXPORT_INCLUDE_BOOTSTRAPS   AWAR_TREE_EXPORT_SAV "bootstraps"
 
#define AWAR_TREE_EXPORT_INCLUDE_BRANCHLENS   AWAR_TREE_EXPORT_SAV "branchlens"
 
#define AWAR_TREE_EXPORT_INCLUDE_GROUPNAMES   AWAR_TREE_EXPORT_SAV "groupnames"
 
#define AWAR_TREE_EXPORT_HIDE_FOLDED_GROUPS   AWAR_TREE_EXPORT_SAV "hide_folded"
 
#define AWAR_TREE_EXPORT_QUOTEMODE   AWAR_TREE_EXPORT_SAV "quote_mode"
 
#define AWAR_TREE_EXPORT_REPLACE   AWAR_TREE_EXPORT_SAV "replace"
 
#define AWAR_TREE_CONSENSE_TMP   AWAR_TREE_TMP "consense/"
 
#define AWAR_TREE_CONSENSE_SAV   AWAR_TREE_SAV "consense/"
 
#define AWAR_TREE_CONSENSE_TREE   AWAR_TREE_CONSENSE_SAV "tree"
 
#define AWAR_TREE_CONSENSE_SELECTED   AWAR_TREE_CONSENSE_TMP "selected"
 
#define AWAR_MFURC   "tree/multifurc/"
 
#define AWAR_MFURC_CONSIDER_BOOTSTRAP   AWAR_MFURC "use_bs"
 
#define AWAR_MFURC_CONSIDER_LENGTH   AWAR_MFURC "use_len"
 
#define AWAR_MFURC_CONSIDER_TERMINALS   AWAR_MFURC "terminals"
 
#define AWAR_MFURC_LENGTH_LIMIT   AWAR_MFURC "len"
 
#define AWAR_MFURC_BOOTSTRAP_LIMIT   AWAR_MFURC "bs"
 

Enumerations

enum  ExportTreeType { AD_TREE_EXPORT_FORMAT_NEWICK, AD_TREE_EXPORT_FORMAT_XML, AD_TREE_EXPORT_FORMAT_NEWICK_PRETTY }
 
enum  ExportNodeType { AD_TREE_EXPORT_NODE_SPECIES_NAME, AD_TREE_EXPORT_NODE_NDS }
 

Functions

static void tree_vars_callback (AW_root *aw_root)
 
static void update_default_treename_cb (AW_root *aw_root)
 
static void ad_tree_set_security (AW_root *aw_root)
 
static void update_filter_cb (AW_root *root)
 
void create_trees_var (AW_root *aw_root, AW_default aw_def)
 
static void tree_save_cb (AW_window *aww)
 
static AW_windowcreate_tree_export_window (AW_root *root)
 
static charreadXmlTree (char *fname)
 
static void tree_load_cb (AW_window *aww)
 
static AW_windowcreate_tree_import_window (AW_root *root)
 
static void ad_move_tree_info (AW_window *aww, bool transferGroups)
 
static void swap_source_dest_cb (AW_window *aww)
 
static void copy_tree_awar_cb (UNFIXED, AW_awar *aw_source, AW_awar *aw_dest)
 
void NT_create_twoTreeSelection (AW_window *aws)
 
static AW_window_simple * create_select_other_tree_window (AW_root *root, const char *winId, const char *winTitle, const char *helpFile, AW_awar *awar_displayed_tree)
 
AW_windowNT_create_compareTopologies_window (AW_root *root)
 
AW_windowNT_create_moveGroupInfo_window (AW_root *root)
 
static void reorder_trees_cb (AW_window *aww, awt_reorder_mode dest)
 
void popup_tree_admin_window (AW_window *awp)
 
static void create_consense_tree_cb (AW_window *aww, AW_selection *selected_trees)
 
static void use_selected_as_target_cb (AW_window *aww)
 
AW_windowNT_create_consense_window (AW_root *aw_root)
 
static GB_ERROR sort_tree_by_other_tree (GBDATA *gb_main, TreeNode *tree, const char *other_tree)
 
static bool sort_dtree_by_other_tree_cb (TreeNode *tree, GB_ERROR &error)
 
static void sort_tree_by_other_tree_cb (UNFIXED, TREE_canvas *ntw)
 
AW_windowNT_create_sort_tree_by_other_tree_window (AW_root *aw_root, TREE_canvas *ntw)
 
void NT_create_multifurcate_tree_awars (AW_root *aw_root, AW_default props)
 
static void multifurcation_cb (UNFIXED, TREE_canvas *ntw)
 
AW_windowNT_create_multifurcate_tree_window (AW_root *aw_root, TREE_canvas *ntw)
 

Variables

static AWT_config_mapping_def tree_export_config_mapping []
 
static AWT_config_mapping_def moveGroupInfo_mapping []
 
static AWT_predefined_config moveGroupInfo_predef []
 

Macro Definition Documentation

#define AWAR_TREE_SAV   "ad_tree/"

Definition at line 41 of file ad_trees.cxx.

#define AWAR_TREE_TMP   "tmp/ad_tree/"

Definition at line 42 of file ad_trees.cxx.

#define AWAR_TREE_SECURITY   AWAR_TREE_TMP "tree_security"
#define AWAR_TREE_REM   AWAR_TREE_TMP "tree_rem"

Definition at line 45 of file ad_trees.cxx.

Referenced by create_trees_var(), popup_tree_admin_window(), and tree_vars_callback().

#define AWAR_TREE_IMPORT   AWAR_TREE_TMP "import_tree"
#define AWAR_GROUPXFER_SAV   AWAR_TREE_SAV "groupxfer/"

Definition at line 48 of file ad_trees.cxx.

#define AWAR_GROUPXFER_SOURCE   AWAR_GROUPXFER_SAV "restrict"
#define AWAR_GROUPXFER_OVERWRITE_MODE   AWAR_GROUPXFER_SAV "overwrite"
#define AWAR_GROUPXFER_INGROUP_ABS   AWAR_GROUPXFER_SAV "ingroup/abs"
#define AWAR_GROUPXFER_INGROUP_REL   AWAR_GROUPXFER_SAV "ingroup/rel"
#define AWAR_GROUPXFER_INGROUP_LIM   AWAR_GROUPXFER_SAV "ingroup/lim"
#define AWAR_GROUPXFER_OUTGROUP_ABS   AWAR_GROUPXFER_SAV "outgroup/abs"
#define AWAR_GROUPXFER_OUTGROUP_REL   AWAR_GROUPXFER_SAV "outgroup/rel"
#define AWAR_GROUPXFER_OUTGROUP_LIM   AWAR_GROUPXFER_SAV "outgroup/lim"
#define AWAR_GROUPXFER_UNKNOWN_ABS   AWAR_GROUPXFER_SAV "unknown"
#define AWAR_GROUPXFER_KEELING   AWAR_GROUPXFER_SAV "keeling"

Definition at line 59 of file ad_trees.cxx.

Referenced by create_trees_var(), and NT_create_moveGroupInfo_window().

#define AWAR_GROUPXFER_ACI   AWAR_GROUPXFER_SAV "aci"
#define AWAR_TREE_EXPORT_FILEBASE   AWAR_TREE_TMP "export_tree"

Definition at line 62 of file ad_trees.cxx.

Referenced by create_tree_export_window(), create_trees_var(), and tree_save_cb().

#define AWAR_TREE_EXPORT_FILTER   AWAR_TREE_EXPORT_FILEBASE "/filter"

Definition at line 63 of file ad_trees.cxx.

Referenced by tree_vars_callback(), and update_filter_cb().

#define AWAR_TREE_EXPORT_NAME   AWAR_TREE_EXPORT_FILEBASE "/file_name"

Definition at line 64 of file ad_trees.cxx.

Referenced by tree_save_cb(), and tree_vars_callback().

#define AWAR_TREE_EXPORT_SAV   AWAR_TREE_SAV "export_tree/"

Definition at line 66 of file ad_trees.cxx.

#define AWAR_TREE_EXPORT_FORMAT   AWAR_TREE_EXPORT_SAV "format"
#define AWAR_TREE_EXPORT_NDS   AWAR_TREE_EXPORT_SAV "NDS"
#define AWAR_TREE_EXPORT_INCLUDE_BOOTSTRAPS   AWAR_TREE_EXPORT_SAV "bootstraps"

Definition at line 70 of file ad_trees.cxx.

Referenced by create_tree_export_window(), create_trees_var(), and tree_save_cb().

#define AWAR_TREE_EXPORT_INCLUDE_BRANCHLENS   AWAR_TREE_EXPORT_SAV "branchlens"

Definition at line 71 of file ad_trees.cxx.

Referenced by create_tree_export_window(), create_trees_var(), and tree_save_cb().

#define AWAR_TREE_EXPORT_INCLUDE_GROUPNAMES   AWAR_TREE_EXPORT_SAV "groupnames"

Definition at line 72 of file ad_trees.cxx.

Referenced by create_tree_export_window(), create_trees_var(), and tree_save_cb().

#define AWAR_TREE_EXPORT_HIDE_FOLDED_GROUPS   AWAR_TREE_EXPORT_SAV "hide_folded"

Definition at line 73 of file ad_trees.cxx.

Referenced by create_tree_export_window(), create_trees_var(), and tree_save_cb().

#define AWAR_TREE_EXPORT_QUOTEMODE   AWAR_TREE_EXPORT_SAV "quote_mode"

Definition at line 74 of file ad_trees.cxx.

Referenced by create_tree_export_window(), create_trees_var(), and tree_save_cb().

#define AWAR_TREE_EXPORT_REPLACE   AWAR_TREE_EXPORT_SAV "replace"

Definition at line 75 of file ad_trees.cxx.

Referenced by create_tree_export_window(), create_trees_var(), and tree_save_cb().

#define AWAR_TREE_CONSENSE_TMP   AWAR_TREE_TMP "consense/"

Definition at line 78 of file ad_trees.cxx.

#define AWAR_TREE_CONSENSE_SAV   AWAR_TREE_SAV "consense/"

Definition at line 79 of file ad_trees.cxx.

#define AWAR_TREE_CONSENSE_TREE   AWAR_TREE_CONSENSE_SAV "tree"
#define AWAR_TREE_CONSENSE_SELECTED   AWAR_TREE_CONSENSE_TMP "selected"
#define AWAR_MFURC   "tree/multifurc/"

Definition at line 1090 of file ad_trees.cxx.

#define AWAR_MFURC_CONSIDER_BOOTSTRAP   AWAR_MFURC "use_bs"
#define AWAR_MFURC_CONSIDER_LENGTH   AWAR_MFURC "use_len"
#define AWAR_MFURC_CONSIDER_TERMINALS   AWAR_MFURC "terminals"
#define AWAR_MFURC_LENGTH_LIMIT   AWAR_MFURC "len"
#define AWAR_MFURC_BOOTSTRAP_LIMIT   AWAR_MFURC "bs"

Enumeration Type Documentation

Enumerator
AD_TREE_EXPORT_FORMAT_NEWICK 
AD_TREE_EXPORT_FORMAT_XML 
AD_TREE_EXPORT_FORMAT_NEWICK_PRETTY 

Definition at line 165 of file ad_trees.cxx.

Enumerator
AD_TREE_EXPORT_NODE_SPECIES_NAME 
AD_TREE_EXPORT_NODE_NDS 

Definition at line 171 of file ad_trees.cxx.

Function Documentation

static void tree_vars_callback ( AW_root aw_root)
static
static void update_default_treename_cb ( AW_root aw_root)
static
static void ad_tree_set_security ( AW_root aw_root)
static
static void update_filter_cb ( AW_root root)
static
void create_trees_var ( AW_root aw_root,
AW_default  aw_def 
)
static void tree_save_cb ( AW_window aww)
static
static AW_window* create_tree_export_window ( AW_root root)
static
static char* readXmlTree ( char fname)
static
static void tree_load_cb ( AW_window aww)
static
static AW_window* create_tree_import_window ( AW_root root)
static
static void ad_move_tree_info ( AW_window aww,
bool  transferGroups 
)
static
static void swap_source_dest_cb ( AW_window aww)
static
static void copy_tree_awar_cb ( UNFIXED  ,
AW_awar aw_source,
AW_awar aw_dest 
)
static
void NT_create_twoTreeSelection ( AW_window aws)
static AW_window_simple* create_select_other_tree_window ( AW_root root,
const char winId,
const char winTitle,
const char helpFile,
AW_awar awar_displayed_tree 
)
static
AW_window* NT_create_compareTopologies_window ( AW_root root)
AW_window* NT_create_moveGroupInfo_window ( AW_root root)
static void reorder_trees_cb ( AW_window aww,
awt_reorder_mode  dest 
)
static
void popup_tree_admin_window ( AW_window awp)
static void create_consense_tree_cb ( AW_window aww,
AW_selection selected_trees 
)
static
static void use_selected_as_target_cb ( AW_window aww)
static
AW_window* NT_create_consense_window ( AW_root aw_root)
static GB_ERROR sort_tree_by_other_tree ( GBDATA gb_main,
TreeNode tree,
const char other_tree 
)
static
static bool sort_dtree_by_other_tree_cb ( TreeNode tree,
GB_ERROR error 
)
static
static void sort_tree_by_other_tree_cb ( UNFIXED  ,
TREE_canvas ntw 
)
static
AW_window* NT_create_sort_tree_by_other_tree_window ( AW_root aw_root,
TREE_canvas ntw 
)
void NT_create_multifurcate_tree_awars ( AW_root aw_root,
AW_default  props 
)
static void multifurcation_cb ( UNFIXED  ,
TREE_canvas ntw 
)
static
AW_window* NT_create_multifurcate_tree_window ( AW_root aw_root,
TREE_canvas ntw 
)

Variable Documentation

AWT_config_mapping_def tree_export_config_mapping[]
static
Initial value:
= {
{ AWAR_TREE_EXPORT_FORMAT, "format" },
{ AWAR_TREE_EXPORT_NDS, "nodetype" },
{ AWAR_TREE_EXPORT_QUOTEMODE, "quotemode" },
{ AWAR_TREE_EXPORT_REPLACE, "replacechars" },
{ NULp, NULp }
}
#define AWAR_TREE_EXPORT_NDS
Definition: ad_trees.cxx:69
#define AWAR_TREE_EXPORT_REPLACE
Definition: ad_trees.cxx:75
#define AWAR_TREE_EXPORT_FORMAT
Definition: ad_trees.cxx:68
#define AWAR_TREE_EXPORT_INCLUDE_GROUPNAMES
Definition: ad_trees.cxx:72
#define AWAR_TREE_EXPORT_QUOTEMODE
Definition: ad_trees.cxx:74
#define AWAR_TREE_EXPORT_INCLUDE_BRANCHLENS
Definition: ad_trees.cxx:71
#define NULp
Definition: cxxforward.h:97
#define AWAR_TREE_EXPORT_INCLUDE_BOOTSTRAPS
Definition: ad_trees.cxx:70
#define AWAR_TREE_EXPORT_HIDE_FOLDED_GROUPS
Definition: ad_trees.cxx:73

Definition at line 300 of file ad_trees.cxx.

AWT_config_mapping_def moveGroupInfo_mapping[]
static
Initial value:
= {
{ AWAR_GROUPXFER_INGROUP_ABS, "ingroup_abs" },
{ AWAR_GROUPXFER_INGROUP_REL, "ingroup_rel" },
{ AWAR_GROUPXFER_OUTGROUP_ABS, "outgroup_abs" },
{ AWAR_GROUPXFER_OUTGROUP_REL, "outgroup_rel" },
{ AWAR_GROUPXFER_UNKNOWN_ABS, "unknown_abs" },
{ AWAR_GROUPXFER_KEELING, "keeling" },
{ AWAR_GROUPXFER_INGROUP_LIM, "ingroup_lim" },
{ AWAR_GROUPXFER_OUTGROUP_LIM, "outgroup_lim" },
{ AWAR_GROUPXFER_SOURCE, "sourceGroups" },
{ AWAR_GROUPXFER_OVERWRITE_MODE, "overwriteGroups" },
{ AWAR_GROUPXFER_ACI, "aci" },
{ NULp, NULp },
}
#define AWAR_GROUPXFER_ACI
Definition: ad_trees.cxx:60
#define AWAR_GROUPXFER_OUTGROUP_LIM
Definition: ad_trees.cxx:57
#define AWAR_GROUPXFER_SOURCE
Definition: ad_trees.cxx:50
#define AWAR_GROUPXFER_INGROUP_LIM
Definition: ad_trees.cxx:54
#define AWAR_GROUPXFER_OUTGROUP_REL
Definition: ad_trees.cxx:56
#define AWAR_GROUPXFER_INGROUP_REL
Definition: ad_trees.cxx:53
#define AWAR_GROUPXFER_OUTGROUP_ABS
Definition: ad_trees.cxx:55
#define AWAR_GROUPXFER_UNKNOWN_ABS
Definition: ad_trees.cxx:58
#define AWAR_GROUPXFER_INGROUP_ABS
Definition: ad_trees.cxx:52
#define AWAR_GROUPXFER_KEELING
Definition: ad_trees.cxx:59
#define NULp
Definition: cxxforward.h:97
#define AWAR_GROUPXFER_OVERWRITE_MODE
Definition: ad_trees.cxx:51

Definition at line 650 of file ad_trees.cxx.

AWT_predefined_config moveGroupInfo_predef[]
static
Initial value:
= {
{ "*only_perfect_groups", "Only copy perfectly matching groups with\n * 100% ingroup ratio and\n * 0% outgroup ratio", "ingroup_lim='100';outgroup_lim='0'" },
{ "*maximize_ingroup_ratio", "Maximize ingroup ratio \n over outgroup ratio.\n(Note: diff of factor 10 is maybe too strong)", "ingroup_abs='0';ingroup_rel='100';outgroup_abs='0';outgroup_rel='10'" },
{ "*minimize_outgroup_ratio", "Minimize outgroup ratio \n over ingroup ratio.\n(Note: diff of factor 10 is maybe too strong)", "ingroup_abs='0';ingroup_rel='10';outgroup_abs='0';outgroup_rel='100'" },
{ "*report2name", "custom target group name:\n * add prefix \"XFRD_\" (allows to distinguish newly transferred from existing groups)\n * add suffix reporting penalty", "aci='\"XFRD_\";groupname;\" {penalty = \";penalty;\"}\"'" },
{ NULp, NULp, NULp },
}
#define NULp
Definition: cxxforward.h:97

Definition at line 670 of file ad_trees.cxx.