[adegenet-commits] r752 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 5 15:08:26 CET 2011


Author: jombart
Date: 2011-01-05 15:08:26 +0100 (Wed, 05 Jan 2011)
New Revision: 752

Modified:
   pkg/R/SNPbin.R
Log:
Added a large-scale test.
100 genomes of 1e6 SNPs. 
Size before: 762.9 Mb
Size in lightgen: 15.8 Mb


Modified: pkg/R/SNPbin.R
===================================================================
--- pkg/R/SNPbin.R	2011-01-05 13:57:03 UTC (rev 751)
+++ pkg/R/SNPbin.R	2011-01-05 14:08:26 UTC (rev 752)
@@ -619,13 +619,24 @@
 
 
 ## SIMPLE TEST
-library(adegenet)
-dat <- list(toto=c(1,1,0), titi=c(NA,1,1,0), tata=c(NA,0,3, NA))
-x <- new("genlight", dat)
-x
-as.list(x)
-as.matrix(x)
+## library(adegenet)
+## dat <- list(toto=c(1,1,0), titi=c(NA,1,1,0), tata=c(NA,0,3, NA))
+## x <- new("genlight", dat)
+## x
+## as.list(x)
+## as.matrix(x)
 
-identical(x, new("genlight", as.list(x))) # round trip - list - MUST BE TRUE
-identical(x, new("genlight", as.matrix(x))) # round trip - matrix - MUST BE TRUE
-identical(x, new("genlight", as.data.frame(x))) # round trip - data.frame - MUST BE TRUE
+## identical(x, new("genlight", as.list(x))) # round trip - list - MUST BE TRUE
+## identical(x, new("genlight", as.matrix(x))) # round trip - matrix - MUST BE TRUE
+## identical(x, new("genlight", as.data.frame(x))) # round trip - data.frame - MUST BE TRUE
+
+
+
+## ## BIG SCALE TEST - HAPLOID DATA WITH NA
+## dat <- lapply(1:100, function(i) sample(c(0,1,NA), 1e6, prob=c(.5, .49, .01), replace=TRUE))
+## names(dat) <- paste("indiv", 1:length(dat))
+## print(object.size(dat), unit="aut")
+
+## system.time(x <- new("genlight", dat)) # conversion + time taken
+## print(object.size(x), unit="au")
+## object.size(dat)/object.size(x) # conversion efficiency



More information about the adegenet-commits mailing list