Tag Archives: R

upsetplot in ChIPseeker

ChIPseeker is an R package for ChIP peak annotation, comparison and visualization.

We have implemented several visualization methods, including vennpie that was designed for viewing annotation overlap as shown below:

Not all overlap information can be demonstrated in vennpie. Upset is an effective way to visualize sets and intersections. We import upset function from UpSetR package and implement upsetplot function, that can visualize ChIP annotation overlap directly with output of annotatePeak.
Read more »

[paper published] ChIPseeker: an R/Bioconductor package for ChIP peak annotation, comparison and visualization

My R/Bioconductor package, ChIPseeker, published in Bioinformatics.

ChIPseeker had been cited by http://www.biomedcentral.com/1471-2164/16/292 and http://www.jbc.org/content/early/2015/06/18/jbc.M115.668558.short, and was used (not cited) in http://nar.oxfordjournals.org/content/early/2015/06/27/nar.gkv642.abstract and http://emboj.embopress.org/content/early/2014/12/18/embj.201490061.abstract.


ChIPseeker: an R/Bioconductor package for ChIP peak annotation, comparison and visualization
G Yu, LG Wang, QY He.
Bioinformatics 2015, 31(14):2382-2383
DOI: 10.1093/bioinformatics/btv145
Read more »

flip and rotate branches in ggtree

flip function is a feature request from ggtree user. It accepts a tree view and two node numbers and exchange the positions of the selected clades.

?View Code RSPLUS
1
2
3
4
5
require(ggtree)
set.seed(2015-07-01)
tr < - rtree(30)
p <- ggtree(tr) + geom_text(aes(label=node))
gridExtra::grid.arrange(p, flip(p, 38, 33), ncol=2)

It's chainable and all possible position adjustment can be achieved via multiple flip operations.
Read more »

dotplot for enrichment result

This is a feature request from clusterProfiler user. It's similar to what I implemented in clusterProfiler for comparing biological themes. For comparing different enrichment results, the x-axis represent different gene clusters while for a single enrichment result, the x-axis can be gene count or gene ratio. This is actually similar to traditional barplot, with dot position as bar height and dot color as bar color. But dotplot can represent one more feature nicely by dot size and it can be a good alternative to barplot.

?View Code RSPLUS
1
2
3
4
library(DOSE)
deg = names(geneList)[abs(geneList) > 1]
do = enrichDO(deg)
dotplot(do, showCategory=20)


Read more »

ggtree with funny fonts

showtext is a neat solution to use various types of fonts in R graphs and make it easy to use funny fonts.

With showtext, we can draw phylogenetic tree with different types of fonts even with symbolic/icon fonts.

?View Code RSPLUS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require(showtext)
 
font.add.google("Gochi Hand", "gochi")
font.add.google("Rock Salt", "rock")
 
link = "http://img.dafont.com/dl/?f=wm_people_1";
download.file(link, "wmpeople1.zip", mode = "wb");
unzip("wmpeople1.zip");
font.add("wmpeople1", "wmpeople1.TTF");
 
link = "http://img.dafont.com/dl/?f=emoticons";
download.file(link, "emoticons.zip", mode = "wb");
unzip("emoticons.zip");
font.add("emoticons", "emoticons.ttf");
 
 
showtext.auto()
set.seed(2015-05-14)
 
library(ggplot2)
library(ggtree)
 
tree < - rtree(30)
ggtree(tree, color="darkgreen") + geom_tiplab(family="gochi") + theme_classic() +
    theme(axis.text.x=element_text(size=rel(4), family="emoticons", color="firebrick")) +
        scale_y_continuous(breaks=seq(0, 30, 4), labels=letters[c(12:17, 20, 21)]) +
            theme(axis.text.y=element_text(size=rel(4), family="wmpeople1", color="#FDAC4F")) +
                annotate("text", x=2, y=18, label="Have fun with ggtree!",
                         family="rock", angle=30, size=12, color="steelblue")

Read more »

Page 1 of 30 1 2 3 4 5 6 7 8 ...Last »