View source: R/simulate_alignment.R
simulate_alignment | R Documentation |
This function simulates a sequence alignment on a given phylogenetic tree according to a K80 model of DNA substitution.
simulate_alignment(tree, mu=0.5, N=300, proportion_variant=0.1)
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) |
The function outputs a nucleotidic alignment (as a matrix with each row corresponding to a sequence per tip of the tree).
Benoit Perez-Lamarque
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.
sim_microbiota
HOME_model
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.