knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
BAMM
through outsider
in RBayesian Analysis of Macroevolutionary Mixtures: multimodel inference on speciation and trait evolution.
library(outsider) module_install(repo = "DomBennett/om..bamm") #module_help(repo = "DomBennett/om..bamm")
The example below is taken from the "Quickstart" guide to BAMM
# ------ # Import # ------ library(outsider) bamm <- module_import(fname = 'bamm', repo = "DomBennett/om..bamm") # ---- # Data # ---- # create temp directory to contain test input and output data wd <- file.path(tempdir(), 'testing_bamm') if(!dir.exists(wd)) { dir.create(wd) } # download modified template control file for a "speciation-extinction" # analysis of whales url <- 'https://raw.githubusercontent.com/DomBennett/om..bamm/master/test_data/whale_diversification.txt' control_file <- file.path(wd, 'whale_diversification.txt') download.file(url = url, destfile = control_file) # download a tree whales url <- 'https://raw.githubusercontent.com/DomBennett/om..bamm/master/test_data/whaletree.tre' download.file(url = url, destfile = file.path(wd, 'whaletree.tre')) # -------- # Run BAMM # -------- # run bamm in R by specifying the control file and the directory containing the # whale tree bamm(control_file = control_file, indir = wd, outdir = wd) # ------ # Verify # ------ # Double check the output, all resulting files are stored in outdir list.files(wd) # peek into the mcmc_out.txt print(read.csv(file.path(wd, 'mcmc_out.txt')))
# delete temp dir if ('wd' %in% ls() && dir.exists(wd)) { unlink(x = wd, recursive = TRUE, force = TRUE) } module_uninstall(repo = "DomBennett/om..bamm")
The bamm
function in R has three arguments:
control_file
: File path to the text file that specifies all of the
parameters of the analysisindir
: File path to the directory containing all of the input files
(e.g. the tree file). (It's best to make this folder contain only the input
files.)outdir
: File path to the directory which will collect all the output files.Find out more by visiting the BAMM documentation website.
An outsider
module
Learn more at outsider website.
Want to build your own module? Check out outsider.devtools
website.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.