Learn R Programming

phyclust (version 0.1-9)

seqgen: Seq-Gen

Description

This function modifies the original standalone code of seq-gen developed by Rambaut, A. and Grassly, N.C. (1997).

Usage

seqgen(opts = NULL, rooted.tree = NULL, newick.tree = NULL,
       input = NULL)

Arguments

opts
options as the standalone version.
rooted.tree
a rooted tree which sequences are generated according to.
newick.tree
a NEWICK tree which sequences are generated according to.
input
optional inputs of seq-gen, e.g. ancestral sequences.

Value

  • This function returns a vector, and each element stores one line of stdout of seq-gen separated by newline, and store as a class seqgen. The details of output format can found on the website http://tree.bio.ed.ac.uk/software/seqgen/ and its manual.

Bug(s)

An unsolved minor bug is that memory unreleased thoroughly caused by reopen a file pointer to the same file without calling a function, fclose.

Details

This function directly reuses the C code of seq-gen by arguments as input from the stdin. The options opts is followed from the original seq-gen except an input tree.

Input either a rooted.tree or a newick.tree, and rooted.tree should have a Class phylo.

For examples, options commonly used in phyclust are:

  • "-m": set an evolution model, e.g. "-mHKY".
  • "-t": set transition/transversion ratio, e.g. "-t0.7".
  • "-f": equilibrium probabilities of A, C, G, and T, e.g. "-f0.1,0.2,0.3,0.4".
  • "-l": length of sequences, e.g. "-l10".
  • "-s": scale rate for the total height of input tree, "-s0.2".
  • "-k": index of ancestral sequence in input file, seegen.seq.HKY.
These will return sequences in Format phylip which can be read by read.seqgen and transfered into an object with Class seq.data.

Note:

  • seq-genuse the order A, C, G, T.
  • -tis ts/tv ratio which is not equal to$\kappa$.
  • See more examples ingen.seq.HKYandgen.seq.SNP.

References

Phylogenetic Clustering Website: http://thirteen-01.stat.iastate.edu/snoweye/phyclust/

Rambaut, A. and Grassly, N.C. (1997) Seq-Gen: An Application for the Monte Carlo Simulation of DNA Sequence Evolution along Phylogenetic Trees, Computer Applications In The Biosciences, 13:3, 235-238. http://tree.bio.ed.ac.uk/software/seqgen/

See Also

print.seqgen, read.tree, ms, gen.seq.HKY, gen.seq.SNP.

Examples

Run this code
set.seed(123)
ret.ms <- ms(nsam = 5, nreps = 1, opts = "-T")
seqgen(opts = "-mHKY -l40 -s0.2", newick.tree = ret.ms[3])

Run the code above in your browser using DataLab