treeshape            package:apTreeshape            R Documentation

_B_u_i_l_d_s _a_n _o_b_j_e_c_t _o_f _c_l_a_s_s _t_r_e_e_s_h_a_p_e

_D_e_s_c_r_i_p_t_i_o_n:

     'treeshape' builds a tree of class '"treeshape"' from a n*2
     matrix, where n is the number of internal nodes of the tree. There
     are no informations about the heights of the branches in an object
     of class '"treeshape"'. Formally, a "tree shape" is a phylogenetic
     tree where the label of the tips are ignored. Here, the label of
     the tips can be kept or ignored. If a 'names' vector is provided,
     then the names of species are attached to the tips of the tree.
     Otherwise, tips are simply labeled with their numbers in the tree.
     Trees of class '"treeshape"' are always binary.

_U_s_a_g_e:

     treeshape(nodes, names)

_A_r_g_u_m_e_n_t_s:

   nodes: 'nodes' is a n*2 matrix containing the node structure of the
          tree.

   names: 'names' is a vector which contains the names of the tips.

_D_e_t_a_i_l_s:

     A tree of class '"treeshape"' is a fully dichotomous binary tree.
     The purpose of the class '"treeshape"' is to study the topology of
     phylogenetic trees. The heights of branches are not provided for a
     tree of that class because we mainly focus on the balance aspect
     of the trees. The 'i'th row  of the nodes matrix represents the
     children of the node number i in the tree ('nodes[i,1]' being the
     left child, and 'nodes[i,2]' being the right child). A positive
     value represents an internal node, while a negative one stands for
     a tip of the tree. The last row always represents the children of
     the root of the tree.

_V_a_l_u_e:

     An object of class '"treeshape"'

_A_u_t_h_o_r(_s):

     Michael Blum <michael.blum@imag.fr> 
      Nicolas Bortolussi <nicolas.bortolussi@imag.fr> 
      Eric Durand <eric.durand@imag.fr> 
      Olivier Franois <olivier.francois@imag.fr> 

_R_e_f_e_r_e_n_c_e_s:

     Semple, C. and Steel, M. (2003) Phylogenetics. _Oxford Lecture
     Series In Mathematics and its Applications_, *24*, for the
     mathematical definitions and tools for phylogenetic trees.

_S_e_e _A_l_s_o:

     'rtreeshape'

_E_x_a_m_p_l_e_s:

     ## Nodes will define the nodes of a five tips tree
     nodes<-matrix(nrow=4,ncol=2)
     nodes[1,]<-c(-5,-4)
     nodes[2,]<-c(1,-1)
     nodes[3,]<-c(-3,2)
     nodes[4,]<-c(-2,3)

     ## Now we can build the tree and plot it.
     tree1<-treeshape(nodes)
     plot(tree1)

     ## Computation of the sackin index for the tree :
     sackin(tree1)

     ## Label will define the names of the tips
     label=c("a", "b", "c", "d", "e")
     tree2<-treeshape(nodes, label)
     plot(tree1, tree2)

