taxa2phylo: Convert Simulated Taxon Data into a Phylogeny

View source: R/taxa2phylo.R

taxa2phyloR Documentation

Convert Simulated Taxon Data into a Phylogeny

Description

Converts temporal and ancestor-descendant relationships of taxa into a dated phylogeny with tips at instantaneous points in time.

Usage

taxa2phylo(taxaData, obs_time = NULL, plot = FALSE)

Arguments

taxaData

A five-column matrix of taxonomic data, as output by fossilRecord2fossilTaxa via simulations produced using simFossilRecord. Previously, this was the default output of the deprecated function simFossilTaxa.

obs_time

A vector of per-taxon times of observation which must be in the same order of taxa as in the object taxaData. If obs_time = NULL, the LADs (column 4) in taxaData are used.

plot

If TRUE result the output with ape::plot.phylo.

Details

As described in the documentation for taxa2cladogram, the relationships among morphotaxa in the fossil record are difficult to describe in terms of traditional phylogenies. One possibility is to arbitrarily choose particular instantaneous points of time in the range of some taxa and describe the temporal relationships of the populations present at those dates. This is the tactic used by taxa2phylo.

By default, the dates selected (the obs_time argument) are the last occurrences of the taxon, so a simple use of this function will produce a dated tree which describes the relationships of the populations present at the last occurrence time of each taxon in the sampled data. Alternatively, obs_time can be supplied with different dates within the taxon ranges.

All data relating to when static morphotaxa appear or disappear in the record is lost. Branching points will be the actual time of speciation, which (under budding) will often be in the middle of the temporal range of a taxon.

Cryptic taxa are not dropped or merged as can be done with taxa2cladogram. The purpose of taxa2phylo is to obtain the 'true' pattern of evolution for the observation times, independent of what we might actually be able to recover, for the purpose of comparing in simulation analyses.

As with many functions in the paleotree library, absolute time is always decreasing, i.e. the present day is zero.

Value

The resulting phylogeny with branch lengths is output as an object of class phylo. This function will output trees with the element $root.time, which is the time of the root divergence in absolute time.

The tip labels are the row-names from the simulation input; see the documentation for simFossilRecord and fossilRecord2fossilTaxa for details.

Note

Do NOT use this function to date a real tree for a real dataset. It assumes you know the divergence/speciation times of the branching nodes and relationships perfectly, which is almost impossible given the undersampled nature of the fossil record. Use timePaleoPhy or cal3TimePaleoPhy instead.

Do use this function when doing simulations and you want to make a tree of the 'true' history, such as for simulating trait evolution along phylogenetic branches.

Unlike taxa2cladogram, this function does not merge cryptic taxa in output from simFossilRecord (via fossilRecord2fossilTaxa) and I do not offer an option to secondarily drop them. The tip labels should provide the necessary information for users to drop such taxa, however. See simFossilRecord.

Author(s)

David W. Bapst

See Also

simFossilRecord, taxa2cladogram, fossilRecord2fossilTaxa

Examples


set.seed(444)
record <- simFossilRecord(
   p = 0.1, 
   q = 0.1, 
   nruns = 1,
   nTotalTaxa = c(30,40), 
   nExtant = 0
   )
taxa <- fossilRecord2fossilTaxa(record)
# let's use taxa2cladogram to get the 'ideal' cladogram of the taxa
tree <- taxa2phylo(taxa)
phyloDiv(tree)

# now a phylogeny with tips placed at
   # the apparent time of extinction for each taxon
rangesCont <- sampleRanges(taxa,r = 0.5)
tree <- taxa2phylo(taxa,obs_time = rangesCont[,2])
phyloDiv(tree,drop.ZLB = FALSE)
#note that it drops taxa which were never sampled!

#testing with cryptic speciation
set.seed(444)
record <- simFossilRecord(
   p = 0.1, 
   q = 0.1, 
   prop.cryptic = 0.5, 
   nruns = 1,
   nTotalTaxa = c(30,40), 
   nExtant = 0, 
   count.cryptic = TRUE
   )
taxaCrypt <- fossilRecord2fossilTaxa(record)
treeCrypt <- taxa2phylo(taxaCrypt)
layout(1)
plot(treeCrypt)
axisPhylo()


paleotree documentation built on Aug. 22, 2022, 9:09 a.m.