Learn R Programming

DNAseqtest (version 1.0)

gn3sim: Generating Random DNA Samples Using the Rambaut and Grassly Method

Description

This function generates random DNA samples using Rambaut and Grassly method.

Usage

gn3sim(theta, seqLength, merge2)

Arguments

theta
a vector of variables containing the following parameters in this order--1. the first three parameters from $\pi_X$ vector, 2. the first three parameters from $\pi_Y$ vector, 3. the first three parameters from $f_0$ vector, 4. the six off-diagonal free parameters in the S matrix, 5. a scalar $\rho$, 6. a vector of lengths containing K-2 values
seqLength
the length of sequences we need to generate
merge2
(K-1) x 2 matrix describing the tree topology

Value

Details

This function generates a $4^K$ DNA array using Rambaut and Grassly, (1997) method. It depends on a set of variables theta, the sequence length and a merge matrix describing the tree topology.

References

Faisal Ababneh, Lars S Jermiin, Chunsheng Ma, John Robinson (2006). Matched-pairs tests of homogeneity with applications to homologous nucleotide sequences. Bioinformatics, 22(10), 1225-1231.

See Also

Ntml, simapp, simemb, gn, gn2, Fmatrix

Examples

Run this code
# This will give 4^5 observed divergence array
theta<-(c(rep(.25,3), rep(.25,3), rep(.25,3), c(.2,.35,.79,.01,.93,.47),
3,.1,.5,.8))
n<-1000
merge2<-matrix(c(-1,-4,-3,2,-2,-5,1,3), 4, 2)
gn3<-gn3sim(theta, n, merge2)
gn3

Run the code above in your browser using DataLab