With ggtree (Yu et al. 2017), it is very easy to create phylomoji. Emoji is internally supported by ggtree.

Use emoji in taxa labels

library(ggtree)
tree_text <- "(((((cow, (whale, dolphin)), (pig2, boar)), camel), fish), seedling);"
x <- read.tree(text=tree_text)
ggtree(x, linetype="dashed", color='firebrick') +
    xlim(NA, 7) + ylim(NA, 8.5) +
    geom_tiplab(aes(color=label), parse='emoji', size=14, vjust=0.25) +
    labs(title="phylomoji", caption="powered by ggtree + emojifont")

Continue reading

虽然我不喜欢DAVID,但很多用户喜欢,所以clusterProfiler也支持了,最近github上又有人要求支持自定义背景

Dear Guangchuang,

I am using clusterProfiler in Kegg pathway enrichment analysis, it is useful and nice. I am looking for a function which accept background and has ability to deal with Ensembl gene ID.

In a function enrichDAVID it can takes ensembl gene id as an input format, but not allows to enter background. enrichDAVID(gene = gene, idType="ENSEMBL_GENE_ID", annotation="KEGG_PATHWAY", species= "hsa")

Other command enrichKEGG has a background input but only takes entrez gene id, enrichKEGG(gene, organism = "hsa", keyType = "kegg", universe)

I have tried to convert my ensembl gene IDs to entrez gene id, but some ensembl gene IDs represent more than one entrez gene ID. I downloaded KEGG pathway dataset to apply fisher exact test. however, genes are in entrez ID and i am still dont know how to convert.

Continue reading

想要分段标记bootstrap,比如0-70, 70-90, 90-100之类的。这个对于ggtree来说,太简单。

首先我们要读树,用treeioread.newick,它和read.tree的不同之处是,加入了参数node.label,当node.label存的不是label,而是bootstrap等数字型的时候,你可以传入node.label='support',这样它会把node label解析为support value,另存为树注释数据,而不是和tip label混在一起。label变量只能存为字符型,因为和tip label混了,而字符型会让数字操作稍微复杂点。所以我们要用read.newick

tree <- read.newick("RMI.phy_phyml_tree_rooted_labeled.txt", node.label='support')
root <- getRoot(tree@phylo)

p <- ggtree(tree, color="black", size=1.5, linetype=1,  ladderize=TRUE) + 
     ggtitle(label="Figure A") + 
    geom_tiplab(size=4.5, hjust = -0.060, fontface="bold") +  xlim(0, 0.09)

Continue reading

公号狗的福音

苹果和企鹅分赃没谈好,反正林子大了,就不顾小鸟的死活!取消了iOS的赞赏功能,一个个觉得错过了一个亿,我真不知道原来你们的赞赏有这么多!我半年来得到的还不够我的日薪多。虽然少得可怜,但我还是及时地在当天给出方案来吸引眼球,创作了一个绿色的赞赏按纽。

我的文章排版都是markdown,markdown是外部驱动的,要什么效果,CSS话事。这个赞赏按纽无非是个链接,赞赏二字链接到转帐二维码,而要实现按纽的效果,可以专门定义一个style来实现。

Continue reading

Author's picture

Guangchuang Yu

Bioinformatics Professor @ SMU

Bioinformatics Professor

Guangzhou