ontobayes: Builds MrBayes NEXUS files for subsets of characters...

View source: R/ontobayes.R

ontobayesR Documentation

Builds MrBayes NEXUS files for subsets of characters annotated with ontology anatomy terms.

Description

Builds MrBayes NEXUS files for subsets of characters annotated with ontology anatomy terms.

Usage

ontobayes(
  ids = ids,
  dataset = "data/matrix.nex",
  outgroup = "outroup_taxon",
  rates = "gamma",
  coding = "all",
  ratepr = "fixed",
  brlenspr = "Unconstrained:Exp(10)",
  gen = 1e+06,
  runs = 2,
  chains = 4,
  freq = 1000
)

Arguments

ids

data.frame, matches between characters and anatomical entities. The first column should provide character ids in the same order as presented in the character matrix. The second column should provide the respective ontology ids referring to the anatomical entities. The third column should provide the respective ontology terms referring to the anatomical entities. See examples provided in the data folder (data1.csv and data2.csv).

dataset

character, name of the NEXUS file with the character matrix to be read.

outgroup

character, name of the outgroup taxon.

rates

character, sets the model of among-character rate variation in the MrBayes commands block. Default is set to "equal".

coding

character, sets the coding bias in the MrBayes commands block. Default is set to "all".

ratepr

character, sets the character specific or partition specific rates model in the MrBayes commands clock. Default is set to "fixed".

brlenspr

character, sets the branch lengths prior in the MrBayes commands block. Deafault is set to "Unconstrained:Exp(10)".

gen

integer, sets the number of generations of mcmc in the MrBayes commands block. Default is set to 1000000.

runs

integer, sets the number of independent runs of mcmc in the MrBayes commands block. Default is set to 2.

chains

integer, sets the number of chains for each run in the MrBayes commands block. Default is set to 4.

freq

integer, sets the sampling frequency for the mcmc in the MrBayes commands block. Default is set to 1000.

Value

Individual NEXUS files for each subset of characters annotated with ontology anatomy terms. The files will be organized in individual subfolders inside the folder NEXUS/ALL_PART.

Examples

## Not run: 
# HAO example #
# Create ID object #
ID <- as.data.frame(cbind(paste0("C", 1:40),
c(rep("HAO:0000506",5), rep("HAO:0000513",5), rep("HAO:0000453",5), rep("HAO:0000234",5), 
rep("HAO:0001003",5), rep("HAO:0000874",5), rep("HAO:0000583",5), rep("HAO:0000630",5)),
c(rep("mandible",5), rep("maxilla",5), rep("labium",5), rep("cranium",5)
, rep("tentorium",5), rep("prothorax",5), rep("mesothorax",5), rep("metathorax",5))))

# Create MrBayes partition files #
ontobayes(ids = ID, dataset = "data/matrix1.nex", outgroup = "sp1", rates = "gamma", 
coding = "all", gen = 1000000, runs = 2, chains = 4)

# UBERON example #
# Create ID object #
ID <- as.data.frame(cbind(paste0("C", 1:40),
c(rep("UBERON_0002244",5), rep("UBERON_0002397",5), rep("UBERON_0004742",5), rep("UBERON_2000658",5), 
rep("UBERON_2000488",5), rep("UBERON_0000151",5), rep("UBERON_0000152",5), rep("UBERON_0003097",5)),
c(rep("premaxilla",5), rep("maxilla",5), rep("dentary",5), rep("epibranchial bone",5)
, rep("ceratobranchial bone",5), rep("pectoral fin",5), rep("pelvic fin",5), rep("dorsal fin",5))))

# Create MrBayes partition files #
ontobayes(ids = ID, dataset = "data/matrix2.nex", outgroup = "sp1", rates = "gamma", 
coding = "all", gen = 1000000, runs = 2, chains = 4)

## End(Not run)


diegosasso/ontobayes documentation built on May 3, 2022, 10:23 p.m.