
Biology 559R: Introduction to Phylogenetic Comparative Methods Topics for this week (Feb 24 & 26): • Ancestral state reconstruction (discrete) • Ancestral state reconstruction (continuous) 1 Ancestral Phenotypes • The available information about past history of life is marked by its scarcity and incompleteness. • To understand present diversity of life forms, we need to find a way to infer past forms. • With very few examples, fossil record are not available for most taxa and some traits do not fossilize (e.g., behavioral traits, soft tissues). Gingerich (1984) 2 Ancestral Phenotypes • The current alternatives are to infer ancestral character states by mapping the phenotypes (or other characteristics, e.g., distributions) of living organisms onto phylogenies. • The resulting outcomes of such reconstructions are hypotheses about ancient life forms and provide the basis to understand the path of evolution (decent with modification) to the extant species. Ancestral calls of Physalaemus pustulosus using ancestral reconstructions (Ryan and Rand, 1999) 3 Ancestral Phenotypes • These reconstructions also provide information about the number of times a character state has arisen independently and might support adaptation. • Many factors determine the success of such reconstructions including a well-supported phylogeny, well-sampled extant living forms, and adequate character reconstruction methodologies salamanders biphasic life cycle (white) direct development(black) stick insects: Whiting et al., 2003 4 Ancestral Phenotypes: Maximum Likelihood • There many different methodologies for ancestral reconstruction: parsimony, maximum likelihood and Bayesian. • ML approaches use an explicit model of character evolution to estimate the probabilities of all possible character state reconstructions at every node on the tree. • In addition to the model of evolution, these probabilities are also determined by the distribution of character states in the terminal taxa. • One interesting outcome from the ML approach, it is that the method considers every possible reconstruction and can estimate the relative probability of each character state at every node. • This outcomes can be applied for hypothesis testing (e.g., fixing nodes to a particular state versus the inferred). 5 Ancestral Phenotypes: Maximum Likelihood 6 Ancestral Reconstruction (Discrete) • Make a working directory (e.g., discrete) and select it as your working. R top menus: Misc>Change Working Directory (select the directory that has our file) setwd("/Users/jcsantos/Desktop/R_class_winter_2015_home/0_Bio559R_course_final_files/ week_8/data/")! • We need to download these files from the course website into our working directory: bird_data_pruned.txt bird_pruned_MB.newick tyrannidae_reduced_data.txt ß These are for your practice tyrannidae_reduced_tree.newick ß These are for your practice • read 'ape’, ‘geiger’ and ‘phytools’ packages library(ape)! library(geiger)! library(phytools)! ! ! 7 Ancestral Reconstruction (Discrete) • Load our trees and data from last week and check concordance: ! bird_pruned_tree <- read.tree("bird_pruned_MB.newick")! bird_pruned_tree! birds_traits_data <- read.table("bird_data_pruned.txt", header = TRUE, sep = "\t")! birds_traits_data! ! using the 'read.tree' function of ape: ! bird_trees <-read.tree(file = "bird_tree.tree")! bird_trees #5 trees in loaded! bird_trees [[1]]# first tree a very large tree ! ! bird_tree_1 <- bird_trees [[1]]# assign first tree to object class phylo! ! • use the 'name.check' function to determine if we have concordance: ! name.check (bird_pruned_tree, birds_traits_data)! ! # [1] "OK" # we have concordance (i.e., we the same number of tips and data per tip)! ! ! 8 Ancestral Reconstruction (Discrete) • We need to make sure that our tree is ultrametric tree and preferably bifurcating ! is.ultrametric(bird_pruned_tree) # TRUE! ! is.binary.tree(bird_pruned_tree) ! # TRUE all nodes (including the root node) have exactly two descendant nodes! • To plot, we need to sort variable values to match phylogeny names order match_birds_traits_data <- match(bird_pruned_tree$tip.label, rownames(birds_traits_data)) #use match function! sorted_birds_traits_data <- as.data.frame(birds_traits_data[match_birds_traits_data,])! sorted_birds_traits_data! ! 9 Ancestral Reconstruction (Discrete) • Prepare data for plotting the Food discrete trait. We are going to use colored label for discrete traits #Food! Food_birds_label <- character(length(sorted_birds_traits_MR$Food)) ! names(Food_birds_label) <- rownames(sorted_birds_traits_MR)! ! #get the unique states for Food! ! unique(sorted_birds_traits_MR$Food)! #[1] vegetarian carnivore omnivore ! ! #label states with colors for plot! ! Food_birds_label[sorted_birds_traits_MR$Food=="vegetarian"] <- "green3" #assign color! Food_birds_label[sorted_birds_traits_MR$Food=="carnivore"] <- "red" #assign color! Food_birds_label[sorted_birds_traits_MR$Food=="omnivore"] <- "darkorchid" #assign color! Food_birds_label! 10 Ancestral Reconstruction (Discrete) • Let’s plot the bird tree as a ‘phylogram’ type format without names:! ! plot(bird_pruned_tree, cex=1, show.tip.label = FALSE) #Plot a tree that leaves some room between the tree tips and taxon labels so that we can plot habitat use in this space! points(rep(122.5, nrow(sorted_birds_traits_data)), 1:nrow(sorted_birds_traits_data), pch=22, bg=Food_birds_label[bird_pruned_tree$tip.label], lwd = 0.05, col="white", cex=1.5)! ! 11 Ancestral reconstruction using ‘ape’ • We can use the ace (Ancestral Character Estimation) function of ape to reconstruct ancestral character states using maximum likelihood: Let’s explore ape: ?ace! # ace(x, phy, ! # type = "discrete", ! # method = "ML", # only option for discrete characters, following Pagel 1994! # CI = TRUE, # 95% confidence intervals! # model = "ER", # Four option, equal rates (ER), ! # symmetrical (SYM), ! # All-rates different (ARD)! # scaled = TRUE, ! # kappa = 1, # if branch lengths needs transformation, ! # a positive value giving the exponent for such transformation! # corStruct = NULL, ! # ip = 0.1,! # use.expm = FALSE,! # use.eigen = TRUE, ! # marginal = FALSE) # returns the node marginal reconstruction (likelihood values) ! # at each node! • Let's explore the "ER" model: ! food_bird_ace_ER <- ace(birds_traits_data$Food, bird_pruned_tree, type="discrete", model = "ER", marginal = TRUE) #Equal rates! food_bird_ace_ER! 12 Ancestral reconstruction using ‘ape’ • Let's explore the "ER" model: ! # Ancestral Character Estimation! ! This is the model that was calculated:! ! # Call: ace(x = birds_traits_data$Food, phy = bird_pruned_tree, type = "discrete", model = "ER”)! ! The log-likelihood of our model: # Log-likelihood: -406.578 ! ! The instantaneous rate matrix (Q)– more on this later– for transformation between states:! ! # Rate index matrix:! # carnivore omnivore vegetarian! # carnivore . 1 1! # omnivore 1 . 1! # vegetarian 1 1 .! ! This is the parameter values including its standard error: ! # Parameter estimates:! # rate index estimate std-err! # 1 0.0083 7e-04! ! This is the marginal reconstructions at the root (all should add to 1):! ! # Scaled likelihoods at the root (type '...$lik.anc' to get them for all nodes):! # carnivore omnivore vegetarian ! 13 # 0.5489050 0.1842301 0.2668649 ! Ancestral reconstruction using ‘ape’ • Let's explore the "ER" model: ! # Ancestral Character Estimation! ! This is the model that was calculated:! ! # Call: ace(x = birds_traits_data$Food, phy = bird_pruned_tree, type = "discrete", model = "ER”)! ! The log-likelihood of our model: # Log-likelihood: -406.578 ! ! The instantaneous rate matrix (Q)– more on this later– for transformation between states:! ! # Rate index matrix:! # carnivore omnivore vegetarian! # carnivore . 1 1! # omnivore 1 . 1! # vegetarian 1 1 .! ! This is the parameter values including its standard error: ! # Parameter estimates:! # rate index estimate std-err! # 1 0.0083 7e-04! ! This is the marginal reconstructions at the root (each row should add to 1):! ! # Scaled likelihoods at the root (type '...$lik.anc' to get them for all nodes):! # carnivore omnivore vegetarian ! 14 # 0.5489050 0.1842301 0.2668649 ! Ancestral reconstruction using ‘ape’ • you can call the marginal probabilities at any node along the tree ! food_bird_ace_ER$lik.anc# Marginal values for each node, each row should add to ~1.0! ! # carnivore omnivore vegetarian! # [1,] 5.489050e-01 1.842301e-01 2.668649e-01! # [2,] 3.832150e-01 3.246254e-01 2.921596e-01! # [3,] 5.018158e-01 1.908888e-01 3.072954e-01! # [4,] 7.351661e-01 1.519711e-01 1.128628e-01! # [5,] 8.025606e-01 1.880971e-01 9.342243e-03! ! 15 Ancestral reconstruction using ‘ape’ • Let's explore the ”SYM" model: ! food_bird_ace_SYM <- ace(birds_traits_data$Food, bird_pruned_tree, type="discrete", model = "SYM") #Symmetrical ! food_bird_ace_SYM! ! # Ancestral Character Estimation! #! # Call: ace(x = birds_traits_data$Food, phy = bird_pruned_tree, type = "discrete", model = "SYM")! #! # Log-likelihood: -401.9363 ! #! # Rate index matrix:! # carnivore omnivore vegetarian! # carnivore . 1 2! # omnivore 1 . 3! # vegetarian 2 3 .! #! # Parameter estimates:! # rate index estimate std-err! # 1 0.0111 0.0016! # 2 0.0044 0.0009! # 3 0.0129 0.0024! #! # Scaled likelihoods at the root (type '...$lik.anc' to get them for all nodes):! # carnivore omnivore vegetarian ! # 0.5452463 0.2518925 0.2028612 ! ! 16 Ancestral reconstruction using ‘ape’ • Let's explore the ”SYM" model: ! food_bird_ace_SYM <- ace(birds_traits_data$Food, bird_pruned_tree, type="discrete",
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages43 Page
-
File Size-