/examples/example_V2.1.1.R

http://github.com/sbotond/phylosim · R · 16 lines · 5 code · 4 blank · 7 comment · 0 complexity · 7d210a350aad2977f4d6bf0c3c431570 MD5 · raw file

  1. #!/usr/bin/env Rscript
  2. ##
  3. ## Example V2.1.1: Simulating substitutions under the JC69 model - compact example
  4. ## See also the package vignette (vignette("PhyloSim",package="phylosim")).
  5. ##
  6. # load PhyloSim
  7. library("phylosim")
  8. # Run the simulation, display the alignment matrix:
  9. Simulate(PhyloSim(
  10. root.seq=sampleStates( NucleotideSequence(len=50,proc=list(list(JC69())) )),
  11. phylo=read.tree("data/3taxa.nwk")
  12. ))$alignment