Exporting Tree with Data
Guangchuang Yu · 2022
The treeio package supports parsing various phylogenetic tree file formats including software outputs that contain evolutionary evidence. Some of the formats are just log files, while some of the others are non-standard formats. The treeio package provides the write.beast() function to export treedata to BEAST Nexus file. With treeio, it is easy to convert software output to BEAST format if the output can be parsed by treeio. JavaScript Object Notation is a lightweight data-interchange format and is widely supported in almost all modern programming languages. Exporting tree structure is easy, users can use the as.phyo() method defined in treeio to convert a treedata object to a phylo object and then use write.tree() or write.nexus() implemented in ape package to export the tree structure as Newick text or Nexus file.