[Genabel-commits] r1517 - in pkg/ProbABEL/checks: . R-tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 30 15:43:27 CET 2013


Author: lckarssen
Date: 2013-12-30 15:43:27 +0100 (Mon, 30 Dec 2013)
New Revision: 1517

Modified:
   pkg/ProbABEL/checks/Makefile.am
   pkg/ProbABEL/checks/R-tests/Makefile.am
   pkg/ProbABEL/checks/R-tests/run_R_test_palinear.sh
   pkg/ProbABEL/checks/R-tests/run_models_in_R_pacox.R
   pkg/ProbABEL/checks/R-tests/run_models_in_R_palinear.R
   pkg/ProbABEL/checks/R-tests/run_models_in_R_palogist.R
   pkg/ProbABEL/checks/test_bt.sh
   pkg/ProbABEL/checks/test_cox.sh
   pkg/ProbABEL/checks/test_mms.sh
   pkg/ProbABEL/checks/test_qt.sh
Log:
Reverting previous ProbABEL commit, which contained too many files.

Modified: pkg/ProbABEL/checks/Makefile.am
===================================================================
--- pkg/ProbABEL/checks/Makefile.am	2013-12-30 14:39:35 UTC (rev 1516)
+++ pkg/ProbABEL/checks/Makefile.am	2013-12-30 14:43:27 UTC (rev 1517)
@@ -38,12 +38,6 @@
 
 input_files = $(phenofiles) $(genofiles) run_diff.sh test_all.sh
 
-# R_test_files = R-tests/run_models_in_R_palinear.R R-tests/run_model_linear.R	\
-#  R-tests/run_models_in_R_palogist.R R-tests/run_model_logist.R			\
-#  R-tests/run_models_in_R_pacox.R R-tests/run_model_coxph.R			\
-#  R-tests/initial_checks.R
-
-
 check_SCRIPTS =
 
 
@@ -58,17 +52,6 @@
 check_SCRIPTS +=  test_cox.sh
 endif
 
-# if HAVE_R
-# if BUILD_palinear
-# check_SCRIPTS += R-tests/run_R_test_palinear.sh
-# endif
-# if BUILD_palogist
-# #check_SCRIPTS += R-tests/run_R_test_palogist.sh
-# endif
-# if BUILD_pacoxph
-# check_SCRIPTS += R-tests/run_R_test_pacox.sh
-# endif
-# endif
 
 
 TESTS = $(check_SCRIPTS)

Modified: pkg/ProbABEL/checks/R-tests/Makefile.am
===================================================================
--- pkg/ProbABEL/checks/R-tests/Makefile.am	2013-12-30 14:39:35 UTC (rev 1516)
+++ pkg/ProbABEL/checks/R-tests/Makefile.am	2013-12-30 14:43:27 UTC (rev 1517)
@@ -2,9 +2,9 @@
 
 AUTOMAKE_OPTIONS = foreign color-tests
 
-R_test_files = run_models_in_R_palinear.R run_model_linear.R	\
- run_models_in_R_palogist.R run_model_logist.R			\
- run_models_in_R_pacox.R run_model_coxph.R			\
+R_test_files =  run_models_in_R_palinear.R	\
+ run_models_in_R_palogist.R			\
+ run_models_in_R_pacox.R			\
  initial_checks.R
 
 check_SCRIPTS =
@@ -23,10 +23,11 @@
 
 
 testsdir = $(pkgdatadir)/checks/R-tests
+dist_tests_DATA = $(R_test_files) $(check_SCRIPTS)
+#dist_tests_SCRIPTS = $(check_SCRIPTS)
 
-TESTS = $(check_SCRIPTS)
+TESTS_ENVIRONMENT = bash
 
-## The palogist R test still doesn't run correctly.
-XFAIL_TESTS = run_R_test_palogist.sh
 
-EXTRA_DIST = $(check_SCRIPTS) $(R_test_files)
+
+TESTS = $(check_SCRIPTS)

Modified: pkg/ProbABEL/checks/R-tests/run_R_test_palinear.sh
===================================================================
--- pkg/ProbABEL/checks/R-tests/run_R_test_palinear.sh	2013-12-30 14:39:35 UTC (rev 1516)
+++ pkg/ProbABEL/checks/R-tests/run_R_test_palinear.sh	2013-12-30 14:43:27 UTC (rev 1517)
@@ -7,5 +7,5 @@
 if [ -z ${srcdir} ]; then
     srcdir="."
 fi
-echo "SRCDIR=$srcdir"
+
 $Rcommand -f ${srcdir}/run_models_in_R_palinear.R --args ${srcdir}/

