ggtree provides many helper functions for manupulating phylogenetic trees and make it easy to explore tree structure visually.

Here, as examples, I used ggtree to draw capital character G and C, which are first letter of my name :-).

To draw a tree in such shape, we need fan layout (circular layout with open angle) and then rotating the tree to let the open space on the correct position. Here are the source codes to produce the G and C shapes of tree. I am thinking about using the G shaped tree as ggtree logo. Have fun with ggtree :-)

Continue reading

OutbreakTools implements basic tools for the analysis of Disease Outbreaks.

It defines S4 class 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)

Continue reading

ggtree can parse many software outputs and the evolution evidences inferred by these software can be used directly for tree annotation. ggtree not only works as an infrastructure that enables evolutionary data that inferred by commonly used software packages to be used in R, but also serves as a general tree visualization and annotation tool for the R community as it supports many S3/S4 objects defined by other R packages.

phyloseq for microbiome data

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 theme, 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 phyloseq and ggplot2.

Continue reading

We are happy to announce that ggtree supports interactive tree annotation/manipulation by implementing an identify method. Users can click on a node to highlight a clade, to label or rotate it etc.

Here is an example of highlighting clades using geom_hilight with identify:

Continue reading

不记得是什么时候知道统计之都的,但我记得最早知道的是太云,因为我用了他写的corrplot包。后来统计之都最早接触的也是太云,他给我写邮件问我能不能帮忙校对《ggplot2:数据分析与图形艺术》,从此开始和太云变成了网友。

我在暨大的时候,太云曾经邀请我去China-R会议做报告,但我觉得自己没什么好分享的,GOSemSim这个包是硕士的时候做的,不好去讲之前做的东西。而当时我写的另一个包clusterProfiler,纯粹是因为大量做富集分析的工具都是针对模式生物,而我们实验室有做各种细菌;另外有一些工具,背景设置是有问题的。自己实现一个包,不受别人的限制。即便是这个包现在受到了一定的认可,比如BioC 3.3中有个debrowser的包使用了clusterProfiler,而在BioC 3.4中又有个新包bioCancer也使用了clusterProfiler;再比如这次在北京,有好几个参会的人员在茶歇时问了clusterProfiler的问题。但始终觉得这只是个实用性的包而已,算法是别人的,而且已经比较老了,类似的工具简直就是成百上千。所以也是不好意思拿出来讲的。所以我拒绝了太云的邀请,一直也没有参加China-R的会议。

今年是第九届China-R会议,这次会议规模很大,有22个分会场,超过100个演讲嘉宾,参会人数超过4000人。这一次刚好有个Bioconductor的分会场,Matt写信给我,说我写过几个Bioconductor包,他本人喜欢我的ChIPseeker包,问我能否在会上分享与Bioconductor包相关的经验。这是Bioconductor在中国的首秀,我欣然接受,当然也是因为这两年我写了ChIPseekerggtree,我自己觉得还拿得出手🙈。

Continue reading

Author's picture

Guangchuang Yu

Bioinformatics Professor @ SMU

Bioinformatics Professor

Guangzhou