[adegenet-commits] r181 - pkg pkg/R pkg/misc/bug-report.1.2-2.01 www

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Sep 25 19:11:25 CEST 2008


Author: jombart
Date: 2008-09-25 19:11:24 +0200 (Thu, 25 Sep 2008)
New Revision: 181

Modified:
   pkg/R/auxil.R
   pkg/TODO
   pkg/misc/bug-report.1.2-2.01/.RData
   pkg/misc/bug-report.1.2-2.01/.Rhistory
   www/acceuil.html
Log:
loc argument in [] operator



Modified: pkg/R/auxil.R
===================================================================
--- pkg/R/auxil.R	2008-09-15 21:41:23 UTC (rev 180)
+++ pkg/R/auxil.R	2008-09-25 17:11:24 UTC (rev 181)
@@ -193,7 +193,7 @@
 ###############
 ## genind
 setMethod("[","genind",
-          function(x, i, j, ..., treatOther=TRUE, drop=FALSE) {
+          function(x, i, j, ..., loc=NULL, treatOther=TRUE, drop=FALSE) {
 
               if (missing(i)) i <- TRUE
               if (missing(j)) j <- TRUE
@@ -206,7 +206,17 @@
                   pop <- temp$pop
                   pop <- factor(pop[i])
               }
-             
+
+              ## handle loc argument
+              if(!is.null(loc)){
+                  loc <- as.character(loc)
+                  temp <- !loc %in% x at loc.fac
+                  if(any(temp)) { # si mauvais loci
+                      warning(paste("the following specified loci do not exist:", loc[temp]))
+                  }
+                  j <- x$loc.fac %in% loc
+              } # end loc argument
+              
               prevcall <- match.call()
               tab <- tab[i, j, ...,drop=FALSE]
               
@@ -239,13 +249,23 @@
 
 ## genpop
 setMethod("[","genpop", 
-          function(x, i, j, ..., treatOther=TRUE, drop=FALSE) {
+          function(x, i, j, ..., loc=NULL, treatOther=TRUE, drop=FALSE) {
 
               if (missing(i)) i <- TRUE
               if (missing(j)) j <- TRUE
 
               tab <- truenames(x) 
-             
+
+              ## handle loc argument
+              if(!is.null(loc)){
+                  loc <- as.character(loc)
+                  temp <- !loc %in% x at loc.fac
+                  if(any(temp)) { # si mauvais loci
+                      warning(paste("the following specified loci do not exist:", loc[temp]))
+                  }
+                  j <- x$loc.fac %in% loc
+              } # end loc argument
+
               prevcall <- match.call()
               tab <- tab[i, j, ...,drop=FALSE]
               

Modified: pkg/TODO
===================================================================
--- pkg/TODO	2008-09-15 21:41:23 UTC (rev 180)
+++ pkg/TODO	2008-09-25 17:11:24 UTC (rev 181)
@@ -26,8 +26,9 @@
 
 # CODE ISSUES:
 ==============
-* fix bug 1.2-2.01 (read.structure issue)
+* fix bug 1.2-2.01 (read.structure issue) -- fixed: was not a bug, just a mispecification in arguments
 
+
 # DOCUMENTATION ISSUES:
 =======================
 * make a tutorial for the sPCA

Modified: pkg/misc/bug-report.1.2-2.01/.RData
===================================================================
(Binary files differ)

Modified: pkg/misc/bug-report.1.2-2.01/.Rhistory
===================================================================
--- pkg/misc/bug-report.1.2-2.01/.Rhistory	2008-09-15 21:41:23 UTC (rev 180)
+++ pkg/misc/bug-report.1.2-2.01/.Rhistory	2008-09-25 17:11:24 UTC (rev 181)
@@ -3,3 +3,46 @@
 args(read.structure)
 read.structure("project_data.stru", n.ind=50, n.loc=15, col.lab=1, col.pop=2, row=1)
 read.structure("project_data.stru", n.ind=50, n.loc=15, col.lab=1, col.pop=2, row=1, onerowperind=TRUE)
+x <- read.structure("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.01/project_data.stru")
+?read.structure
+x <- read.structure("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.01/project_data.stru", n.ind=50, n.loc=15, onerowperind=TRUE, col.ind=1, col.pop=2, row.mark=1)
+traceback()
+x <- read.structure("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.01/project_data.stru", n.ind=50, n.loc=15, onerowperind=TRUE, col.lab=1, col.pop=2, row.mark=1)
+x <- read.structure("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.01/project_data.stru", n.ind=50, n.loc=15, onerowperind=TRUE, col.lab=1, col.pop=2, row.mark=1, col.other=NULL)
+traceback()
+x <- read.structure("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.01/project_data.stru", n.ind=50, n.loc=15, onerowperind=TRUE, col.lab=1, col.pop=2, row.mark=1, col.other=NULL,ask=FALSE)
+traceback()
+traceback(2)
+debug(read.structure)
+x <- read.structure("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.01/project_data.stru", n.ind=50, n.loc=15, onerowperind=TRUE, col.lab=1, col.pop=2, row.mark=1, col.other=NULL,ask=FALSE)
+NA.char
+txt
+lastline
+row.marknaes
+row.marknames
+loc.names
+loc.names
+Q
+x <- read.structure("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.01/project_data.stru", n.ind=50, n.loc=15, onerowperind=TRUE, col.lab=1, col.pop=2, col.other=NULL,ask=FALSE)
+row.marknames
+undebug(read.structure)
+x
+genind2df(x)
+ read.table("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.01/15305adegenetextrait.txt")
+ read.table("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.01/15305adegenetextrait.txt",sep="\t")
+ncol( read.table("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.01/15305adegenetextrait.txt",sep="\t"))
+q()
+n
+read.structure("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.01/project_data.stru", 
+    n.ind = 50, n.loc = 15, onerowperind = TRUE, col.lab = 1, 
+    col.pop = 2, col.other = NULL, ask = FALSE)
+x <- read.structure("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.01/project_data.stru", 
+
+    n.ind = 50, n.loc = 15, onerowperind = TRUE, col.lab = 1, 
+
+    col.pop = 2, col.other = NULL, ask = FALSE)
+x
+genind2df(x)
+head(genind2df(x))
+q()
+y

Modified: www/acceuil.html
===================================================================
--- www/acceuil.html	2008-09-15 21:41:23 UTC (rev 180)
+++ www/acceuil.html	2008-09-25 17:11:24 UTC (rev 181)
@@ -35,23 +35,20 @@
  href="http://bioinformatics.oxfordjournals.org/cgi/reprint/btn129?ijkey=6sqx5BTXCdYtBZz&amp;keytype=ref">link</a>
 to a free pdf]<br>
 <br>
-<div style="text-align: left;">
-<table style="width: 95%; text-align: left;" border="0" cellpadding="2"
- cellspacing="2">
-  <tbody>
-    <tr>
-      <td style="vertical-align: top;">&nbsp;<img
+<div style="text-align: center;"><img
  style="width: 600px; height: 451px;" alt="" src="images/acceuil.png"><br>
-      </td>
-      <td style="vertical-align: middle;"><small>sPCA, typological
+<br>
+</div>
+<div style="text-align: left;">
+<div style="text-align: center;"><small>sPCA, typological
 coherence of markers, Monmonier&nbsp; algorithm,
-colorplot of genotypes, analyses using ade4, ...</small> </td>
-    </tr>
-  </tbody>
-</table>
-<span style="text-decoration: underline;"><br>
-Main features of adegenet are:</span><br>
+colorplot of genotypes, analyses using ade4, ...<br>
 <br>
+</small></div>
+<small><br>
+</small><span style="text-decoration: underline;">Main features of
+adegenet are:</span><br>
+<br>
 </div>
 - definition of new object <span style="font-weight: bold;">classes</span>
 to facilitate multivariate analysis<br>



More information about the adegenet-commits mailing list