Modified: pkg/ProbABEL/checks/R-tests/run_models_in_R_pacox.R
===================================================================
--- pkg/ProbABEL/checks/R-tests/run_models_in_R_pacox.R	2013-12-30 14:39:35 UTC (rev 1516)
+++ pkg/ProbABEL/checks/R-tests/run_models_in_R_pacox.R	2013-12-30 14:43:27 UTC (rev 1517)
@@ -24,7 +24,7 @@
 ####
 cat("Running ProbABEL...\t\t\t\t")
 tmp <- system(paste0("cd ", tests.path,
-                     "; bash srcdir=", srcdir, " test_cox.sh 2> /dev/null; cd -"),
+                     "; bash test_cox.sh 2> /dev/null; cd -"),
               intern=TRUE)
 cat("OK\n")
 
@@ -54,7 +54,7 @@
 
 cat("Comparing R output with ProbABEL output\t\t")
 
-source(paste0(srcdir, "run_model_coxph.R"))
+source("run_model_coxph.R")
 
 model.fn.0 <-
     "coxph( Surv(fupt_chd, chd)[noNA] ~ sex[noNA] + age[noNA] + othercov[noNA] )"

Modified: pkg/ProbABEL/checks/R-tests/run_models_in_R_palinear.R
===================================================================
--- pkg/ProbABEL/checks/R-tests/run_models_in_R_palinear.R	2013-12-30 14:39:35 UTC (rev 1516)
+++ pkg/ProbABEL/checks/R-tests/run_models_in_R_palinear.R	2013-12-30 14:43:27 UTC (rev 1517)
@@ -10,9 +10,6 @@
 pheno.file <- "height.txt"
 
 source(paste0(srcdir, "initial_checks.R"))
-cat("IN R SRCDIR=", srcdir, "\n")
-cat("IN R tests.path=", tests.path, "\n")
-cat("In R inputfiles.path=", inputfiles.path, "\n")
 
 ####
 ## Run ProbABEL to get the output data we want to compare/verify
@@ -54,7 +51,7 @@
 
 cat("Comparing R output with ProbABEL output\t\t")
 
-source(paste0(srcdir, "run_model_linear.R"))
+source("run_model_linear.R")
 
 model.fn.0 <- "lm( height[noNA] ~ sex[noNA] + age[noNA] )"
 model.fn   <- "lm( height ~ sex + age + snp )"

Modified: pkg/ProbABEL/checks/R-tests/run_models_in_R_palogist.R
===================================================================
--- pkg/ProbABEL/checks/R-tests/run_models_in_R_palogist.R	2013-12-30 14:39:35 UTC (rev 1516)
+++ pkg/ProbABEL/checks/R-tests/run_models_in_R_palogist.R	2013-12-30 14:43:27 UTC (rev 1517)
@@ -38,10 +38,6 @@
     paste0(tests.path, "logist_prob_2df.out.txt"),
     head=TRUE)[, cols2df]
 
-## Fix chi^2 for the case that there is no variation (SNP 6 in the
-## info file). ProbABEL lists it as NaN, R lists it as:
-prob.dom.PA[6, 4] <- 0.0
-
 ####
 ## run analysis in R
 ####
@@ -49,7 +45,7 @@
 
 cat("Comparing R output with ProbABEL output\t\t")
 
-source(paste0(srcdir, "run_model_logist.R"))
+source("run_model_logist.R")
 
 model.fn.0 <-
     "glm( chd[noNA] ~ sex[noNA] + age[noNA] + othercov[noNA], family=binomial)"
@@ -109,16 +105,10 @@
         model   <- glm( chd ~ sex + age + othercov + prob[, indexHet] +
                        prob[, indexHom], family=binomial )
         smA1A2  <- summary(model)$coef[5, 1:2]
-
-        if ( nrow(summary(model)$coeff) > 5 ) {
-            smA1A1 <- summary(model)$coef[6, 1:2]
-        } else {
-            smA1A1 <- c(NaN, NaN)
-        }
-
+        smA1A1  <- summary(model)$coef[6, 1:2]
         lrt     <- 2 * ( logLik( model ) - logLik( model.0 ) )
 
