CAFE
Computational Analysis of gene Family Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tree.h File Reference
#include <utils.h>
#include <stdarg.h>
#include <utils_string.h>

Go to the source code of this file.

Data Structures

struct  tagTree
 
struct  tagTreeNode
 
struct  tagPhylogenyNode
 
struct  tagMetapostConfig
 

Macros

#define PS_SKIP_BL   0x1000
 
#define PS_NWICK   0x0000
 
#define PS_NHX   0x0FFE
 
#define TREE_DEBUG   1
 

Typedefs

typedef struct tagTreepTree
 
typedef struct tagTreeNodepTreeNode
 
typedef struct tagTree Tree
 
typedef struct tagTreeNode TreeNode
 
typedef pTreeNode(* tree_func_node_new )(pTree ptree)
 
typedef pTree(* tree_func_new )(tree_func_node_new nfunc, int size)
 
typedef void(* tree_func_node )(pTree ptree, pTreeNode pnode, va_list ap)
 
typedef void(* tree_func_node_copy )(pTreeNode psrc, pTreeNode pdest)
 
typedef struct tagPhylogenyNodepPhylogenyNode
 
typedef struct tagPhylogenyNode PhylogenyNode
 
typedef void(* phylogeny_func_parse_node )(pTree ptree, pTreeNode pnode)
 
typedef void(* phylogeny_func_name_modify )(pString str, pPhylogenyNode pnode)
 
typedef struct tagMetapostConfigpMetapostConfig
 
typedef double(* metapost_remark )(pString str, pTree ptree, pMetapostConfig pmc, va_list ap)
 
typedef double(* metapost_annotation_func )(pString str, pTreeNode pnode, pMetapostConfig pmc, va_list ap)
 
typedef struct tagMetapostConfig MetapostConfig
 

Enumerations

enum  enumPhylogeny_speciation { PHYLOGENY_SPECIATION_NOT_DECIDED = 0, PHYLOGENY_SPECIATION_DUPLICATED, PHYLOGENY_SPECIATION_SPECIES }
 
enum  tagMPUnitList { MP_UNIT_IN = 0, MP_UNIT_MM, MP_UNIT_CM }
 
enum  tagMPDirectionList { MP_DIR_HORIZONTAL = 0, MP_DIR_VERTICAL }
 
enum  tagMPShapeList {
  MP_SHAPE_RECT = 1, MP_SHAPE_TRI = 2, MP_SHAPE_MASK = 3, MP_SHAPE_MOST_CENTER = 4,
  MP_SHAPE_LEAST_CENTER = 8
}
 

Functions

pTree tree_new (tree_func_node_new nfunc, int size)
 
void tree_new_fill (pTree ptree, tree_func_node_new nfunc)
 
void tree_free (pTree ptree)
 
pTreeNode tree_new_empty_node ()
 
int tree_is_leaf (pTreeNode pnode)
 
int tree_is_root (pTree ptree, pTreeNode pnode)
 
void tree_add_child_to_node (pTreeNode parent, pTreeNode child)
 
void tree_traveral_prefix (pTree ptree, tree_func_node func,...)
 
void tree_traveral_postfix (pTree ptree, tree_func_node func,...)
 
void tree_traveral_infix (pTree ptree, tree_func_node func,...)
 
void tree_clear_reg (pTree ptree)
 
void * tree_get_child (pTreeNode ptnode, int idx)
 
pTree tree_copy (pTree psrc, tree_func_node_new new_node_func, tree_func_node_copy copy)
 
void tree_build_node_list (pTree ptree)
 
pTree phylogeny_split_tree (pTree ptree, int idx, tree_func_node freenode)
 
pString phylogeny_string (pTree ptree, phylogeny_func_name_modify fmod)
 
void phylogeny_node_copy (pTreeNode psrc, pTreeNode pdest)
 
pTree phylogeny_load_from_string (char *sztree, tree_func_new new_tree_func, tree_func_node_new new_tree_node_func, phylogeny_func_parse_node parsefunc, int size)
 
pTree phylogeny_root_tree (pTree ptree, tree_func_node_new new_tree_node_func, phylogeny_func_parse_node parsefunc,...)
 
pTree phylogeny_load_from_file (char *sztree, tree_func_new new_tree_func, tree_func_node_new new_tree_node_func, phylogeny_func_parse_node parsefunc)
 
void phylogeny_free (pTree ptree)
 
pTreeNode phylogeny_new_empty_node (pTree ptree)
 
void phylogeny_clear_node (pPhylogenyNode pnode)
 
pTree phylogeny_copy (pTree psrc)
 
pTree phylogeny_new (char *sztree, phylogeny_func_parse_node parsefunc)
 
int phylogeny_delete_nodes_by_index (pTree ptree, int idx, tree_func_node freenode)
 
int phylogeny_delete_nodes_by_reg (pTree ptree, tree_func_node freenode)
 
int phylogeny_delete_nodes_by_func (pTree ptree, tree_func_node filter, tree_func_node freenode)
 
pTreeNode phylogeny_get_sibling (pTree ptree, pTreeNode ptnode)
 
pString phylogeny_string_nhx (pTree ptree, phylogeny_func_name_modify fmod, int opts)
 
pString phylogeny_string_newick (pTree ptree, phylogeny_func_name_modify fmod, int opts)
 
