This is a short tutorial showing how to use the U.Phylomaker R package to turn a list of species into a phylogeny.
This approach requires a “megatree” - a phylogeny that includes as much information as possible about the clade of interest. This tree does not need to contain all of your species. The method will attempt to place each species in the phylogeny. If the exact species is present in the phylogeny, that is where the species is placed. If the species is not present in the phylogeny, but the genus is, the species will be grafted at the genus level. If only the family the species comes from is present in the phylogeny, the species will be grafted at the family level.
If needed, install U.Phylomaker package and dependencies
# install devtools and ape packages if needed
install.packages("devtools", dependencies=TRUE)
install.packages("ape", dependencies=TRUE)
# now install U.PhyloMaker package from GitHub
library(devtools)
devtools::install_github("jinyizju/U.PhyloMaker")
First, we load the U.Phylomaker package.
library(U.PhyloMaker)
## Loading required package: ape
To use the package, we need to download a megatree - a phylogeny that includes as much information about as many families, genera, and species from our clade of interest as possible. Currently the authors of the U.Phylomaker package maintain megatrees for plants, ferns, amphibians, mammals, and fish. These megatrees are usually based on either a comprehensive phylogeny that includes all species in a clade, or based on a compilation of phylogenetic information from numerous published studies. U.Phylomaker megatrees can be downloaded from [https://github.com/megatrees]. A previous version of the software V.Phylomaker2 included alternative plant megatrees if you want to evaluate the impact of megatree source on the resulting phylogeny.
For our example, we will develop a phylogenetic hypothesis for woody plant species occurring on Mont-Saint-Hilaire (from the Arii et al. dataset).
You will need to download the plant_20221117 megatree files and place them in a folder with the same name. The megatree includes two files:
# load the megatree phylogeny
megatree <- read.tree("plant_20221117/plant_megatree.tre")
megatree
##
## Phylogenetic tree with 72570 tips and 72514 internal nodes.
##
## Tip labels:
## Stylotrichium_rotundifolium, Stylotrichium_edmundoi, Stylotrichium_sucrei, Stylotrichium_corymbosum, Lasiolaena_blanchetii, Semiria_viscosa, ...
## Node labels:
## , , Spermatophyta, Magnoliophyta, mrcaott2ott2645, mrcaott2ott35778, ...
##
## Rooted; includes branch lengths.
# load the lookup file indicating what family genera belong to
gen.list <- read.csv("plant_20221117/plant_genus_list.csv", sep=",")
head(gen.list)
## genus family
## 1 Aa Orchidaceae
## 2 Aakia Poaceae
## 3 Aaronsohnia Asteraceae
## 4 Abacopteris Thelypteridaceae
## 5 Abacosa Fabaceae
## 6 Abarema Fabaceae
We also need a list of the species we wish to place on the phylogeny. This is a text file containing list of the species we want to place on the phylogeny. Each line contains the species name, and the genus that species belongs to.
Here our species list includes woody plant species occurring at Mont-Saint-Hilaire.
sp.list <- read.delim("MSH_species_list.txt")
sp.list
## species genus
## 1 Amelanchier laevis Amelanchier
## 2 Acer pensylvanicum Acer
## 3 Acer rubrum Acer
## 4 Acer saccharum Acer
## 5 Acer spicatum Acer
## 6 Betula alleghaniensis Betula
## 7 Betula papyrifera Betula
## 8 Carya ovata Carya
## 9 Fraxinus americana Fraxinus
## 10 Fagus grandifolia Fagus
## 11 Juglans cinerea Juglans
## 12 Ostrya virginiana Ostrya
## 13 Populus grandidentata Populus
## 14 Prunus pensylvanica Prunus
## 15 Prunus serotina Prunus
## 16 Pinus strobus Pinus
## 17 Prunus virginiana Prunus
## 18 Quercus rubra Quercus
## 19 Tilia americana Tilia
## 20 Tsuga canadensis Tsuga
## 21 Thuja occidentalis Thuja
## 22 Ulmus americana Ulmus
With the megatree files and the species list, we can now place the species onto the megatree phylogeny.
result <- phylo.maker(sp.list, megatree, gen.list, nodes.type = 1, scenario = 3)
# inspect the resulting object - it contains the phylogeny (phylo) and information about the placement of each species (sp.list)
result
## $phylo
##
## Phylogenetic tree with 22 tips and 21 internal nodes.
##
## Tip labels:
## Fraxinus_americana, Amelanchier_laevis, Prunus_pensylvanica, Prunus_virginiana, Prunus_serotina, Ulmus_americana, ...
## Node labels:
## Spermatophyta, Pentapetalae, mrcaott2ott96, mrcaott2ott371, mrcaott371ott2511, Rosales.rn.d8s.tre, ...
##
## Rooted; includes branch lengths.
##
## $sp.list
## species genus family family.in.genus.list
## 1 Amelanchier laevis <NA> <NA> Rosaceae
## 2 Acer pensylvanicum <NA> <NA> Sapindaceae
## 3 Acer rubrum <NA> <NA> Sapindaceae
## 4 Acer saccharum <NA> <NA> Sapindaceae
## 5 Acer spicatum <NA> <NA> Sapindaceae
## 6 Betula alleghaniensis <NA> <NA> Betulaceae
## 7 Betula papyrifera <NA> <NA> Betulaceae
## 8 Carya ovata <NA> <NA> Juglandaceae
## 9 Fraxinus americana <NA> <NA> Oleaceae
## 10 Fagus grandifolia <NA> <NA> Fagaceae
## 11 Juglans cinerea <NA> <NA> Juglandaceae
## 12 Ostrya virginiana <NA> <NA> Betulaceae
## 13 Populus grandidentata <NA> <NA> Salicaceae
## 14 Prunus pensylvanica <NA> <NA> Rosaceae
## 15 Prunus serotina <NA> <NA> Rosaceae
## 16 Pinus strobus <NA> <NA> Pinaceae
## 17 Prunus virginiana <NA> <NA> Rosaceae
## 18 Quercus rubra <NA> <NA> Fagaceae
## 19 Tilia americana <NA> <NA> Malvaceae
## 20 Tsuga canadensis <NA> <NA> Pinaceae
## 21 Thuja occidentalis <NA> <NA> Cupressaceae
## 22 Ulmus americana <NA> <NA> Ulmaceae
## output.note
## 1 present in megatree
## 2 present in megatree
## 3 present in megatree
## 4 present in megatree
## 5 present in megatree
## 6 present in megatree
## 7 present in megatree
## 8 present in megatree
## 9 present in megatree
## 10 insertion based on genus
## 11 present in megatree
## 12 present in megatree
## 13 present in megatree
## 14 present in megatree
## 15 present in megatree
## 16 present in megatree
## 17 present in megatree
## 18 present in megatree
## 19 present in megatree
## 20 present in megatree
## 21 present in megatree
## 22 present in megatree
# plot the resulting phylogeny including our species
plot(result$phylo)
add.scale.bar()
We can use the resulting phylogeny object for downstream analyses.