get_mrbayes_node_constraints: Makes a block of node constraints and node calibrations for a...

View source: R/make_mrbayes_tree.R

get_mrbayes_node_constraintsR Documentation

Makes a block of node constraints and node calibrations for a MrBayes run file from a list of taxa and ages, or from a dated tree

Description

Makes a block of node constraints and node calibrations for a MrBayes run file from a list of taxa and ages, or from a dated tree

Usage

get_mrbayes_node_constraints(
  constraint = NULL,
  taxa = NULL,
  missing_taxa = NULL,
  ncalibration = NULL,
  age_distribution = "fixed",
  root_calibration = FALSE,
  mrbayes_constraints_file = NULL,
  clockratepr = "prset clockratepr = fixed(1);"
)

Arguments

constraint

The constraint tree: a phylo object or a newick character string, with or without branch lengths.

taxa

A character vector with taxon names to be maintained in tree

missing_taxa

A tree, a data frame or a vector enlisting all missing taxa you want to include.

A tree

Either as a phylo object or as a newick character string. It contains all taxa that you want at the end, both missing and non missing. This tree will be used as a hard constraint.

A data.frame

It contains two columns named "taxon" and "clade". The first one contains a character vector of missing taxon names. The second one contains a character or numeric vector of nodes from a constraint tree to which each taxon will be assigned.

A character vector

It contains the names of the missing taxa. They will be added at random to the constraint tree.

ncalibration

The node calibrations: a phylo object with branch lengths proportional to time; in this case all nodes from ncalibration will be used as calibration points. Alternatively, a list with two elements: the first is a character vector with node names from phy to calibrate; the second is a numeric vector with the corresponding ages to use as calibrations.

age_distribution

A character string specifying the type of calibration. Only "fixed" and "uniform" are implemented for now.

fixed

The age given in ncalibration will be used as fixed age.

lognormal

The age given in ncalibration will be used as mean age. The standard deviation can be provided. # still need to add this option. By default, a 95 CI sd is used.

uniform

The age given in ncalibration will be used as mean age. Where min_age = 0.9 * mean age, and max_age = 1.1 * mean age.

root_calibration

Used to set a calibration at the root or not. Default to FALSE. Only relevant if ncalibration is specified.

mrbayes_constraints_file

NULL or a character vector indicating the name of mrbayes constraint and/or calibration block file.

clockratepr

A character vector indicating the clockrateprior to be used.

Value

A set of MrBayes constraints and/or calibration commands printed in console as character strings or as a text file specified in mrbayes_constraints_file.


phylotastic/datelife documentation built on June 9, 2024, 6:50 p.m.