pString phylogeny_to_mp (pTree ptree, pMetapostConfig pmc,...)
 

Macro Definition Documentation

#define PS_NHX   0x0FFE
#define PS_NWICK   0x0000
#define PS_SKIP_BL   0x1000
#define TREE_DEBUG   1

Typedef Documentation

typedef double(* metapost_annotation_func)(pString str, pTreeNode pnode, pMetapostConfig pmc, va_list ap)
typedef double(* metapost_remark)(pString str, pTree ptree, pMetapostConfig pmc, va_list ap)
typedef void(* phylogeny_func_name_modify)(pString str, pPhylogenyNode pnode)
typedef void(* phylogeny_func_parse_node)(pTree ptree, pTreeNode pnode)
typedef struct tagTree* pTree
typedef struct tagTreeNode* pTreeNode
typedef struct tagTree Tree
typedef pTree(* tree_func_new)(tree_func_node_new nfunc, int size)
typedef void(* tree_func_node)(pTree ptree, pTreeNode pnode, va_list ap)
typedef void(* tree_func_node_copy)(pTreeNode psrc, pTreeNode pdest)
typedef pTreeNode(* tree_func_node_new)(pTree ptree)
typedef struct tagTreeNode TreeNode

Simple structure representing a generic node in a generic tree. Has an ID and pointers to parent and children. Implementers of tree_func_node_new are expected to return a value that can be cast to this structure.

Enumeration Type Documentation

Enumerator
PHYLOGENY_SPECIATION_NOT_DECIDED 
PHYLOGENY_SPECIATION_DUPLICATED 
PHYLOGENY_SPECIATION_SPECIES 
Enumerator
MP_DIR_HORIZONTAL 
MP_DIR_VERTICAL 
Enumerator
MP_SHAPE_RECT 
MP_SHAPE_TRI 
MP_SHAPE_MASK 
MP_SHAPE_MOST_CENTER 
MP_SHAPE_LEAST_CENTER 
Enumerator
MP_UNIT_IN 
MP_UNIT_MM 
MP_UNIT_CM 

Function Documentation

void phylogeny_clear_node ( pPhylogenyNode  pnode)
pTree phylogeny_copy ( pTree  psrc)
int phylogeny_delete_nodes_by_func ( pTree  ptree,
tree_func_node  filter,
tree_func_node  freenode 
)
int phylogeny_delete_nodes_by_index ( pTree  ptree,
int  idx,
tree_func_node  freenode 
)
int phylogeny_delete_nodes_by_reg ( pTree  ptree,
tree_func_node  freenode 
)
void phylogeny_free ( pTree  ptree)
pTreeNode phylogeny_get_sibling ( pTree  ptree,
pTreeNode  ptnode 
)
pTree phylogeny_load_from_file ( char *  sztree,
tree_func_new  new_tree_func,
tree_func_node_new  new_tree_node_func,
phylogeny_func_parse_node  parsefunc 
)
pTree phylogeny_load_from_string ( char *  sztree,
tree_func_new  new_tree_func,
tree_func_node_new  new_tree_node_func,
phylogeny_func_parse_node  parsefunc,
int  size 
)
pTree phylogeny_new ( char *  sztree,
phylogeny_func_parse_node  parsefunc 
)
pTreeNode phylogeny_new_empty_node ( pTree  ptree)
void phylogeny_node_copy ( pTreeNode  psrc,
pTreeNode  pdest 
)
pTree phylogeny_root_tree ( pTree  ptree,
tree_func_node_new  new_tree_node_func,
phylogeny_func_parse_node  parsefunc,
  ... 
)
pTree phylogeny_split_tree ( pTree  ptree,
int  idx,
tree_func_node  freenode 
)
pString phylogeny_string ( pTree  ptree,
phylogeny_func_name_modify  fmod 
)
pString phylogeny_string_newick ( pTree  ptree,
phylogeny_func_name_modify  fmod,
int  opts 
)
pString phylogeny_string_nhx ( pTree  ptree,
phylogeny_func_name_modify  fmod,
int  opts 
)
pString phylogeny_to_mp ( pTree  ptree,
pMetapostConfig  pmc,
  ... 
)
void tree_add_child_to_node ( pTreeNode  parent,
pTreeNode  child 
)
void tree_build_node_list ( pTree  ptree)
void tree_clear_reg ( pTree  ptree)
pTree tree_copy ( pTree  psrc,
tree_func_node_new  new_node_func,
tree_func_node_copy  copy 
)
void tree_free ( pTree  ptree)
void* tree_get_child ( pTreeNode  ptnode,
int  idx 
)
int tree_is_leaf ( pTreeNode  pnode)
int tree_is_root ( pTree  ptree,
pTreeNode  pnode 
)
pTree tree_new ( tree_func_node_new  nfunc,
int  size 
)
pTreeNode tree_new_empty_node ( )
void tree_new_fill ( pTree  ptree,
tree_func_node_new  nfunc 
)
void tree_traveral_infix ( pTree  ptree,
tree_func_node  func,
  ... 
)
void tree_traveral_postfix ( pTree  ptree,
tree_func_node  func,
  ... 
)
void tree_traveral_prefix ( pTree  ptree,
tree_func_node  func,
  ... 
)