[adegenet-commits] r527 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 8 18:40:37 CET 2010


Author: jombart
Date: 2010-01-08 18:40:37 +0100 (Fri, 08 Jan 2010)
New Revision: 527

Modified:
   pkg/R/haploSim.R
Log:
added a seqTrackG for haploSim objects.


Modified: pkg/R/haploSim.R
===================================================================
--- pkg/R/haploSim.R	2010-01-08 17:27:07 UTC (rev 526)
+++ pkg/R/haploSim.R	2010-01-08 17:40:37 UTC (rev 527)
@@ -416,6 +416,31 @@
 
 
 
+
+#####################
+## seqTrackG.haploSim
+#####################
+seqTrackG.haploSim <- function(x, optim=c("min","max"), ...){
+    myX <- dist.dna(x$seq, model="raw")
+    x.names <- labels(x)
+    x.dates <- as.POSIXct(x)
+    seq.length <- ncol(x$seq)
+    myX <- myX * seq.length
+    prevCall <- as.list(x$call)
+    if(is.null(prevCall$mu)){
+        mu0 <- 0.0001
+    } else {
+        mu0 <- eval(prevCall$mu)
+    }
+    res <- seqTrackG(myX, x.names=x.names, x.dates=x.dates, best=optim,...)
+    return(res)
+}
+
+
+
+
+
+
 ##############################
 ## optimize.seqTrack.haploSim
 ##############################



More information about the adegenet-commits mailing list