description
astral是基于java開發(fā)的根據(jù)一組無根的genetrees建立speciestree。
tutorial steps
installation
運(yùn)行astral不需要安裝,但是需要在java環(huán)境下運(yùn)行。
命令行運(yùn)行astral
astral沒有圖形界面,需要在命令行下運(yùn)行。
java -jar astral.5.5.1.jar
運(yùn)行后可以看到astral的options。如果運(yùn)行沒有錯(cuò)誤,說明安裝成功了。
用astral運(yùn)行一個(gè)簡單的數(shù)據(jù)
java -jar astral.5.5.1.jar -i test_data/song_mmammals.424.gene.tre
-o 輸出
java -jar astral.5.5.1.jar -i test_data/song_mmammals.424.gene.tre -o test_data/song_mammals.tre
輸入文件是含有所有g(shù)enetrees的Newick格式的文件。輸入的genetree被當(dāng)做unrooted tree,不管他們是否有根。astral的輸出也是被當(dāng)做unrooted tree。輸入的genetree支持多分支。
astral 結(jié)果查看
輸出的結(jié)果是Newick格式,可以用很多軟件查看。
branch length and support
astral測量branch length 是用coalscent units。不是我們通常認(rèn)為的boostrap value
1.astral 只測量internal branches 不測量terminal branches
2.branch lengthes 是直接測量genetree的不一致性,有可能因?yàn)榻y(tǒng)計(jì)噪音被低估。
3.support value 測量quadriparition的support而不是通常的bipartion(二分位)。(astral 認(rèn)為自己的support value 比boostrap value 可信度更高。)
scoring a species tree
-q參數(shù)
得到的是quartet score 和branch length 和 branch support values。0.9表示genetree產(chǎn)生的quartet tree的90%存在于species tree中。為樹打分的命令如下:
java -jar astral.5.6.3.jar -q test_data/simulated_14taxon.default.tre -i test_data/simulated_14taxon.gene.tre -o test_data/simulated_scored.tre 2> test_data/simulated_scored.log
與simulated_14taxon.gene.tre進(jìn)行比較后,會為物種樹simulated_14taxon.default.tre打分。

