[Genabel-commits] r1389 - pkg/GenABEL/inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 14 07:09:42 CET 2013


Author: maksim
Date: 2013-11-14 07:09:42 +0100 (Thu, 14 Nov 2013)
New Revision: 1389

Modified:
   pkg/GenABEL/inst/unitTests/runit.mmscore.R
Log:
Added comparison between output of mmscore and a reference output. The reference output is generated using mmscore from revision 1321. From now, if the output of mmscore is not identical to this reference output, RUnit test end up with an ERROR. Also: deleted using cppFun parameter from the test because it is not supported by mmscore anymore.

Modified: pkg/GenABEL/inst/unitTests/runit.mmscore.R
===================================================================
--- pkg/GenABEL/inst/unitTests/runit.mmscore.R	2013-11-14 02:52:20 UTC (rev 1388)
+++ pkg/GenABEL/inst/unitTests/runit.mmscore.R	2013-11-14 06:09:42 UTC (rev 1389)
@@ -20,13 +20,26 @@
 
 ### --- Test functions ---
 
-test.exports <- function()
+test.mmscore <- function()
 {
 	data(ge03d2.clean)
 	dta <- ge03d2.clean[1:200,autosomal(ge03d2.clean)[1:3000]]
 	gkin <- ibs(dta[,1:2000],w="freq")
 	h2 <- polygenic(height,data=dta,kin=gkin)
-	xOld <- mmscore(h2,dta,cppFun="old")
-	xNew <- mmscore(h2,dta,cppFun="new")
-	checkEquals(results(xNew),results(xOld))
+	xNew <- mmscore(h2,dta)
+	xNew_results <- results(xNew)
+
+
+# The test_mmscore_results_revision_1321 contains results from mmscore of SNV revision 1321. Let's assume that those results are correct and use it the future as a reference.
+#	test_mmscore_results_revision_1321 <- results(xNew)
+#	write.table(test_mmscore_results_revision_1321, file="../exdata/test_mmscore_results_revision_1321", quote=F)
+	
+	test_mmscore_results_revision_1321 <- read.table("test_mmscore_results_revision_1321", stringsAsFactors=F)
+	
+	test_mmscore_results_revision_1321$Chromosome <- as.factor(test_mmscore_results_revision_1321$Chromosome)
+	test_mmscore_results_revision_1321$Strand <- as.factor(test_mmscore_results_revision_1321$Strand)
+	test_mmscore_results_revision_1321$A1 <- as.factor(test_mmscore_results_revision_1321$A1)
+	test_mmscore_results_revision_1321$A2 <- as.factor(test_mmscore_results_revision_1321$A2)
+		
+	checkEquals(xNew_results, test_mmscore_results_revision_1321)
 }



More information about the Genabel-commits mailing list