simulate_alignment: Simulate a sequence alignment on a phylogentic tree

View source: R/simulate_alignment.R

simulate_alignmentR Documentation

Simulate a sequence alignment on a phylogentic tree

Description

This function simulates a sequence alignment on a given phylogenetic tree according to a K80 model of DNA substitution.

Usage

simulate_alignment(tree, mu=0.5, N=300, proportion_variant=0.1)

Arguments

tree

a n-tips, binary, rooted, and ultrametric tree to simulate the alignments on it. All branch lengths must be >0.

mu

a positive value representing the simulated substitution rate.

N

a positive integer value representing the total number of nucleotides (variable and unvariable nucleotides)

proportion_variant

a value between 0 and 1 representing the proportion of variable nucleotides among N (i.e. each site has a probability "proportion_variant" to be variable)

Value

The function outputs a nucleotidic alignment (as a matrix with each row corresponding to a sequence per tip of the tree).

Author(s)

Benoit Perez-Lamarque

References

Perez-Lamarque B, Morlon H (2019). Characterizing symbiont inheritance during host-microbiota evolution: Application to the great apes gut microbiota. Molecular Ecology Resources 19:1659-1671.

See Also

sim_microbiota HOME_model

Examples


set.seed(3)
tree <- phytools::pbtree(n=20) # simulate host phylogeny


# simulate an alignment
simulate_alignment(tree, mu=0.1, N=300, proportion_variant=0.1)



BPerezLamarque/HOME documentation built on May 17, 2023, 7:02 a.m.