<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ASTRAL | Miao Sun | 孙苗</title><link>https://cactusolo.github.io/tag/astral/</link><atom:link href="https://cactusolo.github.io/tag/astral/index.xml" rel="self" type="application/rss+xml"/><description>ASTRAL</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><copyright>© {2018-2026} Miao Sun</copyright><lastBuildDate>Sun, 27 Oct 2019 00:00:00 +0000</lastBuildDate><image><url>https://cactusolo.github.io/media/icon_huedaf1db70dd9a5ae8fb7d95bfd1a4abe_1318_512x512_fill_lanczos_center_3.png</url><title>ASTRAL</title><link>https://cactusolo.github.io/tag/astral/</link></image><item><title>Demonstrating gene tree conflict with Phyparts Piecharts</title><link>https://cactusolo.github.io/post/phypartspiecharts/</link><pubDate>Sun, 27 Oct 2019 00:00:00 +0000</pubDate><guid>https://cactusolo.github.io/post/phypartspiecharts/</guid><description>&lt;p>&lt;em>We have marched into genome era already, especially using biparental inherited nuclear genome data to examine the framework of tree of life established by plastid data. However, not all gene trees tell one same story, even the most homogeneous genes from plastid organelle. Not to mention nuclear genes may have more than one copy, and other potential biological processes (e.g., hybridization, incomplete lineage sorting (ILS), or horizontal gene transfer, etc); also see &lt;a href="https://cactusolo.github.io/publication/sun2015com/">Sun et al. (2015)&lt;/a>. Hence, &lt;a href="https://bmcevolbiol.biomedcentral.com/articles/10.1186/s12862-015-0423-0" target="_blank" rel="noopener">Smith et al. (2015)&lt;/a> did a great job in summarizing current situation, and setting examples of visualization of concordance information in animals and plants genomic phylogenies. They also developed an open source java software to do this job &amp;mdash; &lt;a href="https://bitbucket.org/blackrim/phyparts" target="_blank" rel="noopener">phyparts&lt;/a>.&lt;/em>&lt;/p>
&lt;p>In this post I will use &lt;em>Sassafras&lt;/em> 322 gene trees as an example to show you how to use &lt;a href="https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-018-2129-y" target="_blank" rel="noopener">ASTRAL-III&lt;/a> to estimate a species tree, and &lt;a href="https://bitbucket.org/blackrim/phyparts" target="_blank" rel="noopener">phyparts&lt;/a> to summarize the conflict and concordance information of those individual homologous gene regions, and finally using &lt;a href="https://github.com/mossmatters/MJPythonNotebooks/blob/master/PhyParts_PieCharts.ipynb" target="_blank" rel="noopener">PhyParts PieCharts&lt;/a> to visualize the Phyparts Output. These data was generated by Target Enrichment method using &lt;a href="https://academic.oup.com/sysbio/article/68/4/594/5237557" target="_blank" rel="noopener">Universal Probe Set for Targeted Sequencing of 353 Nuclear Genes&lt;/a> under &lt;a href="https://cactusolo.github.io/project/dimensions/">Dimension project&lt;/a>. My other relevant workingflow and scripts are available &lt;a href="https://github.com/Cactusolo/IESHTSTE" target="_blank" rel="noopener">here&lt;/a>.&lt;/p>
&lt;p>&lt;em>Note: &lt;a href="https://github.com/mossmatters/MJPythonNotebooks/blob/master/PhyParts_PieCharts.ipynb" target="_blank" rel="noopener">Matt Johnson&lt;/a> has a great tutorial of how to run his script using Jupyter Notebook. The interpretation of PieCharts is well explained as well.&lt;/em>&lt;/p>
&lt;p>My instructions here focus on the overall procedures from gene trees all the way down to the Pie chart. Hopefully, I&amp;rsquo;m able to integrate all the steps together into one pipeline.&lt;/p>
&lt;h2 id="general-steps">General steps&lt;/h2>
&lt;p>&lt;em>Here we need to assess how a number of gene trees how they agree with ours pecies tree, and displaying this discordance and agreeent information with satisfying visualization.&lt;/em>&lt;/p>
&lt;h3 id="1-building-phylogeny-so-that-we-have-all-gene-trees">1. Building phylogeny, so that we have all gene trees&lt;/h3>
&lt;ul>
&lt;li>
&lt;p>My data was generated from 353 target enrichment method&lt;/p>
&lt;/li>
&lt;li>
&lt;p>I used 322 gene trees from &lt;em>Sassafras&lt;/em> samples as example&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Note:&lt;/p>
&lt;ul>
&lt;li>All trees were rooted by either &lt;a href="https://github.com/FePhyFoFum/phyx" target="_blank" rel="noopener">phyx&lt;/a> or &lt;a href="https://github.com/tjunier/newick_utils/wiki" target="_blank" rel="noopener">The Newick Utilities&lt;/a>, or &lt;a href="https://pypi.org/project/DendroPy/" target="_blank" rel="noopener">DendroPy&lt;/a>&lt;/li>
&lt;li>Though &lt;a href="https://github.com/smirarab/ASTRAL/blob/master/astral-tutorial.md#running-with-unresolved-gene-trees" target="_blank" rel="noopener">ASTRAL&lt;/a> is able to take any gene trees rooted or unrooted, however, for downstream Phyparts performance, rooted trees are preferred. Such so all gene trees and species trees are towards to the same root direction (See &lt;a href="https://github.com/mossmatters/MJPythonNotebooks/blob/master/PhyParts_PieCharts.ipynb" target="_blank" rel="noopener">Matt Johnson&amp;rsquo;s post&lt;/a>).&lt;/li>
&lt;li>As quote in &lt;a href="https://github.com/smirarab/ASTRAL/blob/master/astral-tutorial.md#running-with-unresolved-gene-trees" target="_blank" rel="noopener">ASTRAL tutorial&lt;/a>:&lt;br>
&lt;em>&amp;ldquo;Importantly, we will reroot the tree at the correct node, which is always necessary, since the rooting of the ASTRAL trees is arbitrary and meaningless.&amp;quot;&lt;/em>&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Therefore, rooting all the trees (species tree and gene trees) is preferred for Phyparts Piecharts. Sometimes, when you have hundreds of gene trees, however, not all outgroups presented in your gene tree; in these case, I recommend either use &lt;code>pxrr&lt;/code> function from &lt;a href="https://github.com/FePhyFoFum/phyx" target="_blank" rel="noopener">phyx&lt;/a>, or &lt;a href="https://www.nature.com/articles/s41559-017-0193" target="_blank" rel="noopener">MAD (root the tree by Minimal Ancestor Deviation)&lt;/a>; the latter works well with those trees without outgroups at all; for details see my other post &lt;a href="https://cactusolo.github.io/post/mad/check-the-performance-of-a-rooting-method-using-minimal-ancestor-deviation-mad/">here&lt;/a>&lt;/strong>&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h3 id="2-species-tree-estimation">2. Species tree estimation&lt;/h3>
&lt;ul>
&lt;li>
&lt;p>Species tree was estimated by &lt;a href="https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-018-2129-y" target="_blank" rel="noopener">ASTRAL-III&lt;/a>, and see tutorials &lt;a href="https://github.com/smirarab/ASTRAL/blob/master/astral-tutorial.md#running-on-the-sample-mammalian-dataset" target="_blank" rel="noopener">here&lt;/a>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Note:&lt;/strong> Collapse gene tree nodes with BS support less than certain value (saying 10%; see cmd below), will help to improve accuracy; sometime increasing the threshold for collapse may yield better results.&lt;br>
There are many ways to do this: &lt;a href="https://github.com/FePhyFoFum/phyx" target="_blank" rel="noopener">phyx&lt;/a> or &lt;a href="https://github.com/tjunier/newick_utils/wiki" target="_blank" rel="noopener">The Newick Utilities&lt;/a>&lt;/p>
&lt;ul>
&lt;li>using The Newick Utilities as example from &lt;a href="https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-018-2129-y" target="_blank" rel="noopener">ASTRAL-III tutorial&lt;/a>
e.g., &lt;code>nw_ed 1KP-genetrees.tre 'i &amp;amp; b&amp;lt;=10' o &amp;gt; 1KP-genetrees-BS10.tre&lt;/code>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>ASTRAL &lt;strong>CMD&lt;/strong>:&lt;br>
&lt;code>java -jar astral.5.6.3.jar -i collapse_genetrees.tre -o output_species_tree.tre 2&amp;gt; running.log&lt;/code>&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h3 id="3-statistic-information-about-conflict-concordance-or-even-gene-duplications">3. Statistic information about conflict, concordance, or even gene duplications&lt;/h3>
&lt;ul>
&lt;li>You need to run &lt;a href="https://bitbucket.org/blackrim/phyparts/src/master/" target="_blank" rel="noopener">phyparts&lt;/a> with instruction on the repo webpage.&lt;/li>
&lt;li>Phyparts &amp;ldquo;conflict&amp;rdquo; option &lt;strong>CMD&lt;/strong>:&lt;br>
&lt;code>java -jar target/phyparts-0.0.1-SNAPSHOT-jar-with-dependencies.jar -a 1 -v -d gene_trees -m ASTRAL_species_tree -o output_name&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>&lt;em>Note:&lt;/em> run cmd below, you&amp;rsquo;ll able to see all the Phyparts options (see snapshot below):&lt;br>
&lt;code>java -jar target/phyparts-0.0.1-SNAPSHOT-jar-with-dependencies.jar&lt;/code>&lt;/p>
&lt;figure >
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="" srcset="
/post/phypartspiecharts/phyparts_option_hubaae0ff782c8b75f8b806f4834290463_185587_3da90889fd6d88a9ba7c81d286051f4b.jpg 400w,
/post/phypartspiecharts/phyparts_option_hubaae0ff782c8b75f8b806f4834290463_185587_75712de886d9bb4c3c345117e6bb0c91.jpg 760w,
/post/phypartspiecharts/phyparts_option_hubaae0ff782c8b75f8b806f4834290463_185587_1200x1200_fit_q75_lanczos.jpg 1200w"
src="https://cactusolo.github.io/post/phypartspiecharts/phyparts_option_hubaae0ff782c8b75f8b806f4834290463_185587_3da90889fd6d88a9ba7c81d286051f4b.jpg"
width="760"
height="227"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;h3 id="4-mapping-these-information-on-species-tree">4. Mapping these information on species tree&lt;/h3>
&lt;ul>
&lt;li>You need &lt;strong>PhyParts PieCharts&lt;/strong> &lt;a href="https://github.com/mossmatters/phyloscripts/tree/master/phypartspiecharts" target="_blank" rel="noopener">python script&lt;/a> and tutorial from &lt;a href="https://github.com/mossmatters/MJPythonNotebooks/blob/master/PhyParts_PieCharts.ipynb" target="_blank" rel="noopener">Matt Johnson&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>&lt;em>Note: Please read the tutorial, &lt;strong>Python &amp;gt;2.7 and ETE3&lt;/strong> with the graphical options need to be installed before run the python script&lt;/em>&lt;/p>
&lt;ul>
&lt;li>how to run script:&lt;br>
&lt;code>python3 phypartspiecharts.py species_tree output_name gene_number&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>&lt;em>Note: &lt;code>output_name&lt;/code> must be the same as you names at the &lt;code>phyparts (# 3)&lt;/code> step&lt;/em>&lt;/p>
&lt;h3 id="5-visualize-the-gene-tree-support-and-conflic-statics-with-piecharts">5. Visualize the gene tree support and conflic statics with Piecharts&lt;/h3>
&lt;ul>
&lt;li>
&lt;p>the output format of PhyParts PieCharts is in &lt;code>svg&lt;/code>, then you need to Inkscape or AI to convert it as &lt;code>pdf&lt;/code>. You also can refine the overall layout of that plot.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Note: make sure Python3, ETE3, and &lt;a href="https://kovyrin.net/2007/10/01/how-to-run-gui-programs-on-a-server-without-any-monitor/" target="_blank" rel="noopener">X server&lt;/a> installed.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;p>As my plot below:&lt;/p>
&lt;figure >
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="" srcset="
/post/phypartspiecharts/featured_hud8fe575bf066501c365d16a7a2def1ba_187002_788fed679003fb238a1f418cdf584b3d.jpg 400w,
/post/phypartspiecharts/featured_hud8fe575bf066501c365d16a7a2def1ba_187002_a6a6630e701b8c712d8c30633b883f27.jpg 760w,
/post/phypartspiecharts/featured_hud8fe575bf066501c365d16a7a2def1ba_187002_1200x1200_fit_q75_lanczos.jpg 1200w"
src="https://cactusolo.github.io/post/phypartspiecharts/featured_hud8fe575bf066501c365d16a7a2def1ba_187002_788fed679003fb238a1f418cdf584b3d.jpg"
width="760"
height="269"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;p>Last updated: Mon Dec 7 2020&lt;/p></description></item></channel></rss>