-        rsq <- prob.2df.PA[i-2, "Rsq"]
+        rsq <- resPa2df[i-2, "Rsq"]
         if( rsq < rsq.thresh) {
             row <- c(rsq, NaN, NaN, NaN, NaN, NaN)
         } else {

Modified: pkg/ProbABEL/checks/test_bt.sh
===================================================================
--- pkg/ProbABEL/checks/test_bt.sh	2013-12-30 14:39:35 UTC (rev 1516)
+++ pkg/ProbABEL/checks/test_bt.sh	2013-12-30 14:43:27 UTC (rev 1517)
@@ -2,30 +2,27 @@
 # This script runs checks on ProbABEL's palogist module for
 # binary traits.
 
-echo "Analysing BT..."
+echo "analysing BT"
 
 scriptdir=$(dirname $0)
 
 if [ -z ${srcdir} ]; then
     srcdir="."
-    bindir=${scriptdir}/../src/
-else
-    bindir="../src/"
 fi
 
 . ${scriptdir}/run_diff.sh
 
-inputdir=${scriptdir}/inputfiles
-palogist=${bindir}/palogist
+inputdir=${srcdir}/inputfiles
 
 # Redirect all output to file descriptor 3 to /dev/null except if
 # the first argument is "verbose" then redirect handle 3 to stdout
 exec 3>/dev/null
 if [ "$1" = "verbose" ]; then
-    echo "Verbose mode ON"
     exec 3>&1
 fi
 
+palogist=../src/palogist
+
 $palogist \
     -p ${inputdir}/logist_data.txt \
     -d ${inputdir}/test.mldose \

Modified: pkg/ProbABEL/checks/test_cox.sh
===================================================================
--- pkg/ProbABEL/checks/test_cox.sh	2013-12-30 14:39:35 UTC (rev 1516)
+++ pkg/ProbABEL/checks/test_cox.sh	2013-12-30 14:43:27 UTC (rev 1517)
@@ -7,15 +7,11 @@
 
 if [ -z ${srcdir} ]; then
     srcdir="."
-    bindir=${scriptdir}/../src/
-else
-    bindir="../src/"
 fi
 
 . ${scriptdir}/run_diff.sh
 
-inputdir=${scriptdir}/inputfiles
-pacoxph=${bindir}/pacoxph
+inputdir=${srcdir}/inputfiles
 
 # Redirect all output to file descriptor 3 to /dev/null except if
 # the first argument is "verbose" then redirect handle 3 to stdout
@@ -25,6 +21,8 @@
     exec 3>&1
 fi
 
+pacoxph=../src/pacoxph
+
 $pacoxph \
     -p ${inputdir}/coxph_data.txt \
     -d ${inputdir}/test.mldose \

Modified: pkg/ProbABEL/checks/test_mms.sh
===================================================================
--- pkg/ProbABEL/checks/test_mms.sh	2013-12-30 14:39:35 UTC (rev 1516)
+++ pkg/ProbABEL/checks/test_mms.sh	2013-12-30 14:43:27 UTC (rev 1517)
@@ -2,30 +2,24 @@
 # This script runs checks on ProbABEL's palinear module for
 # quantitative traits combined with the mmscore option.
 
-echo "Analysis using MMScore..."
-
-scriptdir=$(dirname $0)
-
+echo "analysis using MMScore"
 if [ -z ${srcdir} ]; then
     srcdir="."
-    bindir=${scriptdir}/../src/
-else
-    bindir="../src/"
 fi
 
-. ${scriptdir}/run_diff.sh
+. ${srcdir}/run_diff.sh
 
-inputdir=${scriptdir}/inputfiles
-palinear=${bindir}/palinear
+inputdir=${srcdir}/inputfiles
 
 # Redirect all output to file descriptor 3 to /dev/null except if
 # the first argument is "verbose" then redirect handle 3 to stdout
 exec 3>/dev/null
 if [ "$1" = "verbose" ]; then
-    echo "Verbose mode ON"
     exec 3>&1
 fi
 
+palinear=../src/palinear
+
 $palinear \
     -p ${inputdir}/mmscore_pheno.PHE \
     -i ${inputdir}/mmscore_gen.mlinfo \

Modified: pkg/ProbABEL/checks/test_qt.sh
===================================================================
--- pkg/ProbABEL/checks/test_qt.sh	2013-12-30 14:39:35 UTC (rev 1516)
+++ pkg/ProbABEL/checks/test_qt.sh	2013-12-30 14:43:27 UTC (rev 1517)
@@ -2,30 +2,27 @@
 # This script runs checks on ProbABEL's palinear module for
 # quantitative traits.
 
-echo "Analysing QT..."
+echo "analysing QT"
 
 scriptdir=$(dirname $0)
 
 if [ -z ${srcdir} ]; then
     srcdir="."
-    bindir=${scriptdir}/../src/
-else
-    bindir="../src/"
 fi
 
 . ${scriptdir}/run_diff.sh
 
-inputdir=${scriptdir}/inputfiles
-palinear=${bindir}/palinear
+inputdir=${srcdir}/inputfiles
 
 # Redirect all output to file descriptor 3 to /dev/null except if
 # the first argument is "verbose" then redirect handle 3 to stdout
 exec 3>/dev/null
 if [ "$1" = "verbose" ]; then
-    echo "Verbose mode ON"
     exec 3>&1
 fi
 
+palinear="../src/palinear"
+
 echo "base analysis"
 $palinear \
     -p ${inputdir}/height.txt \



More information about the Genabel-commits mailing list