simChrom: simulates chromosome number data

View source: R/simChrom.R

simChromR Documentation

simulates chromosome number data

Description

Provides a simulation of chromosome number evolution based on tree and one of 4 models or a user provided q-matrix. This function uses diversitrees sim.character to perform simulation.

Usage

simChrom(tree, pars, limits, model, Qmat, verbose)

Arguments

tree

a phylogenetic tree of the class phylo

pars

numeric vector of paramters the length of this vector depends on the model specified see details below

limits

numeric vector of length 2 with upper and lower limit for chromosome number. Defaults to NULL

model

A text string indicating the model for the simulation. Options are "2010", "ChromPlus", "PloidEvol", or "SAF". Defaults to NULL

Qmat

A user provided q-matrix which describes the desired model of chromosome evolution. Transitions should be filled in with desired rates. Diagonals and rowsums will automatically be set to equal 0. Function currently doesn't support user provided q-matrices with hyperstates. Defaults to NULL

verbose

Binary argument giving whether or not to return parameter matrix used to build model. Defaults to FALSE

Details

The model chosen will determine the correct form of the numeric vector supplied to the pars argument.

If model="2010" the pars vector should be length 5:
chromosome gain
chromosome loss
demipolyploidy
polyploidy
chromosome number at the root of the tree.


If model="ChromPlus" or "SAF" then the numeric vector supplied to pars should be length 12:
chromosome gain in hyperstate/fusion state 1
chromosome gain in hyperstate/fusion state 2
chromosome loss in hyperstate/fusion state 1
chromosome loss in hyperstate/fusion state 2
demiploidy in hyperstate/fusion state 1
demiploidy in hyperstate/fusion state 2
polyploidy in hyperstate/fusion state 1
polyploidy in hyperstate/fusion state 2
transition from hyperstate/fusion state 1 to 2
transition from hyperstate/fusion state 2 to 1
chromosome number at the root of the tree
hyperstate/fusion state at the root of the tree (0=hyperstate 1/unfused, 1 =hyperstate 2/fused)


If model="PloidEvol" then the numeric vector supplied to pars should be length 11:
chromosome gain in diploids
chromosome gain in polyploids
chromosome loss in diploids
chromosome loss in polyploids
demiploidy in diploids
demiploidy in polyploids
polyploidy in diploids
polyploidy in polyploids
rediploidization
chromosome number at the root of the tree.
ploidy level at the root of the tree (0=diploid, 1=polyploid)


If model=NULL then the numeric vector supplied to pars should be length 1:
chromosome number at the root of the tree.

Value

a named numeric vector representing chromosome numbers at the tips of the tree is returned for model="2010" and model=NULL. For model="ChromPlus", model="PloidEvol", and model="SAF" a list of length 2 is returned containing a vector of chromosome numbers for tips of the tree as well as a vector containing the hyperstate or ploidy for each tip. If verbose=T, the parameter matrix used to simulate the data is also returned.

Author(s)

Heath Blackmon


coleoguy/chromevolR documentation built on July 27, 2023, 12:40 p.m.