Skip to content
Dom Bennett edited this page Jun 26, 2017 · 5 revisions

TreeMan is an S4 class that consists of the following slots:

  • ndlst list of nodes
  • nds vector of node IDs (nids)
  • nnds number of nids
  • tips vector of tip IDs (tids)
  • ntips number of tids
  • all vector of nids and tids
  • nall number of nids and tids
  • pd number, total span
  • wspn logical, with spans or not
  • wtxnyms logical, with taxonyms or not
  • ply logical, polytomous or not
  • updtd logical, slots up-to-date or not
  • ndmtrx NULL or bigmemory object
  • tinds vector of integers identifying nodes that are tips
  • prinds vector of integers indicating the pre-node
  • root root ID (rid)
  • othr_slt_nms vector of additional user-defined slots

All slots are updated whenever a set or manip method is used. Updating these slots is performed with the updateSlts() function. For certain functions, updating will not occur automatically and must be performed manually. It is not recommended that you ever print the ndlst to console (it can be very big). All the slots can be accessed using [] or @, which will be marginally faster. Note, nodes in the ndlst are lists and not Nodes.

In addition, there are pseudo-slots: 'spns', 'prids, 'ptids', 'txnyms' , ultr and age. All these slots are calculated upon being called. The first three use the getNdsSlt() function. In addition, any user defined slots can be extracted in this way. ultr and age will respectively determine whether the tree is ultrametric or calculate its age. These are calculated using the isUltrmtrc() and getAge() functions and are only provided here for sake of completeness.

Using double square brackets, [[]] with a tree will extract node information from the ndlst and generate a Node object.

Whenever a TreeMan object is initiated the consistency of the tree is determined using the fastCheckTreeMan() function. For a more detailed and thorough check use the checkNdlst() function, this will indicate nodes that are incorrect. A TreeMan object must have a root, there must be no circularity and each node must only have one pre-node.

Next page: TreeMen class

Clone this wiki locally