Blog Archives

convert graphic object to tree object using treeio

January 1, 2017
By
convert graphic object to tree object using treeio

I have splitted ggtree to 2 packages, treeio and ggtree. Now ggtree is mainly focus on visualization and annotation, while treeio focus on parsing and exporting tree files. Here is a welcome message from treeio that you can convert ggtree output to tree object which can be exported as newick or nexus file if you want. Thanks to ggplot2, output...

Read more »

dotplot for GSEA result

December 29, 2016
By
dotplot for GSEA result

For GSEA analysis, we are familar with the above figure which shows the running enrichment score. But for most of the software, it lack of visualization method to summarize the whole enrichment result. In DOSE (and related tools including clusterP...

Read more »

add layer to specific panel of facet_plot output

December 27, 2016
By
add layer to specific panel of facet_plot output

This is a question from ggtree google group: Dear ggtree team, how can I apply a geom_xxx to only one facet panel? For example if i want to get geom_hline(yintersect=1:30) or a geom_text() in the dot panel? I cant see the facet_grid(. ~ var) function call, so I don’t know which subsetting to use. I have already read http://stackoverflow.com/questions/29873155/geom-text-and-facets-not-working ...

Read more »

ggtree version of plotTree

December 16, 2016
By
ggtree version of plotTree

PLOTTING TREES + DATA is difficult. @DrKatHolt developed plotTree (R and Python scripts) to visualize associated data with trees, e.g. heatmap, horizontal bar etc. I reproduced the examples presented in the plotTree repo using ggtree. Source code is...

Read more »

Edge coloring with user data

December 11, 2016
By
Edge coloring with user data

Coloring edges in ggtree is quite easy, as we can map the color to numerical or categorical values via the aes(color=VAR) syntax. For user’s own data, it is also easy as ggtree provide the %<+% operator to attach user data. But as it seems not so obviously for ggtree users, see question 1, 2, and 3, I...

Read more »

scatterpie for plotting pies on ggplot

December 6, 2016
By
scatterpie for plotting pies on ggplot

Plotting pies on ggplot/ggmap is not an easy task, as ggplot2 doesn’t provide native pie geom. The pie we produced in ggplot2 is actually a barplot transform to polar coordination. This make it difficult if we want to produce a map like the above screenshot, which was posted by Tyler Rinker, the author of R package pacman.

Read more »

align genomic features with phylogenetic tree

November 15, 2016
By
align genomic features with phylogenetic tree

A question on biostars asking how to generate the following figure: This can be quite easy to implement in ggtree, I can write a geom layer to layout the alignment. As ggbio already provides many geom for genomic data and I don’t want to re-invent the wheel, I decided to try ggtree+ggbio. This is also...

Read more »

showCategory parameter for visualizing compareCluster output

November 2, 2016
By
showCategory parameter for visualizing compareCluster output

I am using dotplot() to visualize results from enrichGO(), enrichDO(), enricher() and compareCluster() in clusterProfiler R package. When specifying showCategory, I get the right number of categories except with the results of compareCluser(). In my case, I use compareCluster() on a list of 3 elements: str(ClusterList) List of 3 $ All : chr "89886" "29923" "100132891" "101410536" ... $ g1 ...

Read more »

xlim_tree: set x axis limits for only Tree panel

October 30, 2016
By
xlim_tree: set x axis limits for only Tree panel

A ggtree user recently asked me the following question in google group: I try to plot long tip labels in ggtree and usually adjust them using xlim(), however when creating a facet_plot xlim affects all plots and minimizes them. Is it possible to work around this and only affect the tree and it’s tip labels leaving the other plots...

Read more »

facet_plot: a general solution to associate data with phylogenetic tree

October 26, 2016
By
facet_plot: a general solution to associate data with phylogenetic tree

ggtree provides gheatmap for visualizing heatmap with phylogenetic tree and msaplot for visualizing multiple sequence alignment with phylogenetic tree. We may have different data types and want to visualize and align them with the tree. For example, dotplot of SNP site (e.g. using geom_point(shape='|')), barplot of trait values (e.g. using geom_barh(stat='identity')) et al. To make it easy to associate different...

Read more »

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)