[adegenet-commits] r620 - in pkg: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon May 10 17:34:05 CEST 2010


Author: jombart
Date: 2010-05-10 17:34:05 +0200 (Mon, 10 May 2010)
New Revision: 620

Modified:
   pkg/R/seqTrack.R
   pkg/man/seqTrack.Rd
Log:
Done with arguments.



Modified: pkg/R/seqTrack.R
===================================================================
--- pkg/R/seqTrack.R	2010-05-10 15:12:33 UTC (rev 619)
+++ pkg/R/seqTrack.R	2010-05-10 15:34:05 UTC (rev 620)
@@ -24,15 +24,10 @@
     UseMethod("get.likelihood")
 }
 
-get.likelihood.seqTrack.default <- function(...){
-    cat("Method not implemented.")
-    return()
-}
 
 
 
 
-
 ########################
 ## seqTrack - basic version
 ########################
@@ -163,8 +158,8 @@
 ################
 ## plotSeqTrack
 ################
-plotSeqTrack <- function(x, xy, useArrows=TRUE, annot=TRUE, labels=NULL,
-                         col=NULL, bg="grey", add=FALSE, quiet=FALSE, dateRange=NULL,
+plotSeqTrack <- function(x, xy, use.arrows=TRUE, annot=TRUE, labels=NULL,
+                         col=NULL, bg="grey", add=FALSE, quiet=FALSE, date.range=NULL,
                          plot=TRUE,...){
 
     ## CHECKS ##
@@ -215,21 +210,21 @@
 
 
     ## HANDLE RANGE OF DATES ##
-    if(!is.null(dateRange)){
+    if(!is.null(date.range)){
 
-        if(is.character(dateRange)){
-            msg <- paste("dateRange is a character vector; " ,
+        if(is.character(date.range)){
+            msg <- paste("date.range is a character vector; " ,
                          "please convert it as dates using 'as.POSIXct'" ,
                          "\n(making sure dates are given as 'YYYY/MM/DD' or 'YYYY-MM-DD').", sep="")
             stop(msg)
         }
 
-        if(any(is.na(dateRange))){
-            stop("NA in dateRange")
+        if(any(is.na(date.range))){
+            stop("NA in date.range")
         }
 
         dates <- x$date
-        toKeep <- (dates > min(dateRange)) & (dates < max(dateRange))
+        toKeep <- (dates > min(date.range)) & (dates < max(date.range))
         if(sum(toKeep)==0) {
             if(!quiet) cat("\nNo item in the specified date range.\n")
             return(NULL)
@@ -263,7 +258,7 @@
     ## PLOTTING ##
     if(plot){
         ## ARROWS
-        if(useArrows){
+        if(use.arrows){
             ## handle segments/arrows with length 0 ##
             nullLength <- (abs(x.from-x.to)<1e-10) & (abs(y.from-y.to)<1e-10)
 

Modified: pkg/man/seqTrack.Rd
===================================================================
--- pkg/man/seqTrack.Rd	2010-05-10 15:12:33 UTC (rev 619)
+++ pkg/man/seqTrack.Rd	2010-05-10 15:34:05 UTC (rev 620)
@@ -8,7 +8,6 @@
 % \alias{optimize.seqTrack.default}
 \alias{get.likelihood}
 \alias{get.likelihood.seqTrack}
-\alias{get.likelihood.seqTrack.default}
 \alias{seqTrack-class}
 % \alias{get.result.by}
 % \alias{get.consensus}
@@ -35,15 +34,14 @@
 \method{seqTrack}{matrix}(x, x.names, x.dates, best = c("min", "max"), prox.mat = NULL, 
     mu = NULL, haplo.length = NULL,  \dots)
 
-plotSeqTrack(x, xy, useArrows = TRUE, annot = TRUE, labels = NULL, 
-    dateRange = NULL, col = NULL, bg = "grey", add = FALSE, quiet = FALSE, 
-    support = NULL, support.thres = 0.5, timeorder.thres = NULL, 
-    mu = NULL, seq.length = NULL, col.pal = heat.colors, plot = TRUE, \dots)
+plotSeqTrack(x, xy, use.arrows=TRUE, annot=TRUE, labels=NULL,
+                         col=NULL, bg="grey", add=FALSE, quiet=FALSE, date.range=NULL,
+                         plot=TRUE, \dots)
 }
 \arguments{
-  \item{x}{for seqTrack, a matrix giving weights to pairs of ancestries such that
-    x[i,j] is the weight of 'i ancestor of j'. For plotSeqTrack, a
-    seqTrack object.}
+  \item{x}{for seqTrack, a matrix giving weights to pairs of ancestries
+    such that x[i,j] is the weight of 'i ancestor of j'. For
+    plotSeqTrack, a seqTrack object.}
   \item{seq.names}{a character vector giving the labels of the haplotypes/genotypes}
   \item{seq.dates}{a vector of collection dates for the sampled
     haplotypes/genotypes. Dates must have the POSIXct format. See
@@ -66,51 +64,26 @@
  \item{haplo.length}{(optional) the length of analysed sequences in
     number of nucleotides. When 'x' contains numbers of mutations, used
     to resolve ties using a maximum likelihood approach (requires
-    \code{mu} to be provided).}
+    \code{mu} to be provided).}  
   \item{xy}{spatial coordinates of the sampled haplotypes/genotypes.}
-  \item{useArrows}{a logical indicating whether arrows should be used to
+  \item{use.arrows}{a logical indicating whether arrows should be used to
     represented ancestries (pointing from ancestor to descendent, TRUE),
     or whether segments shall be used (FALSE).}
   \item{annot}{a logical indicating whether arrows or segments
     representing ancestries should be annotated (TRUE) or not (FALSE).}
   \item{labels}{a character vector containing annotations of the
     ancestries. If left empty, ancestries are annotated by the descendent.}
-  \item{dateRange}{a vector of length two with POSIXct format indicating
-    the time window for which ancestries should be displayed.}
   \item{col}{a vector of colors to be used for plotting ancestries.}
   \item{bg}{a color to be used as background.}
   \item{add}{a logical stating whether the plot should be added to
     current figure (TRUE), or drawn as a new plot (FALSE, default).}
   \item{quiet}{a logical stating whether messages other than errors
     should be displayed (FALSE, default), or hidden (TRUE).}
-  \item{support}{an optional vector of numbers between 0 and 1
-    indicating the support for each ancestry. If provided and if
-    \code{col} is left empty, ancestries are represented with colors
-    indicating the support.}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  
-  \item{col}{}
-  \item{bg}{}
-  \item{add}{}
-  \item{\dots}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
-  \item{}{}
+   \item{date.range}{a vector of length two with POSIXct format indicating
+    the time window for which ancestries should be displayed.}
+  \item{plot}{a logical stating whether a plot should be drawn (TRUE,
+    default), or not (FALSE). In all cases, the
+    function invisibly returns plotting information.}
 }
 \author{
   Thibaut Jombart \email{t.jombart at imperial.ac.uk}
@@ -118,4 +91,29 @@
 \references{
   Jombart T, Eggo R, Dodd P, Balloux F (accepted) Reconstructing disease
   outbreaks from genetic data: a graph approach. Heredity.
+}
+\value{
+  === output of seqTrack ===
+  seqTrack function returns data.frame with the class \code{seqTrack},
+  in which each row is an inferred ancestry described by the following columns:
+  - id: indices identifying haplotypes/genotypes
+  - ances: index of the inferred ancestor
+  - weight: weight of the inferred ancestries
+  - date: date of the haplotype/genotype
+  - ances.date: date of the ancestor
+
+  === output of plotSeqTrack ===
+  This graphical function invisibly returns the coordinates of the
+  arrows/segments drawn and their colors, as a data.frame.
+}
+\details{
+  === Maximum parsimony genealogies ===
+  
+  === Likelihood of observed genetic differentiation ===
+  === Converting seqTrack objects to graphs ===
+
+  
+}
+\seealso{
+  \code{\link{get.likelihood.seqTrack}}
 }
\ No newline at end of file



More information about the adegenet-commits mailing list