ggtree supports phylip tree format

Phylip is also a widely used tree format, which contains taxa sequences with Newick tree text. In ggtree, we can use read.phylip() function to parse the file and use ggtree() to visualize the tree. library(ggtree) phyfile <- system.file("extdata", "sample.phy", package="ggtree") phylip <- read.phylip(phyfile) phylip ## 'phylip' S4 object that stored information of ## '/Users/guangchuangyu/Library/R/3.2/library/ggtree/extdata/sample.phy'. ## ## ...@ tree: ## Phylogenetic tree with 15 tips and 13 internal nodes. ## ## Tip labels: ## K, N, D, L, J, G, ... Read On →

label edge number in ggtree

This is a question from ggtree user. In ape and phytools, it’s easy to label edge using the edgelabels function. set.seed(1) tr = rtree(30) library(ape) plot(tr, main="ape") edgelabels() I don’t see any necessity to label edge numbers, as they are meaningless. The number is labeled as the row index of tr$edge, and edge can be uniquely mapped to child node. If we need to relate something to edge, we can relate them to corresponding child node. Read On →

Annotate a phylogenetic tree with insets

ggtree implemented a function, subview, that can add subplots on a ggplot2 object. It had successful applied to plot pie graphs on map. set.seed(2016-01-04) tr <- rtree(30) tr <- groupClade(tr, node=45) p <- ggtree(tr, aes(color=group)) + geom_tippoint() cpos <- get_clade_position(p, node=45) p1 <- p + geom_hilight(node=45) p2 <- with(cpos, p+xlim(xmin, xmax*1.01)+ylim(ymin, ymax)) with(cpos, subview(p2+geom_tiplab(), p1+theme_transparent(), x=xmin+(xmax-xmin)*.15, y=ymin+(ymax-ymin)*.85)) To make it more easy to use subview function for annotating taxa with subplots, ggtree provides a function, inset, for adding subplots to a phylogenetic tree. Read On →

GO analysis using clusterProfiler

clusterProfiler supports over-representation test and gene set enrichment analysis of Gene Ontology. It supports GO annotation from OrgDb object, GMT file and user’s own data. support many species In github version of clusterProfiler, enrichGO and gseGO functions removed the parameter organism and add another parameter OrgDb, so that any species that have OrgDb object available can be analyzed in clusterProfiler. Bioconductor have already provide OrgDb for about 20 species, see http://bioconductor.org/packages/release/BiocViews.html#___OrgDb, and users can build OrgDb via AnnotationHub. Read On →

News of ggtree

A new version of ggtree that works with ggplot2 (version >= 2.0.0) is now availabel. new layers Some functions, add_legend, hilight, annotation_clade and annotation_clade2 were removed. Instead we provide layer functions, geom_treescale, geom_hilight and geom_cladelabel. You can use + operator to add layers using these layer functions. In addtion, we provide geom_point2, geom_text2 and geom_segment2 which works exactly as geom_point, geom_text and geom_segment except they allow ggtree users to do subsetting. Read On →

use emoji font in R

I have played with emoji in R for a while. My solution of using it is different from what implemented in emoGG. emoGG is a good attemp to add emoji in ggplot2. It render emoji picture (png) and creat a layer, geom_emoji, to add emoji. In my opinion, emoji should be treated as ordinary font in user interface, albeit it maynot be true internally. It would be more flexible if we can use emoji as ordinary font and in this way user don’t need to learn extra stuff. Read On →

喜新厌旧之hello Hugo

Installation 安装hugo对于Mac用户来说,太容易,brew大法搞定。 brew install hubo MathJax support 把下面的代码: <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> 加入到文件themes/hyde-x/layouts/partials/foot.html中,就可以实现$\LaTeX$公式的解析。 migrate wordpress to hugo Disqus Comment System plugin 点击Export comments to Disqus搞定 convert Wordpress posts to markdown files 试用了多个插件或脚本,都是各种出错。最后发现了神器potter-wordpress,通过npm安装: npm install -g pottercms-wordpress 然后一个语句: potter-wordpress -h WORDPRESS_SITE_URL -u USER_NAME -p PASSWORD --dir PATH_TO_STORE_MD_FILES 自动从线上把posts抓下来,并转化为markdown。在之前各种搞不定之后,看到下面的输出有种莫名的快感。 Fetching articles... Got : [Sun Nov 29 2015] R kernel in Jupyter notebook 3 Got : [Mon Nov 09 2015] phylomoji with ggtree Got : [Tue Nov 17 2015] 合体中的操作系统 Got : [Mon Nov 02 2015] Comparison of clusterProfiler and GSEA-P Got : [Thu Oct 01 2015] ChIPseq data mining with ChIPseeker Got : [Tue Oct 06 2015] TRIE Got : [Thu Oct 15 2015] [BioC 3.2] NEWS of my BioC packages Got : [Wed Oct 21 2015] use simplify to remove redundancy of enriched GO terms ... Read On →

R kernel in Jupyter notebook 3

I followed the post, Installing an R kernel for IPython/jupyter notebook 3 on OSX, to install jupyter with python3 and R kernels in my iMac. I have elementaryOS on my Macbook Pro and also want to have jupyter on it. The installation process is quite similar. Install Jupyter sudo apt-get install python3-pip sudo pip3 install jupyter Then we can use the following command to start jupyter: ipython notebook Install IRkernel To compile IRkernel, we should firstly have zmq lib installed. Read On →

合体中的操作系统

更新EI Capitan已经近一个月,第一感觉就是明显变慢了。这是去年买的27’ iMac,必须不慢。MS office程序可以打开,但打开文档直接闪退。升级安装总会有些问题,就像我去年在笔记本上升级yosemite一样,最后两分钟始终过不去,迫使我全新安装,当时我看后台记录就发现了是MacTex拷不过去,后来MacTex的网站上也写了升级Yosemite有这个问题。升级有些小问题是可以预见的,但很少有像EI Capitan这么多的问题。 Macworld EI Capitan review文章中有人这样评论: haha nice review ! did you tried the update ?? slow connection safari freezes on launch outlook crash printer does not work anymore great job from Apple . My confidence in Apple has been seriously dented! 最不可思议的是开发者发现升级后开发工具都有问题了: Last night I installed OSX’s new “El Capitain” update, and it broke most of the tools I use in my daily life as a developer, including homebrew and git. Read On →

Comparison of clusterProfiler and GSEA-P

Thanks @mevers for raising the issue to me and his efforts in benchmarking clusterProfiler. He pointed out two issues: outputs from gseGO and GSEA-P are poorly overlap. pvalues from gseGO are generally smaller and don’t show a lot of variation For GSEA analysis, we have two inputs, a ranked gene list and gene set collections. First of all, the gene set collections are very different. The GMT file used in his test is c5.cc.v5.0.symbols.gmt, which is a tiny subset of GO CC, while clusterProfiler used the whole GO CC corpus. Read On →