[Mattice-commits] r72 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 3 22:16:15 CET 2008


Author: andrew_hipp
Date: 2008-12-03 22:16:14 +0100 (Wed, 03 Dec 2008)
New Revision: 72

Modified:
   pkg/R/ouSim.R
   pkg/R/ouSimHead.R
Log:
misc. simulation updates

Modified: pkg/R/ouSim.R
===================================================================
--- pkg/R/ouSim.R	2008-12-03 16:23:13 UTC (rev 71)
+++ pkg/R/ouSim.R	2008-12-03 21:16:14 UTC (rev 72)
@@ -1,4 +1,4 @@
-ouSim <- function(phy, rootState = 0, shiftBranches = NULL, shiftStates = NULL, alpha = 0, variance = 1, theta = rootState, model = "OU", branchMeans = NULL, steps = 1000) {
+ouSim.phylo <- function(phy, rootState = 0, shiftBranches = NULL, shiftStates = NULL, alpha = 0, variance = 1, theta = rootState, model = "OU", branchMeans = NULL, steps = 1000) {
 ## function to plot a simulated dataset under brownian motion or Ornstein-Uhlenbeck (OU) model
 ## Arguments:
 ##   phy is an ape-style tree
@@ -10,6 +10,8 @@
 ##  "platt" is the Platt-Molitor model, in which the only phylogenetic effect is the mean and variance for a given branch
 ## Andrew Hipp (ahipp at mortonarb.org), January 2008 
 ## July 2008: modified to accomodate a vector of alpha and theta corresponding to branches
+## Dec 2008: This function I'm leaving as is for the time being and just letting the phylo method be as raw as always.
+##           New developments will be in the ouchtree, brown, hansen, and hansenBatch methods
 
 preorderOU <- function(branchList, phy, startNode, startState, alpha, theta) {
 ## Recursive function to generate the data under a Brownian motion or OU model (not needed in the Platt model)

Modified: pkg/R/ouSimHead.R
===================================================================
--- pkg/R/ouSimHead.R	2008-12-03 16:23:13 UTC (rev 71)
+++ pkg/R/ouSimHead.R	2008-12-03 21:16:14 UTC (rev 72)
@@ -1,9 +1,10 @@
 ouSim <- function(tree, ...) {
+# right now this is just a switcher, but eventually these should be turned into proper methods of a generic ouSim
   switch(class(tree), 
          phylo = ouSim.phylo(tree, ...),
          ouchtree = ouSim.ouchtree(tree, ...),
-         brown = ouSim.brown(tree, ...),
-         hansen = ouSim.hansen(tree, ...),
+         brown = ouSim.brownHansen(tree, ...),
+         hansen = ouSim.brownHansen(tree, ...),
          batchHansen = ouSim.batchHansen(tree, ...),
          "Unrecognized tree class"
          )



More information about the Mattice-commits mailing list