<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/ggtree-version-of-plottree/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://guangchuangyu.github.io/2016/12/ggtree-version-of-plottree"> R on Guangchuang YU</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><a target="_blank" rel="nofollow" href="https://holtlab.net/2015/10/03/plotting-trees-data/">PLOTTING TREES + DATA</a> is difficult. <a target="_blank" rel="nofollow" href="http://holtlab.net/">@DrKatHolt</a> developed <a target="_blank" rel="nofollow" href="https://github.com/katholt/plotTree">plotTree</a> (R and Python scripts) to visualize associated data with trees, <em>e.g.</em> heatmap, horizontal bar <em>etc</em>.</p>
<p>I reproduced the examples presented in the <a target="_blank" rel="nofollow" href="https://github.com/katholt/plotTree">plotTree</a> repo using <a target="_blank" rel="nofollow" href="https://guangchuangyu.github.io/">ggtree</a>. Source code is freely available in <a target="_blank" rel="nofollow" href="https://github.com/GuangchuangYu/plotTree-ggtree">https://github.com/GuangchuangYu/plotTree-ggtree</a>.</p>
<p>Here are the outputs produced by <code>ggtree</code>:</p>
<h3>Tree with basic strain info</h3>
<p><img alt="" src="https://i0.wp.com/github.com/GuangchuangYu/plotTree-ggtree/raw/master/README_files/figure-markdown_strict/unnamed-chunk-1-1.png?w=456&ssl=1" data-recalc-dims="1"></p>
<h3>Pan genome heatmap</h3>
<p><img alt="" src="https://i1.wp.com/github.com/GuangchuangYu/plotTree-ggtree/raw/master/README_files/figure-markdown_strict/unnamed-chunk-2-1.png?w=456&ssl=1" data-recalc-dims="1"></p>
<h3>Curated genes, coloured</h3>
<p><img alt="" src="https://i1.wp.com/github.com/GuangchuangYu/plotTree-ggtree/raw/master/README_files/figure-markdown_strict/unnamed-chunk-3-1.png?w=456&ssl=1" data-recalc-dims="1"></p>
<p>It can be very easy to produce a circular/fan layout version, and the tree was used to generate the ggtree hex sticker.</p>
<p><img alt="" src="https://i1.wp.com/github.com/GuangchuangYu/ggtree/raw/master/logo.png?w=456&ssl=1" data-recalc-dims="1"></p>
<h3>General solution with <code>facet_plot</code></h3>
<p><code>ggtree</code> provide the <code>facet_plot</code> function which can be used to associate different types of data to the tree. With <code>ggtree</code> we can associate more data (can be different types) and combine them freely.</p>
<p><img alt="" src="https://i1.wp.com/github.com/GuangchuangYu/plotTree-ggtree/raw/master/README_files/figure-markdown_strict/unnamed-chunk-4-1.png?w=456&ssl=1" data-recalc-dims="1"></p>
<p><img alt="" src="https://i2.wp.com/guangchuangyu.github.io/blog_images/Bioconductor/ggtree/facet_plot_bar2.png?w=456&ssl=1" data-recalc-dims="1"></p>
<p><img alt="" src="https://i0.wp.com/guangchuangyu.github.io/blog_images/Bioconductor/ggtree/ggtree_ggbio/ggtree_ggbio.png?w=456&ssl=1" data-recalc-dims="1"></p>
<p>see also examples in <a target="_blank" rel="nofollow" href="http://guangchuangyu.github.io/2016/10/facet_plot-a-general-solution-to-associate-data-with-phylogenetic-tree/">1</a> and <a target="_blank" rel="nofollow" href="http://guangchuangyu.github.io/2016/11/align-genomic-features-with-phylogenetic-tree/">2</a>.</p>
<h2>Citation</h2>
<p><strong>G Yu</strong>, DK Smith, H Zhu, Y Guan, TTY Lam<sup>*</sup>. <a target="_blank" rel="nofollow" href="http://onlinelibrary.wiley.com/doi/10.1111/2041-210X.12628/abstract">ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data</a>. <strong><em>Methods in Ecology and Evolution</em></strong>. <a target="_blank" rel="nofollow" href="http://dx.doi.org/10.1111/2041-210X.12628"><code>doi:10.1111/2041-210X.12628</code></a>.</p>
<p></p>
<div data-badge-popover="right" data-doi="10.1111/2041-210X.12628" data-badge-type="donut"></div>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://guangchuangyu.github.io/2016/12/ggtree-version-of-plottree"> R on Guangchuang YU</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/3iMo-LJBasg"></a></div>