plotTreeBasic | R Documentation |
This function is using the ggtree package to show cell genealogy combined with cell information, e.g. fluorescence intensity. This part of bactMAP is under development - plotting cell trees is possible, but is not (yet) as straight-forward. Check the tutorials on veeninglab.com/bactmap to get more information on how to use this function.
plotTreeBasic(phylo,
extradata,
yscalechange = FALSE,
showClade = FALSE,
layout = "rectangular",
ydata,
cellNumber,
open.angle,
linesize = 1,
linecolor = "black",
lines = TRUE,
colors = FALSE)
phylo |
The |
extradata |
Data connected to the |
yscalechange |
Default = |
showClade |
When |
layout |
Inherited from |
ydata |
Indicate the column name of the variable you want to be plotted on the y-axis of the tree (when |
cellNumber |
Indicate the number of the cell of which you want to highlight the clade (when |
open.angle |
When |
linesize |
Thickness of the lines in the tree. |
linecolor |
Indicate the color of the lines in the tree. |
lines |
When highlighting a clade, set |
colors |
When highlighting a clade, set |
A ggtree
object which can be edited using the ggtree
commands.
Renske van Raaphorst
The ggtree cookbook by Guangchuang Yu.
## Not run:
#this code requires other packages:
require(ggtree)
require(ggplot2)
# download example datasets from https://veeninglab.com/f/example_datasets.zip
load("ssbB_phylo.rda")
load("ssbB_meanfluo.rda")
#load example data from bactMAP package
myTreeData <- ssbB_phylo
myFluoData <- ssbB_meanfluo
#plot Tree with attributes
library(ggtree)
plotTreeBasic(myTreeData$phylos)%<+% myTreeData$data_attributes +
geom_point(aes(x=x-branch.length, color=fluormean), size=6) +
geom_tippoint(aes(color=fluormean_D), size=6) + #added tip points, different dot size
geom_label(aes(x=x-branch.length, label=label), color=NA, fill="white", alpha=0.5, size=1) +
#I also make a seethrough background label so you can see the text over the colored dots
geom_text(aes(x=x-branch.length, label=label), size=3) +
scale_color_viridis_c(option="magma") + #add different color scale
theme(legend.position="right") + #add legend
coord_flip()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.