This can be quite easy to implement in ggtree, I can write a
geom layer to layout the alignment. As ggbio already provides many
geom for genomic data and I don’t want to re-invent the wheel, I decided to try
ggtree+ggbio. This is also the beauty of
R that packages complete each others.
obkData to store case-base outbreak data. It also provides a function,
plotggphy, to visualize such data on the phylogenetic tree.
library(OutbreakTools) data(FluH1N1pdm2009) attach(FluH1N1pdm2009) x <- new("obkData", individuals = individuals, dna = FluH1N1pdm2009$dna, dna.individualID = samples$individualID, dna.date = samples$date, trees = FluH1N1pdm2009$trees) plotggphy(x, ladderize = TRUE, branch.unit = "year", tip.color = "location", tip.size = 3, tip.alpha = 0.75)
phyloseq class defined in the phyloseq package was designed for microbiome data.
phyloseq package implemented
plot_tree function using
ggplot2. Although the function was implemented by
ggplot2 and we can use
scale_color_manual etc for customization, the most valuable part of
ggplot2, adding layer, is missing.
plot_tree only provides limited parameters to control the output graph and it is hard to add layer unless user has expertise in both