mrbayes_input: Generate input file for 'MrBayes'

View source: R/mrbayes_input.R

mrbayes_inputR Documentation

Generate input file for MrBayes

Description

Takes a list of data matrices and converts into a NEXUS file that can be read by MrBayes. Can be used for multiple data partitions and data types.

Usage

mrbayes_input(dat.list, type.vec, set.vec, out.file)

Arguments

dat.list

List: Each index contains a matrix for a data partition. Could be a matrix of morphological characters, DNA alignments for a gene, etc. Row names are taxa, column names are the characters, with cells containing the character states per taxa.

type.vec

Character: A vector of the data partition types (the matrices in dat.list), as per MrBayes "datatype" requirements: "Standard", "DNA", "RNA", "Protein", or "Restriction". Note that the length of type.vec must be the same as the length (number of data partitions) in dat.list.

set.vec

Character: A vector of the data partition sets (the matrices in dat.list), effectively a set of user defined names/IDs for the data partitions. Used for generating the "charset" specifications in MrBayes.

out.file

Character: A single value, the name of the NEXUS file to save.

Details

Primary functionality is to convert data generated in R into NEXUS. Calculates data ranges and sets up partitions. Addition of MrBayes run commands are not supported.

Value

Writes a NEXUS file.


j-a-thia/genomalicious documentation built on Oct. 19, 2024, 7:51 p.m.