author: April Wright date: 08.10.2018 autosize: true
When do we observe more sampled ancestors? Look at some of your tree plots to find out.
What do you think would happen to speciation rates if sampled ancestors are disallowed?
library(FossilSim)
library(ape)
tree <- sim.fbd.taxa(n=10, numbsim=1, lambda=3, mu=2, psi=2)
plot(tree[[1]])
This tree implies some values: that lineages have a time since origination, a time at extinction, and a time of sampling. How do we get them?
Likelihood and Bayesian phylogenetic trees have a rate-based branch length
Turner, et al. 2016
Alfaro et al. 2018
$Agriarctos_spp
[1] "?" "0" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "0"
[18] "0" "0" "1" "1" "1" "1" "0" "0" "1" "?" "1" "1" "?" "0" "1" "1" "1"
[35] "1" "0" "1" "1" "0" "?" "?" "0" "1" "1" "1" "0" "?" "?" "?" "?" "?"
[52] "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?"
$Ailurarctos_lufengensis
[1] "?" "0" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?"
[18] "0" "0" "1" "1" "1" "1" "0" "1" "1" "?" "1" "1" "?" "0" "?" "?" "?"
[35] "?" "0" "1" "1" "1" "?" "0" "0" "1" "1" "1" "0" "1" "0" "1" "1" "0"
[52] "1" "1" "?" "?" "?" "?" "?" "?" "?" "?" "?"
$Ailuropoda_melanoleuca
[1] "1" "0" "1" "1" "1" "1" "0" "1" "1" "0" "1" "0" "0" "1" "0" "0" "0"
[18] "0" "0" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "0" "0" "1" "0" "1"
[35] "0" "0" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "1" "0" "0" "1" "0"
[52] "1" "1" "0" "0" "0" "1" "0" "0" "0" "1" "0"
$Ballusia_elmensis
[1] "?" "0" "?" "?" "?" "?" "0" "1" "?" "0" "0" "0" "0" "0" "0" "0" "0"
[18] "0" "?" "0" "1" "0" "0" "0" "0" "0" "?" "1" "0" "0" "0" "0" "1" "0"
[35] "0" "?" "?" "0" "?" "?" "?" "0" "0" "0" "0" "0" "1" "0" "1" "1" "1"
[52] "1" "0" "?" "?" "?" "?" "?" "?" "?" "?" "?"
$Agriarctos_spp
[1] "?" "0" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "0"
[18] "0" "0" "1" "1" "1" "1" "0" "0" "1" "?" "1" "1" "?" "0" "1" "1" "1"
[35] "1" "0" "1" "1" "0" "?" "?" "0" "1" "1" "1" "0" "?" "?" "?" "?" "?"
[52] "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?"
$Ailurarctos_lufengensis
[1] "?" "0" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?" "?"
[18] "0" "0" "1" "1" "1" "1" "0" "1" "1" "?" "1" "1" "?" "0" "?" "?" "?"
[35] "?" "0" "1" "1" "1" "?" "0" "0" "1" "1" "1" "0" "1" "0" "1" "1" "0"
[52] "1" "1" "?" "?" "?" "?" "?" "?" "?" "?" "?"
$Ailuropoda_melanoleuca
[1] "1" "0" "1" "1" "1" "1" "0" "1" "1" "0" "1" "0" "0" "1" "0" "0" "0"
[18] "0" "0" "1" "1" "1" "1" "0" "1" "0" "1" "1" "1" "0" "0" "1" "0" "1"
[35] "0" "0" "1" "1" "0" "0" "0" "0" "1" "1" "1" "0" "1" "0" "0" "1" "0"
[52] "1" "1" "0" "0" "0" "1" "0" "0" "0" "1" "0"
$Ballusia_elmensis
[1] "?" "0" "?" "?" "?" "?" "0" "1" "?" "0" "0" "0" "0" "0" "0" "0" "0"
[18] "0" "?" "0" "1" "0" "0" "0" "0" "0" "?" "1" "0" "0" "0" "0" "1" "0"
[35] "0" "?" "?" "0" "?" "?" "?" "0" "0" "0" "0" "0" "1" "0" "1" "1" "1"
[52] "1" "0" "?" "?" "?" "?" "?" "?" "?" "?" "?"
library(phangorn)
library(ggtree)
library(ggplot2)
aln_path <- 'data/bears_fasta.fa'
sample_df <- generate_sliding(bears, start_char = 1, stop_char = 2, steps = 10)
output_vector <- generate_tree_vis(sample_df = sample_df, alignment = aln_path, tree = tree, phy_mat = bears)
output_vector[[1]]
If we know the rate of sequence divergence is 1% per million years, we can date the tree by extrapolating from the amount of divergence.
Strict clock
Reality: the rate at which mutations arise varies based on generation time, lifestyle, DNA repair. Evolutionary forces cause differences in if a mutation is fixed, or removed from the population.
library(phytools)
pb <- pbtree(n = 5)
branches <- (length(pb$tip.label)*2) - 2
rates <- rexp(n = branches, rate = 1)
pb$edge.length <- rates
plotBranchbyTrait(pb, rates, mode = "edges")
Slide from Rachel Warnock
Fossils have typically been incorporated into analyses as what are called node calibrations
Use distributions to describe the relationship between the fossil sampling event and the parent node (which generated the fossil)