<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Vitales | Miao Sun | 孙苗</title><link>https://cactusolo.github.io/tag/vitales/</link><atom:link href="https://cactusolo.github.io/tag/vitales/index.xml" rel="self" type="application/rss+xml"/><description>Vitales</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><copyright>© {2018-2026} Miao Sun</copyright><lastBuildDate>Sun, 06 Sep 2020 00:00:00 +0000</lastBuildDate><image><url>https://cactusolo.github.io/media/icon_huedaf1db70dd9a5ae8fb7d95bfd1a4abe_1318_512x512_fill_lanczos_center_3.png</url><title>Vitales</title><link>https://cactusolo.github.io/tag/vitales/</link></image><item><title>How to built a completely resolved species-level phylogeny using TCAT</title><link>https://cactusolo.github.io/post/tact/</link><pubDate>Sun, 06 Sep 2020 00:00:00 +0000</pubDate><guid>https://cactusolo.github.io/post/tact/</guid><description>&lt;p>Phylogenetic tree is a crucial reference system for biological research. It carries the key information for species diversification through geological time. A phylogeny tree with all members of a lineage presented is necessary for questions in macroecology and macroevolution. Hence, there are many comparative biological methods (e.g., diversification) integreated &amp;ldquo;sampling fractions&amp;rdquo; or other approches to correct sparsely sampled phylogenies of higher taxonomic groups. For example, &amp;ldquo;sampling fractions&amp;rdquo; in RPANDA (Morlon et al. 2016) and &amp;ldquo;global sampling fraction&amp;rdquo; and &amp;ldquo;clade-specific sampling fraction&amp;rdquo; in BAMM (Rabosky, 2014; Sun et al., 2020). However, this approach could lead to low statistical power to infer rate variation, or spurious patterns of diversification, which may further impact the evolutionary implication (Chang et al., 2019).&lt;br>
A new stochastic polytomy resolution method &amp;mdash; Taxonomic Addition for Complete Trees (TACT) is able to avoid the biases arised above, and also can greatly improve the power of estimation in diversification analyses (Chang et al., 2019). It uses birth–death-sampling model and taxonomic information to place unsampled taxa onto the ultrametric target backbone phylogeny. It produces a pseduposterior distribution of phylogenies, integrating diversification rates with phylogenetic uncertainty and speciation times, while this approach also can be labor and computation time intense as well as require topology constraint. Besides TACT, other stochastic polytomy resolvers, including PASTIS (Thomas et al., 2013) and CorSiM (Cusimano et al., 2012), but TACT performes better (See Chang et al., 2019).&lt;/p>
&lt;p>&lt;em>The caveats which researchers should pay attention is that complete phylogenies generared by stochastic polytomy resolvers should NOT be used for estimating the trait evolution. Because the way of how complete tree is generated, the true rate of trait evolution can be overestimated, and the phylogenetic signal is lost.&lt;/em>&lt;/p>
&lt;p>The Author &lt;a href="https://jonathanchang.org/" target="_blank" rel="noopener">Jonathan Chang&lt;/a> already has a detailed &lt;a href="https://github.com/jonchang/tact" target="_blank" rel="noopener">tutorial&lt;/a> of how to install and run TACT. Here I only focus on how to prepare a taxonomy list and built up pipeline for my own project.&lt;/p>
&lt;h2 id="general-steps">General steps&lt;/h2>
&lt;p>First thing first, you need two files to run TACT (assuming that you have successfully installed TACT and its dependencies):&lt;/p>
&lt;ol>
&lt;li>An ultrametric backbone phylogeny (e.g., &lt;em>Vitales_dated.tre&lt;/em>)&lt;/li>
&lt;li>A taxonomy of target clade&lt;/li>
&lt;/ol>
&lt;ul>
&lt;li>this can be taxonomy tree (see Chang et al., 2019)&lt;/li>
&lt;li>can also be a taxonomic list in csv format with all taxonomic ranks listed (e.g., genus, family, order; here as &lt;em>Vitales.csv&lt;/em>)&lt;/li>
&lt;/ul>
&lt;p>For the case in my post, I use &lt;a href="https://en.wikipedia.org/wiki/Vitaceae" target="_blank" rel="noopener">Vitales&lt;/a> as an example. The Vitales taxonomic list is generated from &lt;a href="http://www.plantsoftheworldonline.org" target="_blank" rel="noopener">WCSP website&lt;/a>, and the higher taxonomic ranks are queried from &lt;a href="http://www.mobot.org/MOBOT/research/APweb/" target="_blank" rel="noopener">APWeb&lt;/a>. The backbone tree was built using RAxML with molecular data mined from GenBank via &lt;a href="https://github.com/FePhyFoFum/PyPHLAWD" target="_blank" rel="noopener">PyPHLAWD&lt;/a>, and then dated using &lt;a href="https://github.com/blackrim/treePL" target="_blank" rel="noopener">treePL&lt;/a>.&lt;/p>
&lt;h3 id="1-prepare-a-taxonomic-list">1. Prepare a taxonomic list&lt;/h3>
&lt;ul>
&lt;li>A csv format&lt;/li>
&lt;li>All taxonomic ranks referenced from &lt;a href="http://www.mobot.org/MOBOT/research/APweb/" target="_blank" rel="noopener">APWeb&lt;/a>&lt;/li>
&lt;li>Columns layout as &lt;code>order,family,genus,genus.species&lt;/code>&lt;/li>
&lt;/ul>
&lt;pre>&lt;code class="language-{r"># devtools::install_github(&amp;quot;wcornwell/taxonlookup&amp;quot;)
rm(list=ls())
library(&amp;quot;taxonlookup&amp;quot;)
library(&amp;quot;ape&amp;quot;)
library(&amp;quot;dplyr&amp;quot;, warn.conflicts = FALSE, quietly = TRUE)
#read in the complete taxonomic list
Vitales &amp;lt;- read.csv(&amp;quot;Vitales_rawlist.csv&amp;quot;, header = T, stringsAsFactors = F)
# &amp;gt; head(Vitales)
# [1] &amp;quot;Acareosperma spireanum&amp;quot;
# [2] &amp;quot;Ampelocissus abyssinica&amp;quot;
# [3] &amp;quot;Ampelocissus acapulcensis&amp;quot;
# [4] &amp;quot;Ampelocissus acetosa&amp;quot;
# [5] &amp;quot;Ampelocissus aculeata&amp;quot;
# [6] &amp;quot;Ampelocissus africana var. migeodii&amp;quot;
# lookup APGWeb based on species names
Vitales.apg &amp;lt;- lookup_table(unique(Vitales), missing_action = &amp;quot;NA&amp;quot;, by_species=TRUE)
#just manual check if there are some genera are failed to have query
if(sum(is.na(Vitales.apg$family)) &amp;gt;0){
tt &amp;lt;- Vitales.apg[is.na(Vitales.apg$family),]
print(tt)
}
# rearrange columns as taxonomic ranks
APG_table &amp;lt;- Vitales.apg %&amp;gt;% mutate(genus.species=row.names(Vitales.apg)) %&amp;gt;% select(order, family, genus, genus.species)
#
#&amp;gt; head(APG_table)
#order family genus genus.species
#1 Vitales Vitaceae Acareosperma Acareosperma spireanum
#2 Vitales Vitaceae Ampelocissus Ampelocissus abyssinica
#3 Vitales Vitaceae Ampelocissus Ampelocissus acapulcensis
#4 Vitales Vitaceae Ampelocissus Ampelocissus acetosa
#5 Vitales Vitaceae Ampelocissus Ampelocissus aculeata
#6 Vitales Vitaceae Ampelocissus Ampelocissus africana var. migeodii
#replace space as underscore
APG_table$genus.species &amp;lt;- gsub(&amp;quot; &amp;quot;, &amp;quot;_&amp;quot;,APG_table$genus.species)
#save the apg lookup table, and prepare for next step TACT
write.csv(APG_table, &amp;quot;Vitales.csv&amp;quot;, row.names=FALSE, quote=FALSE)
&lt;/code>&lt;/pre>
&lt;h3 id="2-run-tact">2. Run TACT&lt;/h3>
&lt;pre>&lt;code class="language-{bash}">#Build a taxonomic tree
tact_build_taxonomic_tree Vitales.csv --output Vitales.taxonomy.tre
# this step adove can be skipped, if you already have a taxonomy tree
#Run the TACT stochastic polytomy resolver algorithm in conjunction with the backbone phylogeny
tact_add_taxa --backbone Vitales_dated.tre --taxonomy Vitales.taxonomy.tre --output Vitales.tacted --verbose
#check the TACT results
tact_check_results Vitales.tacted.newick.tre --backbone Vitales_dated.tre --taxonomy Vitales.taxonomy.tre &amp;gt; Vitales_checkresults.csv
&lt;/code>&lt;/pre>
&lt;h3 id="3-visualize-and-compare-trees">3. Visualize and compare trees&lt;/h3>
&lt;pre>&lt;code class="language-{r">library(&amp;quot;ape&amp;quot;)
tree1 &amp;lt;- ladderize(read.tree(&amp;quot;./Vitales_dated.tre&amp;quot;))
plot.phylo(tree1, cex=0.1, type = &amp;quot;fan&amp;quot;, main=&amp;quot;Backbone tree with NCBI data&amp;quot;)
&lt;/code>&lt;/pre>
&lt;p>This is the original backbone tree before TACT treatment&lt;br>
&lt;figure id="figure-vitales-backbone">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Vitales backbone" srcset="
/post/tact/Comparison_tree_before_after_TACT1.1_hufad7c4dbe500cf14c7ef7b7bde29f98d_336280_1f1ca3cd4eb8ccac536ec3f7fd11a118.jpg 400w,
/post/tact/Comparison_tree_before_after_TACT1.1_hufad7c4dbe500cf14c7ef7b7bde29f98d_336280_f17f0003925a3a0a8267a413026a2b25.jpg 760w,
/post/tact/Comparison_tree_before_after_TACT1.1_hufad7c4dbe500cf14c7ef7b7bde29f98d_336280_1200x1200_fit_q75_lanczos.jpg 1200w"
src="https://cactusolo.github.io/post/tact/Comparison_tree_before_after_TACT1.1_hufad7c4dbe500cf14c7ef7b7bde29f98d_336280_1f1ca3cd4eb8ccac536ec3f7fd11a118.jpg"
width="648"
height="760"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption data-pre="Figure&amp;nbsp;" data-post=":&amp;nbsp;" class="numbered">
Vitales backbone
&lt;/figcaption>&lt;/figure>&lt;/p>
&lt;p>Now we show which tips on the complete species-level tree are added by TACT:&lt;/p>
&lt;pre>&lt;code class="language-{r">tree2 &amp;lt;- ladderize(read.tree(&amp;quot;./Vitales.tacted.newick.tre&amp;quot;))
tip.cl &amp;lt;- ifelse(tree2$tip.label %in% tree1$tip.label, &amp;quot;black&amp;quot;, &amp;quot;red&amp;quot;)
plot.phylo(tree2, tip.color=tip.cl, cex=0.1, type = &amp;quot;fan&amp;quot;, main=&amp;quot;complete tree with NCBI + Taxonomic data&amp;quot;)
mtext(&amp;quot;Red tips are species added by TACT&amp;quot;, col = &amp;quot;red&amp;quot;, side=1, line=-5, outer=TRUE)
&lt;/code>&lt;/pre>
&lt;figure id="figure-vitales-tacted-tree1">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Vitales Tacted Tree1" srcset="
/post/tact/Comparison_tree_before_after_TACT1.2_hu2a02c5d5579fb2e0919de0db391b2868_392639_3b28b3f4b640f70831aa3d266c1cd5b1.jpg 400w,
/post/tact/Comparison_tree_before_after_TACT1.2_hu2a02c5d5579fb2e0919de0db391b2868_392639_15c528ba3f69957b904282dc56120b09.jpg 760w,
/post/tact/Comparison_tree_before_after_TACT1.2_hu2a02c5d5579fb2e0919de0db391b2868_392639_1200x1200_fit_q75_lanczos.jpg 1200w"
src="https://cactusolo.github.io/post/tact/Comparison_tree_before_after_TACT1.2_hu2a02c5d5579fb2e0919de0db391b2868_392639_3b28b3f4b640f70831aa3d266c1cd5b1.jpg"
width="760"
height="737"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption data-pre="Figure&amp;nbsp;" data-post=":&amp;nbsp;" class="numbered">
Vitales Tacted Tree1
&lt;/figcaption>&lt;/figure>
&lt;p>Last, We highlight which tree edges on the complete species-level tree are added by TACT:&lt;/p>
&lt;pre>&lt;code class="language-{r">library(&amp;quot;phytools&amp;quot;)
x &amp;lt;- setNames(ifelse(tree2$tip.label %in% tree1$tip.label, &amp;quot;0&amp;quot;, &amp;quot;1&amp;quot;), tree2$tip.label)
a &amp;lt;- names(x)[x==&amp;quot;0&amp;quot;]
b &amp;lt;- names(x)[x==&amp;quot;1&amp;quot;]
tt&amp;lt;-paintBranches(tree2,edge=sapply(b,match,tree2$tip.label),
state=&amp;quot;b&amp;quot;,anc.state=&amp;quot;a&amp;quot;)
cols&amp;lt;-setNames(c(&amp;quot;black&amp;quot;,&amp;quot;red&amp;quot;),c(&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;))
plot(tt, colors=cols, fsize=0.1, type=&amp;quot;fan&amp;quot;, lwd=0.5)
mtext(&amp;quot;Red branches are imputated by TACT&amp;quot;, col = &amp;quot;red&amp;quot;, side=3, line=-1.5, outer=TRUE)
&lt;/code>&lt;/pre>
&lt;figure id="figure-vitales-tacted-tree2">
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img alt="Vitales Tacted Tree2" srcset="
/post/tact/Comparison_tree_before_after_TACT2_hu84bbb56e77a9c0f5ec0d104572cf2055_577761_09c49b40610210cd6069a8b2146025f3.jpg 400w,
/post/tact/Comparison_tree_before_after_TACT2_hu84bbb56e77a9c0f5ec0d104572cf2055_577761_72a825ba76529e373eff48f0f836739d.jpg 760w,
/post/tact/Comparison_tree_before_after_TACT2_hu84bbb56e77a9c0f5ec0d104572cf2055_577761_1200x1200_fit_q75_lanczos.jpg 1200w"
src="https://cactusolo.github.io/post/tact/Comparison_tree_before_after_TACT2_hu84bbb56e77a9c0f5ec0d104572cf2055_577761_09c49b40610210cd6069a8b2146025f3.jpg"
width="745"
height="760"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;figcaption data-pre="Figure&amp;nbsp;" data-post=":&amp;nbsp;" class="numbered">
Vitales Tacted Tree2
&lt;/figcaption>&lt;/figure>
&lt;p>That&amp;rsquo;s it.&lt;/p>
&lt;h3 id="reference">Reference&lt;/h3>
&lt;ol>
&lt;li>Thomas G.H. et al. PASTIS: an R package to facilitate phylogenetic assembly with soft taxonomic inferences. Methods Ecol. Evol. 4:1011–1017 (2013).&lt;/li>
&lt;li>Chang et al. Estimating Diversification Rates on Incompletely Sampled Phylogenies: Theoretical Concerns and Practical Solutions. Syst. Biol. 69(3):602–611, 2020&lt;/li>
&lt;li>Cusimano N.et al. A new method for handling missing species in diversification analysis applicable to randomly or nonrandomly sampled phylogenies. Syst. Biol. 61:785–792 (2012).&lt;/li>
&lt;li>Morlon, H. et al. RPANDA: an R package for macroevolutionary analyses on phylogenetic trees. Methods Ecol. Evol. 7, 589–597 (2016).&lt;/li>
&lt;li>Rabosky, D. L. Automatic detection of key innovations, rate shifts, and
diversity-dependence on phylogenetic trees. PLoS ONE 9, e89543 (2014).&lt;/li>
&lt;li>Revell, J. L. Phytools: an R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol. 3, 217–223 (2012).&lt;/li>
&lt;li>Sun, M. et al. Estimating rates and patterns of diversification with incomplete sampling: A case study in the rosids. Am. J. Bot. 107, 1–15 (2020).&lt;/li>
&lt;/ol></description></item></channel></rss>