虽然我不喜欢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

最新的一个问题,大致讲他有两个trait, A和B,想拿A来给label上色,B来画热图。

加载用户数据我们有%<+%操作符,热图有gheatmap函数。

我给了他一个简单的例子:

Continue reading

公号狗的福音

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

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

Continue reading

Virtual Network Computing (VNC) is a special way to remotely control a computer. Like Secure Shell (SSH), a computer user can login to a remote machine on the network and execute commands and access files on the system. However, VNC displays the remote system’s desktop while SSH displays a terminal shell. It may be beneficial to learn more about VNC and similar technologies.

Continue reading

来自R的桌面提醒

notifier包实现了跨平台的桌面提醒功能,当然它是调用了外部的命令,比如windows使用了toaster,老版本windows使用的是notifu,在linux下使用notify-send,而在OSX下,则调用了terminal-notifier,通过了简单的封装之后,就可以给桌面发布消息提醒了。

比如:

library(notifier)
notify(
  title = "15 Packages out of date",
  msg = c("You can run update.packages() to update them.",
  "Outdated packages: Boom colorspace desc memuse networkD3",
  "pbapply revealjs rgl rmdformats timevis and 5 more")
)

​ 效果如下:

Continue reading

导言

本文介绍了ggimage包,允许在ggplot2作图时嵌入图片,并支持aes映射,可以把离散型变量映射到不同图片。目前有几个包可以使用图片嵌入做图,但都是针对特定的场景,这里使用ggimage来展示在这些特定领域里的应用,ggimage的设计是通用的,并不被特定场景所限定,文末又介绍了用R图标来画出R、用饼图来画气泡图等实例。

图上嵌图片

R 基础图形库(base graphics)可以在做图的时候嵌入图片,使用的是graphics::rasterImage

imgurl <- "http://phylopic.org/assets/images/submissions/295cd9f7-eef2-441e-ba7e-40c772ca7611.256.png"
library(EBImage)
x <- readImage(imgurl)
plot(1, type = "n", xlab = "", ylab = "", xlim = c(0, 8), ylim = c(0, 8))
rasterImage(x, 2, 2, 6, 4)

R绘图嵌入图片演示

Continue reading

Author's picture

Guangchuang Yu

a senior-in-age-but-not-senior-in-knowledge bioinformatician

Postdoc researcher

Hong Kong