If you are trying to calculate things on a subset of the OpenTree synth tree, here are some steps to get that done. These require some of the phyx tools and python scripts that are presented here but that should be it. The get_ottids_for_taxa.py
script needs the request
python module that can be found here.
-
get the latest synth tree from here
-
get OTT ids for your taxa using either
-
if you aren't using
pxtrt
(from phyx)to trace your tree, I recommend pruning it down to just what you use (so, plants for example). You don't have to do this if you use thephyx
programpxtrt
to trace the tree because it can read larger trees.pxmrcacut -m cut_mrca_plants -t opentree9.1_tree/labelled_supertree/labelled_supertree.tre > vas_opentree_9.1.tre
- there are included
cut_mrca
files for different groups in this resources dir in the repo repo pxmrcacut
is a program in thephyx
package
-
get the list of taxa as a tree
- using python -
python trace_tree.py vas_opentree_9.1.tre file.ids.ottids > vas_nms.tre
- or you can use
pxtrt
fromphyx
. You will need to isolate the ids fromfile.ids.ottids
. You can do this withawk -F '\t' '{print "ott"$2}' file.ids.ottids > file.justids.ottids
. Then you can runpxtrt
likepxtrt -t opentree9.1_tree/labelled_supertree/labelled_supertree.tre -f file.justids.ottids > traced.tre
.
- using python -
In the examples folder, there is a TACO_BELL directory. There is a file called border_hot_sauce
with the scientific names of the ingredients. Here are the steps to a readable tree:
python ../../src/get_ottids_for_taxa.py border_hot_sauce > names_ottids
awk -F '\t' '{print "ott"$2}' names_ottids > justids.ottids
- I have already downloaded the most recent synth (see above) into a directory called
opentree9.1_tree
. So I runpxtrt opentree9.1_tree/labelled_supertree/labelled_supertree.tre -f justids.ottids > out.tre
out.tre
is the tree that you want but the ids are ottids, so not really readable. To convert, we do three simple steps:python get_all_names_tre.py out.tre > alltreenames
python get_name_for_ottids.py alltreenames > allnames.ottids_names
python convert_ottids_names_tre.py out.tre allnames.ottids_names > final.tre
A lot of steps right now but I will simplify soon! Right now, going for flexibility.