Skip to Main Content
R Bioinformatics Cookbook
book

R Bioinformatics Cookbook

by Dan MacLean
October 2019
Intermediate to advanced content levelIntermediate to advanced
316 pages
9h 45m
English
Packt Publishing
Content preview from R Bioinformatics Cookbook

How it works...

This code achieves a lot very quickly. It can do this by virtue of its ggplot-like layer syntax. Here's what each step does and its output:

  1. Load in a tree from a file. The tree here has 191 tips, so it's quite large. It happens to be in Newick format, so we use the ape read.tree() function. Note that we don't need to have a treedata object for ggtree in subsequent steps; the phylo object returned from read.tree() is perfectly acceptable to ggtree().
  2. Create a basic tree with ggtree(). This function is a wrapper for a longer ggplot-style syntax, specifically, ggplot(itol) + aes(x,y) + geom_tree() + theme_tree(). Hence, all the usual ggplot functions can be used as extra layers in the plot. The code in this step gives us the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

R Bioinformatics Cookbook - Second Edition

R Bioinformatics Cookbook - Second Edition

Dan MacLean
R Cookbook, 2nd Edition

R Cookbook, 2nd Edition

JD Long, Paul Teetor

Publisher Resources

ISBN: 9781789950694Supplemental Content