Preface

The book is meant as a guide for data integration, manipulation and visualization of phylogenetic trees using a suite of R packages, tidytree, treeio and ggtree. Hence, if you are starting to read this book, we assume you have a working knowledge of how to use R and ggplot2.

0.1 How to read this book

0.2 Structure of the book

  • Part 1 (Tree data input, output and manipulation) describes treeio package for tree data input and output, and tidytree package for tree data manipulation.
  • Part 2 (Tree data visualization and annotation) introduces tree visualization and annotation using grammar of graphic syntax implemented in the ggtree package. It emphasizes on presenting tree associated data on the tree.
  • Part 3 (ggtree extensions) introduces ggtreeExtra for presenting data on circular layout trees and other extensions including MicrobiotaProcess and ggnetworx etc..
  • Part 4 (Miscellaneous topics) describes utilities provided by the ggtree package suite and presents a set of reproducible examples.

0.3 Software information and conventions

The basic R session information when compiling this book is as follows:

xfun::session_info(
    c('ape', 'aplot', 'ggplot2', 'ggtree', 
      'ggtreeExtra', 'tidytree', 'treeio'),
    dependencies = FALSE)
## R version 4.1.1 (2021-08-10)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Arch Linux
## 
## Locale:
##   LC_CTYPE=en_US.UTF-8      
##   LC_NUMERIC=C              
##   LC_TIME=en_US.UTF-8       
##   LC_COLLATE=en_US.UTF-8    
##   LC_MONETARY=en_US.UTF-8   
##   LC_MESSAGES=en_US.UTF-8   
##   LC_PAPER=en_US.UTF-8      
##   LC_NAME=C                 
##   LC_ADDRESS=C              
##   LC_TELEPHONE=C            
##   LC_MEASUREMENT=en_US.UTF-8
##   LC_IDENTIFICATION=C       
## 
## Package version:
##   ape_5.5               aplot_0.1.1          
##   ggplot2_3.3.5         ggtree_3.1.5.900     
##   ggtreeExtra_1.3.5.990 tidytree_0.3.6       
##   treeio_1.17.2

Package names are in bold text (e.g., ggtree), and function names are followed by parentheses (e.g., treeio::read.beast()). The doulbe-colon operator (::) means accessing an object from a package.