treeMCMCtree: Generating a tree file in MCMCtree format when using...

View source: R/morpho.R

treeMCMCtreeR Documentation

Generating a tree file in MCMCtree format when using morphological data

Description

Outputs a tree file to be used in MCMCtree. The path to this file needs to be written next to the option "treefile = " in the control file for MCMCtree.

Usage

treeMCMCtree(tree, aln, filename)

Arguments

tree

Character, path to the file with the tree topology in Newick format, without branch lengths (see details).

aln

Character, path to the alignment file output by write.morpho or proc2MCMCtree.

filename

Character, name for the output file.

Details

If you used write.morpho or proc2MCMCtree and passed a vector or a list with the ages of the specimens in your alignment, you will see that the names in the output file with this alignment are followed by a "^" and a value. This value is transformed to the age you input within MCMCtree, as if it was a tip date, and used to estimate the divergence times of the species in your phylogeny. This function generates a tree file with the same species names than in the morphological alignment, i.e. with the ages to be used by MCMCtree next to the names of each specimen. Remember to write the path to the tree file next to the "treefile = " option in the control file to run MCMCtree. Remember that the names without "^" followed by the ages have to be the same in the file you pass to parameter "tree" than the ones you have in the alignment file passed to "aln".

Examples


# Use the file with the tree topology (no branch lengths) and the
# file with the morphological alignment that are saved in the
# inst/extdata directory to generate a tree file with the
# ages used by MCMCtree included.
# We call the output tree file "treefile.txt".
   tree <- system.file( "extdata", "19s.trees", package = "mcmc3r")
   aln  <- system.file( "extdata", "seqfile.aln", package = "mcmc3r")
   treeMCMCtree( tree = tree, aln = aln, filename = "treefile.txt" )


dosreislab/mcmc3r documentation built on March 29, 2024, 6:45 p.m.