tree_add_dates: Add missing taxa to a dated tree and fabricate node ages for...

View source: R/tree_add_dates.R

tree_add_datesR Documentation

Add missing taxa to a dated tree and fabricate node ages for these missing taxa.

Description

This function adds missing taxa to a chronogram given in dated_tree. It is still work in progress.

Usage

tree_add_dates(
  dated_tree = NULL,
  missing_taxa = NULL,
  dating_method = "mrbayes",
  adding_criterion = "random",
  mrbayes_output_file = "mrbayes_tree_add_dates.nexus"
)

Arguments

dated_tree

a tree (newick or phylo) with branch lengths proportional to absolute time

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.

dating_method

The method used for tree dating, options are "mrbayes" and "bladj".

adding_criterion

Only used when dating_method = "mrbayes". A character vector to specify how missing_taxa should be added to dated_tree. Choose one of:

adding_method = "random"

missing_taxa will be added at random to dated_tree.

adding_method = "taxonomy"

taxa will be added to dated_tree following a dataframe with taxonomic assignations given in missing_taxa argument. If no dataframe is given, OpenTree's reference taxonomy will be used.

adding_method = "tree"

taxa will be added to dated_tree following a tree given in missing_taxa argument. If no tree is given, OpenTree's synthetic tree will be used.

mrbayes_output_file

A character vector specifying the name of mrBayes run file and outputs (can specify directory too).

Value

A phylo object.


datelife documentation built on July 10, 2023, 2:02 a.m.