表示來自genetree的4803個(gè)quartet trees存在于species trees中。4803個(gè)quartet trees占所有的quartet trees的47.98%。這個(gè)數(shù)據(jù)集的ILS水平很高。導(dǎo)致這個(gè)結(jié)果,也就是genetree和species tree的不一致性很高。
extensive branch annotations
當(dāng)你得到一個(gè)species tree或者用-q參數(shù)為樹打分,你將會得到每一個(gè)分支的branch length 和local posterior support 。除了這些默認(rèn)的參數(shù),還可以輸出其他branch 信息。無根樹的每一個(gè)branch都有四組。分別是first child (L), the second child (R), the sister group (S), and everything else (O)。兩兩配對,可以得到三種拓?fù)浣Y(jié)構(gòu)。其中一種就是當(dāng)前樹的拓?fù)浣Y(jié)構(gòu)。剩下的就是可選的兩種拓?fù)浣Y(jié)構(gòu)。astral可以不僅僅得到當(dāng)前樹的local posterior probability,也能計(jì)算剩下的兩種拓?fù)浣Y(jié)構(gòu)的。-t 參數(shù)
-t 0 :關(guān)掉當(dāng)前的posterior probability。
-t 1:local posterior probability 如果你想知道genetree中的quartet占branch的多少。就可以使用這個(gè)參數(shù)。用這個(gè)測定quartet support。quartet score 是測量基因樹與分支沖突的好辦法。
-t 4:輸出3個(gè)local posterior probability,就是前文說的三種拓?fù)浣Y(jié)構(gòu)。
-t 2:當(dāng)你使用這個(gè)參數(shù),許多分支都會得到很多測量。
q1,q2,q3:分別展示了main topology,和另外兩種拓?fù)浣Y(jié)構(gòu)的quartet support。
f1,f2,f3:分別展示main topology 和另外兩種拓?fù)浣Y(jié)構(gòu)的quartet trees的總數(shù)。
pp1,pp2,pp3分別展示了main topology 和另外兩種拓?fù)浣Y(jié)構(gòu)的local posterior probability
QC:展示了每一個(gè)分支下的quartets 的總數(shù)。
EN:branch的有效的genes。如果不存在missing data的時(shí)候,這個(gè)就是出現(xiàn)在branch中的數(shù)目。如果有missing data的時(shí)候,有些genetree對branch沒有任何貢獻(xiàn)。因此,這里的genetree的number可能小于總共genes的number。
-t 8:輸出q1,q2,q3
-t 10:測試,查看無效假設(shè)是否會被拒絕。
-t 16:產(chǎn)生.csv文件,帶有quartet 頻率的freqQuad.csv。
命令如下
java -jar astral.5.6.3.jar -q test_data/1kp.tre -i test_data/1KP-genetrees.tre -t 2 -o test_data/1kp-scored-t2.tre
java -jar astral.5.6.3.jar -q test_data/1kp.tre -i test_data/1KP-genetrees.tre -t 4 -o test_data/1kp-scored-t4.tre
java -jar astral.5.6.3.jar -q test_data/1kp.tre -i test_data/1KP-genetrees.tre -t 8 -o test_data/1kp-scored-t8.tre
java -jar astral.5.6.3.jar -q test_data/1kp.tre -i test_data/1KP-genetrees.tre -t 10 -o test_data/1kp-scored-t10.tre
閱讀幾個(gè)分支給出的所有值,并理解他們。
Prior hyper-parameter(這里一節(jié)都不懂是什么意思)
用Yule prior model 計(jì)算speciestree 的branch length的local posterior probabilities 和branch lengths。Yule process的物種形成速率(in coalscent units)默認(rèn)值設(shè)置為0.5,導(dǎo)致quartet 頻率在[1/3,1]之間是平穩(wěn)的。(并不理解)用-c的選項(xiàng)可以調(diào)節(jié)hyper-parameter。
multi-locus bootstrapping
astral 可以不通過bootstrapping輸出branch support value.這種support比bootstrapping更加可靠(在作者的數(shù)據(jù)下)。盡管,你可能還是想得到bootstrapping。astral可以進(jìn)行multi-locus bootstrapping。為了開展multi-locus bootstrapping,astral需要訪問每一個(gè)gene的boostrap replicate trees。
例如:
你需要提供所有g(shù)ene tree bootstrap replicates的位置。在測試數(shù)據(jù)中進(jìn)行bootstrapping。
1.進(jìn)入test_data目錄
2.解壓called song_mammals.424genes.bs-trees.zip.
3.然后運(yùn)行
java -jar ../astral.5.6.3.jar -i song_mammals.424.gene.tre -b bs-files -o song_mammals.bootstrapped.astral.tre
然后會run100次bootstrapping。
input
1.-i 包括所有的MLgenetrees(就像不計(jì)算bootstrap也要輸入的)
2.-b 告訴astral 需要計(jì)算bootstrap value。-b 后面的文件 bs-files 包含了genetree bootstrap files的文件路徑,一行一個(gè)gene。例如:
424genes/100/raxmlboot.gtrgamma/RAxML_bootstrap.allbs
outputfile 包括
1.100 bootstrapped replicate trees,每一個(gè)都是對一組bootstrap gene trees進(jìn)行running astral 的結(jié)果。
2.A greedy consensus of the 100 bootstrapped replicate trees; this tree has support values drawn on branches based on the bootstrap replicate trees. Support values show the percentage of bootstrap replicates that contain a branch.
3.The “main” ASTRAL tree; this is the results of running ASTRAL on the best_ml input gene trees. This main tree also includes support values, which are again drawn based on the 100 bootstrap replicate trees.(不懂)
注意:support value以百分?jǐn)?shù)的形式展示。而local posterior probabilities是0-1之間的數(shù)。當(dāng)astral 計(jì)算bootstrapping時(shí),它會持續(xù)輸出每一個(gè)重復(fù)的bootstrapped astral tree.因此,如果replicate 被輸入成100,它將會輸出100個(gè)數(shù),然后,輸出100 bootstrapped trees 的greedy consensus。(不懂)最后,它會開展主要的分析 (-i參數(shù)的文件)然后計(jì)算主要樹的branch support。這個(gè)示例中就是102trees。
number of replicates
默認(rèn)值是100,-r 參數(shù)可以設(shè)置任何數(shù)量的重復(fù)。但是要保證你的genetree的bootstrap file 的bootstrap replicates 要多于你的-r參數(shù)后面的設(shè)置。
gene+site resampling
astral 開展site-only的resampling,可以用-g參數(shù)。
java -jar ../astral.5.6.3.jar -i song_mammals.424.gene.tre -b bs-files -g -r 100 -o song_mammals.bootstrapped.gs.astral.tre
這時(shí)候我們需要更多的genetree replicates。如果是-g -r 100,對于某些gene那可能需要150 replicates。因?yàn)樵趃enes resampled的時(shí)候,一些gene抽到的概率會比其他的gene更多。
gene-only resampling
astral展開gene-only bootstrapping 用--gene-only的option。這個(gè)只要one inputfile。用-i 參數(shù)就可以了,對于這個(gè)就不要使用-b參數(shù)。
java -jar ../astral.5.6.3.jar -i song_mammals.424.gene.tre --gene-only -o song_mammals.bootstrapped.go.astral.tre
由于引導(dǎo)涉及一個(gè)隨機(jī)的過程,我們可以提供一個(gè)seed number給astral 保證重復(fù)性。seed number 可以有-s進(jìn)行設(shè)置。默認(rèn)的參數(shù)是692.
the search space of astral
exact version
astral 有exact 和heuristic 的version。當(dāng)taxa的數(shù)目較少的時(shí)候,exact version 會節(jié)約時(shí)間。但是分類不能超過37個(gè)。
java -jar astral.5.6.3.jar -i test_data/song_primates.424.gene.tre -o test_data/song_primates.424.exact.tre -x
-x參數(shù)就是開啟exact version。大約30秒。同樣的,我們可以使用默認(rèn)的heuristic啟發(fā)式搜索法
java -jar astral.5.6.3.jar -i test_data/song_primates.424.gene.tre -o test_data/song_primates.424.default.tre
這就只有1秒,那么他們的運(yùn)行結(jié)果有何不同呢?其實(shí)是一致的
example what exact helps
The default primate dataset we used in the previous step had 424 genes and 14 taxa. Since we have a relatively large number of gene trees, we could reasonably expect the exact and heuristic versions to generate identical output. The key point here is that as the number of genes increases, the probability that each bipartition of the species tree appears in at least one input gene tree increases. Thus, with 424 genes all bipartitions from the species tree are in at least one input gene tree, and therefore, the exact and the heuristic versions are identical.
We tried hard to find a subset of genes in the biological primates dataset where the exact and the heuristic versions did not match. We couldn't! So we had to resort to simulations. We simulated a 14-taxon dataset with extreme levels of ILS (average 87% RF between gene trees and the species tree). Now, with this simulated dataset, if you take only 10 genes, something interesting happens.
運(yùn)行:
java -jar astral.5.6.3.jar -i test_data/simulated_14taxon.gene.tre -o test_data/simulated_14taxon.default.tre
astral.5.6.3.jar -i test_data/simulated_14taxon.gene.tre -o test_data/simulated_14taxon.exact.tre -x


