Category Archives: Biology

embeding a subplot in ggplot via subview

I implemented a function, subview, in ggtree that make it easy to embed a subplot in ggplot.

An example is shown below:

?View Code RSPLUS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
library(ggplot2)
library(ggtree)
 
dd < - data.frame(x=LETTERS[1:3], y=1:3)
pie <- ggplot(dd, aes(x=1, y, fill=x)) + 
             geom_bar(stat="identity", width=1) + 
                    coord_polar(theta="y") + theme_tree() + 
                          xlab(NULL) + ylab(NULL) + 
                               theme_transparent()
 
x <- sample(2:9)
y <- sample(2:9)
width <- sample(seq(0.05, 0.15, length.out=length(x)))
height <- width
 
p <- ggplot(data=data.frame(x=c(0, 10), y=c(0, 10)), aes(x, y))+geom_blank()
print(p)
for (i in seq_along(x)) {
    p %<>% subview(pie, x[i], y[i], width[i], height[i])
    print(p)
}

Read more »

functional enrichment analysis with NGS data

I found a Bioconductor package, seq2pathway, that can apply functional analysis to NGS data. It consists of two components, seq2gene and gene2pathway. seq2gene converts genomic coordination to genes while gene2pathway performs functional analysis at gene level.

I think it would be interesting to incorporate seq2gene with clusterProfiler. But it fail to run due to it call absolute path of python installed in the author's computer.


Read more »

functional enrichment for GTEx paper

The ENCODE consortium has recently published a great paper on Gene Expression from the GTEx dataset. A criticism raised on pubpeer is that the gene ontology enrichment analysis was done with DAVID which has not been updated in the last five years.

The result is shown below:

It would be interest to see if results change by using clusterProfiler to reproduce GO & KEGG analyses.
Read more »

parsing BED coordinates

In supplemental file of ChIPseeker paper, I compare distances to TSS reported by several ChIP annotation software, including ChIPseeker, ChIPpeakAnno, HOMER and PeakAnalyzer.

Although I found that the chromStart positions in HOMER output have a +1 shift compare to other software, I did not realize this issue since all other software are consistent.

Until recently, I found BAM, BCF, BED and PSL formats are using the 0-based coordinate system, while SAM, VCF, GFF and Wiggle formats are using the 1-based coordinate system.

For BED file format, we can refer to http://asia.ensembl.org/info/website/upload/bed.html.
Read more »

[ggtree] annotate phylogenetic tree with local images

In ggtree, we provide a function annotation_image for annotating phylogenetic tree with images.
Read more »

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