Once you've run treeslider you now have a distribution of gene trees that you can use as input to a multi-locu species tree or network inference program. Here I demonstrate how to input your data to astral.
In [1]:
# conda install ipyrad -c bioconda
# conda install toytree -c eaton-lab
In [2]:
import pandas as pd
import toytree
In [4]:
# load the tree table from CSV
tree_table = pd.read_csv(
"./analysis-treeslider/test.tree_table.csv",
index_col=0,
)
In [59]:
# examine top of table
tree_table.head()
Out[59]:
In [11]:
outfile = open("trees.nwk", "w")
outfile.write("\n".join(tree_table.tree.tolist()))
outfile.close()
In [12]:
%%bash
wget -q https://github.com/smirarab/ASTRAL/raw/master/Astral.5.6.3.zip
unzip -qo Astral.5.6.3
This will write the results (stdout) to a file called astral.tre, and it will write other information printed to the screen (stderr) to a file called astral.err. By default astral runs 100 bootstrap replicates by gene-tree resampling. To turn on gene and site resampling would require inputting the bootstrap files, which we did not currently save (we could...).
In [13]:
%%bash
java -jar Astral/astral.5.6.3.jar -i trees.nwk > astral.tre 2>astral.err
In [61]:
tre = toytree.rtree.coaltree(10)
tre.
Out[61]:
In [71]:
tre.rotate_node(names=["r0", "r1", "r2"])
Out[71]:
In [68]:
tre.draw(node_labels=True);
In [60]:
tre = toytree.tree("astral.tre").root('reference')
tre.draw(node_labels="support", tip_labels_align=True);