[adegenet-commits] r457 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Oct 19 12:57:33 CEST 2009


Author: jombart
Date: 2009-10-19 12:57:32 +0200 (Mon, 19 Oct 2009)
New Revision: 457

Modified:
   pkg/R/import.R
Log:
now .gen extension is allowed for genetix format.


Modified: pkg/R/import.R
===================================================================
--- pkg/R/import.R	2009-10-18 17:11:49 UTC (rev 456)
+++ pkg/R/import.R	2009-10-19 10:57:32 UTC (rev 457)
@@ -279,7 +279,7 @@
     ## read from file
     ## if(!file.exists(file)) stop("Specified file does not exist.") <- not needed
 
-    if(toupper(.readExt(file)) != "GTX") stop("File extension .gtx expected")
+    if(toupper(.readExt(file)) %in% c("GTX","GEN")) stop("File extension .gtx expected")
     ## retrieve first infos
     nloc <- as.integer(scan(file,nlines=1,what="character",quiet=TRUE)[1])
     npop <- as.integer(scan(file,nlines=1,skip=1,what="character",quiet=TRUE)[1])
@@ -690,7 +690,7 @@
     ext <- .readExt(file)
     ext <- toupper(ext)
 
-    if(ext == "GTX")
+    if(ext %in% c("GTX","GEN"))
         return(read.genetix(file,missing=missing,quiet=quiet))
 
     if(ext == "DAT")



More information about the adegenet-commits mailing list