# NOT RUN {
# }
# NOT RUN {
taxaAnimals<-c("Archaeopteryx", "Eldredgeops",
"Corvus", "Acropora", "Velociraptor", "Gorilla",
"Olenellus", "Lingula", "Dunkleosteus",
"Tyrannosaurus", "Triceratops", "Giraffa",
"Megatheriidae", "Aedes", "Histiodella",
"Rhynchotrema", "Pecten", "Homo", "Dimetrodon",
"Nemagraptus", "Panthera", "Anomalocaris")
data <-getSpecificTaxaPBDB(taxaAnimals)
tree <- makePBDBtaxonTree(data, rankTaxon = "genus")
#get the ranges
timeTree <- dateTaxonTreePBDB(tree)
plotPhyloPicTree(tree = timeTree,
depthAxisPhylo = TRUE)
# }
# NOT RUN {
####################################
# }
# NOT RUN {
# can also plot dated tree with strap
library(strap)
#now plot it
strap::geoscalePhylo(
tree=timeTree,
direction = "upwards",
ages=rangesMinMax,
cex.tip=0.7,
cex.ts=0.55,
cex.age=0.5,
width=3,
tick.scale = 50,
quat.rm=TRUE,
boxes = "Period",
arotate = 90,
units=c("Eon","Period","Era"),
x.lim=c(650,-20)
)
# }
# NOT RUN {
##############################################################
# }
# NOT RUN {
# we can also use this for pre-existing trees
# for example, this tree of equuids (horses)
# borrowed from UCMP materials on horse evolution
# https://evolution.berkeley.edu/evolibrary/images/HorseTree.pdf
# (apparently from MacFadden, 1992? Citation above)
# read the tree in as Newick string
horseTree <- ape::read.tree(file=NULL,
text = paste0(
"(Eohippus,(Xenicohippus,(Haplohippus,(Epihippus,",
"(Miohippus,(((Hypohippus,Megahippus),(Anchitherium,",
"Kalobatippus)),(Archaeohippus,(Desmatippus,(Parahippus,",
"(Merychippus,(((Hipparion_Merychippus,(Nannippus,",
" Cormohipparion)),(Pseudhipparion,(Neohipparion,",
" Hipparion))),(Equine_Merychippus,((Protohippus,Calippus),",
"(Pliohippus,(Astrohippus,(Dinohippus,Equus))))))))))))))));"
)
)
# note there is a message that the tree lacks node names
# this is unexpected / atypical for taxon trees
plot(horseTree)
# now let's get data on the tip from the PBDB
# using getSpecificTaxaPBDB
horseData <- getSpecificTaxaPBDB(horseTree$tip.label)
# now we can date the tree with dateTaxonTreePBDB
datedHorseTree <- dateTaxonTreePBDB(
taxaTree = horseTree,
taxaDataPBDB = horseData,
minBranchLen = 1
)
# and let's try plotting it!
plotPhyloPicTree(
tree = datedHorseTree,
depthAxisPhylo = TRUE
)
# a fairly boring phylopic diagram
# not many horse phylopics as of 07-16-19?
# }
# NOT RUN {
# }
# NOT RUN {
# Let's look at this horse tree with strap
library(strap)
geoscalePhylo(
tree = datedHorseTree,
ages = datedHorseTree$ranges.used,
cex.tip = 0.7,
cex.ts = 0.7,
cex.age = 0.7,
width = 4,
tick.scale = 15,
boxes = "Epoch",
erotate = 90,
quat.rm = TRUE,
units = c("Period","Epoch"),
x.lim = c(65,-10)
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab