[adegenet-commits] r311 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 19 23:44:35 CEST 2009


Author: jombart
Date: 2009-05-19 23:44:35 +0200 (Tue, 19 May 2009)
New Revision: 311

Modified:
   pkg/R/seqTrack.R
Log:
started checktime to detect uncertain times.


Modified: pkg/R/seqTrack.R
===================================================================
--- pkg/R/seqTrack.R	2009-05-15 17:30:08 UTC (rev 310)
+++ pkg/R/seqTrack.R	2009-05-19 21:44:35 UTC (rev 311)
@@ -170,8 +170,45 @@
 
 
 
+#############
+## checkTime
+#############
+## x: result of seqTrack
+## mu0: mutation rate / site / year
+## p: threshold probability for a sequence not to mutate
+checkTime <- function(x, mu0, seq.dates, seq.length, p=0.95){
+    mu <- mu0/365 # mutation rate / site / day
+    t <- 0:1000 # in days
+    Pt <- (1-mu)^(t*seq.length)
+    ##plot(Pt,ylim=c(0,1))
+    nbDays <- min(which.min(Pt>p)-1, 0)
 
+    date.from <- seq.dates[unlist(x[1,])]
+    date.to <- seq.dates[unlist(x[2,])]
 
+    diffDates <- (date.to-date.from) < nbDays*2
+
+
+} # end checkTime
+
+
+
+
+
+
+
+###############
+## seqTrack.ml
+###############
+seqTrack.ml <- function(aln, seq.dates, , optim=c("min","max"), ...){
+
+} # end seqTrack.ml
+
+
+
+
+
+
 #########################
 ## OLD ADD-HOC VERSION
 #########################



More information about the adegenet-commits mailing list