################################################################################ # # RevBayes Example: Total-evidence dating under the fossilized birth-death model # # This file: Runs the full MCMC ... # # authors: Tracy A. Heath, Walker C. Pett, April M. Wright # ################################################################################ ####################### # Reading in the Data # ####################### # Create the full list of taxa (including all fossils and extant species # taxa <- readTaxonData("data/bears_taxa.tsv") # Import the molecular sequences # # this file contains only the taxa for which sequence data are available # cytb <- readDiscreteCharacterData("data/bears_cytb.nex") # Import the morphological character matrix # # this file contains only the taxa for which morphological characters are available # morpho <- readDiscreteCharacterData("data/bears_morphology.nex") # Add the missing taxa to each data partition # cytb.addMissingTaxa( taxa ) morpho.addMissingTaxa( taxa ) ## helpers n_taxa <- taxa.size() moves = VectorMoves() # Load the model files source("scripts/model_FBDRP.Rev") # FBD tree prior source("scripts/model_UExp.Rev") # UExp relaxed clock source("scripts/model_GTRG.Rev") # Molecular substitution model (GTR+G) source("scripts/model_Morph.Rev") # Morphological character change model ######## # MCMC # ######## # initialize the model object # mymodel = model(sf) monitors = VectorMonitors() # Create a vector of monitors # # 1. for the full model # monitors.append( mnModel(filename="output/bears.log", printgen=10) ) # 2. the tree # monitors.append( mnFile(filename="output/bears.trees", printgen=10, pruned_tree) ) # 3. and a few select parameters to be printed to the screen # monitors.append( mnScreen(printgen=10, age_extant, num_samp_anc, origin_time) ) # Initialize the MCMC object # mymcmc = mcmc(mymodel, monitors, moves) # Run the MCMC # mymcmc.run(generations=10000) # Quit RevBayes # q()