Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

genSeq

Simulate a DNA alignment on the tree under a model


Description

Simulates DNA sequence on tree under the specified model. Uses sim.Mk internally.

Usage

genSeq(tree, l=1000, Q=NULL, rate=1, format="DNAbin", ...)

Arguments

tree

object of class "phylo".

l

length of desired sequences.

Q

transition matrix for the simulation. Row and column names (c("a","c","g","t"), although not necessarily in that order) should be provided. If NULL, a single rate is assumed.

rate

multiplier for Q, or a vector for Γ rate heterogeneity.

format

format of the output object. Can be "DNAbin", "phyDat", or "matrix".

...

optional arguments.

Value

An object of class "DNAbin" or "phyDat", or a matrix of nucleotides.

Author(s)

References

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

Examples

data(mammal.tree)
mammal.tree$edge.length<-mammal.tree$edge.length/
    max(nodeHeights(mammal.tree))*0.2 ## rescale tree
## simulate gamma rate heterogeneity
gg<-rgamma(n=100,shape=0.25,rate=0.25)
dna<-genSeq(mammal.tree,l=100,rate=gg)

phytools

Phylogenetic Tools for Comparative Biology (and Other Things)

v0.7-70
GPL (>= 2)
Authors
Liam J. Revell
Initial release
2020-9-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.