[adegenet-commits] r339 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 1 19:24:59 CEST 2009


Author: jombart
Date: 2009-06-01 19:24:59 +0200 (Mon, 01 Jun 2009)
New Revision: 339

Modified:
   pkg/R/seqTrack.R
Log:
Re-added the directionality according to .pAbeforeB


Modified: pkg/R/seqTrack.R
===================================================================
--- pkg/R/seqTrack.R	2009-06-01 11:08:52 UTC (rev 338)
+++ pkg/R/seqTrack.R	2009-06-01 17:24:59 UTC (rev 339)
@@ -124,8 +124,10 @@
     if(showAmbiguous & (is.null(mu0) | is.null(seq.length)) ){
         stop("showAmbiguous is TRUE, but mu0 and seq.length are not all provided.")
     }
+
     isAmbig <- NULL
 
+
     ## SUBSET DATA (REMOVE NAs) ##
     isNA <- is.na(x[,2])
     x <- x[!isNA,,drop=FALSE]
@@ -133,6 +135,13 @@
     xy <- xy[!isNA,,drop=FALSE]
 
 
+    ## FIND AMBIGUOUS TEMPORAL ORDERING ##
+    if(showAmbiguous){
+        temp <- .pAbeforeB(x$ances.date, x$date, mu0, seq.length)
+        isAmbig <- temp < prob
+    }
+
+
     ## FIND SEGMENTS COORDS ##
     from <- unlist(x[,2])
     to <- unlist(x[,1])
@@ -240,13 +249,6 @@
         if(plot) segments(x.from, y.from, x.to, y.to, col=col,...)
     }
 
-    ## ## AMBIGUOUS SEGMENTS
-    ##     if(showAmbiguous){
-    ##         isAmbig <- .ambigDates(x, mu0, seq.length, p)
-    ##         if(any(isAmbig)){
-    ##             segments(x.from[isAmbig], y.from[isAmbig], x.to[isAmbig], y.to[isAmbig], col="green", lty=2,...)
-    ##         }
-    ##     }
 
     if(annot & plot) text(xy,lab=rownames(x), font=2)
 
@@ -377,7 +379,7 @@
 #####################
 ## optimize.seqTrack
 #####################
-optimize.seqTrack <- function(nsim, seq.names, seq.dates, W, optim=c("min","max"),
+optimize.seqTrack <- function(nsim, seq.names, seq.dates, W, thres, optim=c("min","max"),
                               proxMat=NULL, mu0, seq.length, rMissDate=.rUnifTimeSeq, ...){
 
     ## CHECKS ##



More information about the adegenet-commits mailing list