simulate_evolution: Generation of a states alignment

View source: R/functions.R

simulate_evolutionR Documentation

Generation of a states alignment

Description

This function simulates evolution given an evolutionary model and a phylogenetic tree resulting in the generation of a states table (alignment). It is possible to add a noise to the final result that could represent, e.g., sequencing errors.

Usage

simulate_evolution(
  nstates,
  tree,
  Q,
  pi,
  noise_sd = 0,
  discretization = NA,
  small_num = 1e-04
)

Arguments

nstates

Number of sites to be simulated (= number of rows of resulting states table).

tree

Phylogenetic tree of class phylo used for simulation of evolution (branch lengths required!).

Q

Numerical n x n matrix representing the substittion rate matrix of the evolutionary model to be used, with n being the number of states in the model.

pi

Numerical vector of size n representing the equilibrium frequency, with n being the number of states in the model.

Examples

test

Hoffmann-Lab/PhyloEpiGenomics documentation built on Feb. 12, 2023, 9:06 p.m.