dateTaxonTreePBDB: Date a Taxon-Topology from the Paleobiology Database Using...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/dateTaxonTreePBDB.R

Description

The function dateTaxonTreePBDB takes a input consisting of a topology, with tip and internal node labels corresponding to taxa in the Paleobiology Database, and a table of data (containing those same tip and node taxa) obtained from the taxa-list functionality of the Paleobiology Database's API, with appearance times. This function will then output a tree with nodes reflecting the ages of the respective higher taxa, based on their earliest times of appearance from the Paleobiology Database.

Usage

1
2
3
4
5
6
7
8
dateTaxonTreePBDB(
  taxaTree,
  taxaDataPBDB = taxaTree$taxaDataPBDB,
  minBranchLen = 0,
  tipTaxonDateUsed = "shallowestAge",
  dropZeroOccurrenceTaxa = TRUE,
  plotTree = FALSE
)

Arguments

taxaTree

A tree with tip taxon names matching the taxon names in taxaDataPBDB. Probably a taxon tree estimated with makePBDBtaxonTree.

taxaDataPBDB

A data table of taxonomic information obtained using the Paleobiology Database's API for a set of taxa that includes the tip taxa on taxaTree, generated with parameter show = app so that appearance times are included.

minBranchLen

Following dating using the appearance times taken directly from the PBDB for each tip taxon and node, the tree may then be assessed with the minimum branch length algorithm, as applied by minBranchLength. If minBranchLen = 0, the default, this step is skipped. It may be necessary to set minBranchLen higher than zero to differentiate nodes in cases with poor stratigraphic congruency, so that derived taxa are the first taxa observed in a group.

tipTaxonDateUsed

Controls what date for a taxon from the PBDB is used for 'when' the tip should be placed in the dated phylogeny produced by this function. The default, tipTaxonDateUsed = "shallowestAge" will use the minimum age of the last appearance time of that taxon, which if it is extant will be 0, and if it is extinct, will be the maximum constraint on the age of its last appearance (i.e. the last time we saw it before it went extinct). A second option is "deepestAge", which is the oldest possible first appearance time from the PBDB, i.e. the maximum age constraint for the first appearance. As closely related taxa often first occur in the same short interval of geologic time, due to diversification bursts and/or the heterogeneity of fossil preservation, this may result in confusing polytomies of many terminal taxa with no terminal branch lengths.

dropZeroOccurrenceTaxa

If TRUE, the default, then extinct taxa or extinct clades found to have zero occurrences in the Paleobiology Database are removed. If this option isn't used, the function will likely fail as nodes or tips with NA ages listed cannot be processed by parentChild2TaxonTree.

plotTree

If TRUE, the resulting dated tree is plotted. This is FALSE by default.

Details

The dating by this function is very simplistic, representing a rather straight interpretation of what the PBDB reports. The dated trees produced should not be taken overly seriously.

Value

Returns a dated phylogeny of class phylo, with an additional element $taxaDataPBDB added containing the input taxaDataPBDB, as this might be called by other functions.

Author(s)

David W. Bapst

References

Peters, S. E., and M. McClennen. 2015. The Paleobiology Database application programming interface. Paleobiology 42(1):1-7.

The equuid tree used in the examples is from: MacFadden, B. J. 1992. Fossil horses: systematics, paleobiology, and evolution of the family Equidae. Cambridge University Press.

See Also

See getDataPBDB, makePBDBtaxonTree, and plotPhyloPicTree.

Examples

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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: 

# 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)
    )

## End(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: 

# 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)
    )


## End(Not run)

paleotree documentation built on Dec. 16, 2019, 1:37 a.m.