[Genabel-commits] r811 - in pkg/GenABEL: . R inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 5 16:32:09 CET 2011


Author: yurii
Date: 2011-12-05 16:32:09 +0100 (Mon, 05 Dec 2011)
New Revision: 811

Modified:
   pkg/GenABEL/CHANGES.LOG
   pkg/GenABEL/R/merge.gwaa.data.R
   pkg/GenABEL/inst/unitTests/runit.merge.R
Log:
Addressed bug [#1676], added unit test runit.merge.R/test.merge.bug1676

Modified: pkg/GenABEL/CHANGES.LOG
===================================================================
--- pkg/GenABEL/CHANGES.LOG	2011-12-05 12:02:08 UTC (rev 810)
+++ pkg/GenABEL/CHANGES.LOG	2011-12-05 15:32:09 UTC (rev 811)
@@ -1,5 +1,7 @@
 *** v. 1.7-0 (2011.11.15)
 
+Addressed bug [#1676], added unit test runit.merge.R/test.merge.bug1676
+
 Added 'KS' method to estimate lambda in 'estlambda'. Generates rather 
 good results (under null) and may be considered as default option in the future, 
 after testing under the alternative. 

Modified: pkg/GenABEL/R/merge.gwaa.data.R
===================================================================
--- pkg/GenABEL/R/merge.gwaa.data.R	2011-12-05 12:02:08 UTC (rev 810)
+++ pkg/GenABEL/R/merge.gwaa.data.R	2011-12-05 15:32:09 UTC (rev 811)
@@ -6,14 +6,14 @@
 	if (is(snpdata,"try-error"))
 		stop("error occured in merging gtdata slots of x and y")
 	snpdata <- snpdata$data
-	phdata <- merge(x at phdata,y at phdata,by="id",all=T)
-#	phdata <- merge(x at phdata,y at phdata,all=T)
+#	phdata <- merge(x at phdata,y at phdata,by="id",all=T)
+	phdata <- merge(x at phdata,y at phdata,all=T)
 	if (any(!(snpdata at idnames %in% phdata$id)))
 		stop("some ids present in gtdata are missing from phdata")
 	if (length(phdata$id) != length(unique(phdata$id)))
 		stop("duplicated ids in phdata")
 	rownames(phdata) <- phdata$id
-	phdata <- phdata[snpdata at idnames,]
+	phdata <- phdata[idnames(snpdata),]
 	out <- new("gwaa.data",phdata=phdata,gtdata=snpdata)
 	out
 }

Modified: pkg/GenABEL/inst/unitTests/runit.merge.R
===================================================================
--- pkg/GenABEL/inst/unitTests/runit.merge.R	2011-12-05 12:02:08 UTC (rev 810)
+++ pkg/GenABEL/inst/unitTests/runit.merge.R	2011-12-05 15:32:09 UTC (rev 811)
@@ -22,10 +22,21 @@
 
 test.merge.bug1641 <- function()
 {
-	library(GenABEL)
-	print(  packageVersion("GenABEL") )
 	data(srdta)
 	x1 <- srdta[1:4,1]
 	x2 <- srdta[5:10, 2]
 	xy <- merge(x1, x2, intersected_snps_only=FALSE)
+}
+
+test.merge.bug1676 <- function() 
+{
+	data(srdta)
+	x1 <- srdta[1:4,1]
+	x2 <- srdta[5:10, 2]
+	xy <- merge(x1,x2)
+	phdata(x1)
+	phdata(x2)
+	phdata(xy)
+	checkIdentical(phdata(xy)[1:dim(phdata(x1))[1],],phdata(x1))
+	checkIdentical(phdata(xy)[(dim(phdata(x1))[1]+1):(dim(phdata(x1))[1]+dim(phdata(x2))[1]),],phdata(x2))
 }
\ No newline at end of file



More information about the Genabel-commits mailing list