genSeq: Simulate a DNA alignment on the tree under a model

Description Usage Arguments Value Author(s) References Examples

View source: R/sim.history.R

Description

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

Usage

1
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 Gamma 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)

Liam Revell [email protected]

References

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

Examples

1
2
3
4
## simulate gamma rate heterogeneity
tree<-pbtree(n=26,tip.label=LETTERS)
gg<-rgamma(n=100,shape=0.25,rate=0.25)
X<-genSeq(tree,l=100,rate=gg)

Example output

Loading required package: ape
Loading required package: maps
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
simulating sequences....
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).
Done simulation(s).

phytools documentation built on Nov. 17, 2017, 6:24 a.m.