這時(shí)得分會有一點(diǎn)不同,topology也會不同。因此,在極端的情況下(ILS水平較高,genetree錯(cuò)誤較多或者較分類來說可用的genetrees較少比如14類群只有10個(gè)gene,較之前的424gene就是較少)。那么就可以觀察到兩種算法的差異。
providing astral with extra trees
為了expand search space ,運(yùn)行:
java -jar astral.5.6.3.jar -i test_data/simulated_primates_5X.10.gene.tre -o test_data/simulated_primates_5X.10.species.tre -e test_data/simulated_primates_5X.10.bootstrap.gene.tre
這里的-e參數(shù)用于輸入一組extra trees 用于擴(kuò)展astral的搜索空間。這個(gè)文件為10個(gè)simulated genes提供了200 bootstrap replicates 。-f 用于當(dāng)input tree 有species labels代替gene label 的時(shí)候。
memory
大數(shù)據(jù)集(>500taxa)增加memory available to java。
run
java -Xmx3000M -jar astral.5.6.3.jar -i in.tree
其他參數(shù)
-m: 移除含有少于指定葉子數(shù)量的gene。對于需要一定分類級別的taxon occupancy 是有用的。后面設(shè)置數(shù)量。
-k completed : To build the set X (and not to score the species tree), ASTRAL internally completes the gene trees. To see these completed gene trees, run this option. This option is usable only when you also have -o(不懂)
-k bootstrapped 和-k bootstraps_norun:these options output the bootstrap replicate inputs to ASTRAL. These are useful if you want to run ASTRAL separately on each bootstrap replicate on a cluster.
-k searchspace_norun:輸出search space然后退出。
----polylimit:
--samplingrounds:For multi-individual datasets, this option controls how many rounds of individual sampling is used in building the constraint set. Adjust to reduce/increase the search space for multi-individual datasets
文章參考:[https://github.com/smirarab/ASTRAL/blob/master/astral-tutorial.md#running-on-a-multi-individual-datasets]