[Genabel-commits] r1200 - branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Apr 26 21:58:12 CEST 2013
Author: lckarssen
Date: 2013-04-26 21:58:12 +0200 (Fri, 26 Apr 2013)
New Revision: 1200
Added:
branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/run_diff.sh
Modified:
branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_bt.sh
branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_cox.sh
branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_mms.sh
branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_qt.sh
Log:
Merged ProbABEL examples directory from trunk to the ProbABEL-pacox branch. This updates the example scripts to the latest version.
Modified: branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_bt.sh
===================================================================
--- branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_bt.sh 2013-04-26 06:23:11 UTC (rev 1199)
+++ branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_bt.sh 2013-04-26 19:58:12 UTC (rev 1200)
@@ -1,22 +1,9 @@
#!/bin/sh
-# This script runs checks on ProbABEL's palinear module for
-# quantitative traits.
+# This script runs checks on ProbABEL's palogist module for
+# binary traits.
-run_diff()
-{
- # This function is run after each check. It needs two arguments:
- # $1: first file to compare
- # $2: second file to compare
- if diff "$1" "$2"; then
- echo -e "\t\tOK"
- else
- echo -e "\t\tFAILED"
- exit 1
- fi
-}
+. ./run_diff.sh
-
-# ---- The checks start here ----
echo "analysing BT"
if [ -z ${srcdir} ]; then
srcdir="."
@@ -26,7 +13,6 @@
# 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
@@ -48,9 +34,11 @@
-o logist_fv \
>& 3
-echo "BT check: dose vs. dose_fv"
-run_diff logist_add.out.txt logist_fv_add.out.txt
+run_diff logist_add.out.txt \
+ logist_fv_add.out.txt \
+ "BT check: dose vs. dose_fv"
+
../src/palogist \
-p ${srcdir}/logist_data.txt \
-d ${srcdir}/test.mlprob \
@@ -72,13 +60,17 @@
>& 3
for model in add domin over_domin recess 2df; do
- echo -n "BT check ($model model): prob vs. prob_fv"
- run_diff logist_prob_${model}.out.txt logist_prob_fv_${model}.out.txt
+ run_diff logist_prob_${model}.out.txt \
+ logist_prob_fv_${model}.out.txt \
+ "BT check ($model model): prob vs. prob_fv"
done
-# Commented out because of slightly different output formats. We need
-# something smart here.
-# echo "BT check: prob vs. dose"
-# diff logist_prob_add.out.txt logist_add.out.txt
-# echo "BT check: prob_fv vs. dose_fv"
-# diff logist_prob_fv_add.out.txt logist_fv_add.out.txt
+run_diff logist_prob_add.out.txt \
+ logist_add.out.txt \
+ "BT check: prob vs. dose" \
+ -I beta_SNP
+
+run_diff logist_prob_fv_add.out.txt \
+ logist_fv_add.out.txt \
+ "BT check: prob_fv vs. dose_fv" \
+ -I beta_SNP
Modified: branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_cox.sh
===================================================================
--- branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_cox.sh 2013-04-26 06:23:11 UTC (rev 1199)
+++ branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_cox.sh 2013-04-26 19:58:12 UTC (rev 1200)
@@ -10,7 +10,7 @@
echo -e "\t\tOK"
else
echo -e "\t\tFAILED"
- exit 1
+# exit 1
fi
}
@@ -62,8 +62,8 @@
>& 3
# Disabling this check for now because the output differs slightly
-# echo -n "pacoxph check: dose vs. prob "
-# run_diff coxph_dose_add.out.txt coxph_prob_add.out.txt
+echo -n "pacoxph check: dose vs. prob "
+run_diff coxph_dose_add.out.txt coxph_prob_add.out.txt
../src/pacoxph \
Modified: branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_mms.sh
===================================================================
--- branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_mms.sh 2013-04-26 06:23:11 UTC (rev 1199)
+++ branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_mms.sh 2013-04-26 19:58:12 UTC (rev 1200)
@@ -2,21 +2,8 @@
# This script runs checks on ProbABEL's palinear module for
# quantitative traits combined with the mmscore option.
-run_diff()
-{
- # This function is run after each check. It needs two arguments:
- # $1: first file to compare
- # $2: second file to compare
- if diff "$1" "$2"; then
- echo -e "\t\tOK"
- else
- echo -e "\t\tFAILED"
- exit 1
- fi
-}
+. ./run_diff.sh
-
-# ---- The checks start here ----
echo "analysis using MMScore"
if [ -z ${srcdir} ]; then
srcdir="."
@@ -47,10 +34,12 @@
--mmscore ${srcdir}/mmscore_InvSigma_aj.sex.age.dat \
>& 3
-echo "mmscore check: dose vs. dose_fv"
-diff mmscore_add.out.txt mmscore_fv_add.out.txt
+run_diff mmscore_dose_add.out.txt \
+ mmscore_dose_fv_add.out.txt \
+ "mmscore check: dose vs. dose_fv"
+
../src/palinear \
-p ${srcdir}/mmscore_pheno.PHE \
-i ${srcdir}/mmscore_gen.mlinfo \
@@ -70,14 +59,19 @@
>& 3
for model in add domin over_domin recess 2df; do
- echo -n "mmscore check ($model model): prob vs. prob_fv"
- run_diff mmscore_prob_${model}.out.txt mmscore_prob_fv_${model}.out.txt
+ run_diff mmscore_prob_${model}.out.txt \
+ mmscore_prob_fv_${model}.out.txt \
+ "mmscore check ($model model): prob vs. prob_fv"
done
-# Commented out because of slightly different output formats. We need
-# something smart here.
-# echo "mmscore check: prob vs. dose"
-# diff mmscore_prob_add.out.txt mmscore_dose_add.out.txt
+# The following checks are disabled because of the missing LogLik
+# column in the prob data
+# run_diff mmscore_prob_add.out.txt \
+# mmscore_add.out.txt \
+# "mmscore check: prob vs. dose" \
+# -I beta_SNP
-# echo "mmscore check: prob_fv vs. dose_fv"
-# diff mmscore_prob_fv_add.out.txt mmscore_dose_fv_add.out.txt
+# run_diff mmscore_prob_fv_add.out.txt \
+# mmscore_fv_add.out.txt \
+# "mmscore check: prob_fv vs. dose_fv" \
+# -I beta_SNP
Modified: branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_qt.sh
===================================================================
--- branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_qt.sh 2013-04-26 06:23:11 UTC (rev 1199)
+++ branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/example_qt.sh 2013-04-26 19:58:12 UTC (rev 1200)
@@ -2,21 +2,8 @@
# This script runs checks on ProbABEL's palinear module for
# quantitative traits.
-run_diff()
-{
- # This function is run after each check. It needs two arguments:
- # $1: first file to compare
- # $2: second file to compare
- if diff "$1" "$2"; then
- echo -e "\t\tOK"
- else
- echo -e "\t\tFAILED"
- exit 1
- fi
-}
+. ./run_diff.sh
-
-# ---- The checks start here ----
echo "analysing QT"
if [ -z ${srcdir} ]; then
srcdir="."
@@ -38,7 +25,6 @@
-c 19 \
-o height_base \
>& 3
-
../src/palinear \
-p ${srcdir}/height.txt \
-d ${srcdir}/test.dose.fvi \
@@ -48,8 +34,10 @@
-o height_base_fv \
>& 3
-echo -n "QT check: dose vs. dose_fv"
-run_diff height_base_add.out.txt height_base_fv_add.out.txt
+#echo -n "QT check: dose vs. dose_fv"
+run_diff height_base_add.out.txt \
+ height_base_fv_add.out.txt \
+ "QT check: dose vs. dose_fv"
echo "Option --allcov"
@@ -69,8 +57,9 @@
-o height_allcov_fv \
>& 3
-echo -n "QT check: allcov: dose vs. dose_fv"
-run_diff height_allcov_add.out.txt height_allcov_fv_add.out.txt
+run_diff height_allcov_add.out.txt \
+ height_allcov_fv_add.out.txt \
+ "QT check: allcov: dose vs. dose_fv"
echo "Option --interaction=1"
@@ -91,8 +80,9 @@
-o height_int1_fv \
>& 3
-echo -n "QT check: interactions: dose vs. dose_fv"
-run_diff height_int1_add.out.txt height_int1_fv_add.out.txt
+run_diff height_int1_add.out.txt \
+ height_int1_fv_add.out.txt \
+ "QT check: interactions: dose vs. dose_fv"
echo "Option --robust"
@@ -113,8 +103,9 @@
-o height_robust_fv \
>& 3
-echo -n "QT check: robust: dose vs. dose_fv"
-run_diff height_robust_add.out.txt height_robust_fv_add.out.txt
+run_diff height_robust_add.out.txt \
+ height_robust_fv_add.out.txt \
+ "QT check: robust: dose vs. dose_fv"
echo "Option --robust --interaction=1"
@@ -135,8 +126,9 @@
-o height_robust_int1_fv \
>& 3
-echo -n "QT check: robust & interaction: dose vs. dose_fv"
-run_diff height_robust_int1_add.out.txt height_robust_int1_fv_add.out.txt
+run_diff height_robust_int1_add.out.txt \
+ height_robust_int1_fv_add.out.txt \
+ "QT check: robust & interaction: dose vs. dose_fv"
echo "Option --ngp=2, mlprob file"
@@ -157,12 +149,16 @@
-o height_ngp2_fv \
>& 3
-# echo -n "QT check: dose vs prob (additive model)"
-# run_diff height_base_add.out.txt height_ngp2_add.out.txt
+# Remove header from the outputs, because they differ
+run_diff height_base_add.out.txt \
+ height_ngp2_add.out.txt \
+ "QT check: dose vs. prob (additive model)" -I SNP
+
for model in add domin over_domin recess 2df; do
- echo -n "QT check ($model model): prob vs. prob_fv"
- run_diff height_ngp2_${model}.out.txt height_ngp2_fv_${model}.out.txt
+ run_diff height_ngp2_${model}.out.txt \
+ height_ngp2_fv_${model}.out.txt \
+ "QT check ($model model): prob vs. prob_fv"
done
@@ -185,8 +181,9 @@
>& 3
for model in add domin over_domin recess 2df; do
- echo -n "QT check --allcov ($model model): prob vs. prob_fv"
- run_diff height_ngp2_allcov_${model}.out.txt height_ngp2_allcov_fv_${model}.out.txt
+ run_diff height_ngp2_allcov_${model}.out.txt \
+ height_ngp2_allcov_fv_${model}.out.txt \
+ "QT check --allcov ($model model): prob vs. prob_fv"
done
@@ -209,8 +206,9 @@
>& 3
for model in add domin over_domin recess 2df; do
- echo -n "QT check --interactions ($model model): prob vs. prob_fv"
- run_diff height_ngp2_int1_${model}.out.txt height_ngp2_int1_fv_${model}.out.txt
+ run_diff height_ngp2_int1_${model}.out.txt \
+ height_ngp2_int1_fv_${model}.out.txt \
+ "QT check --interactions ($model model): prob vs. prob_fv"
done
@@ -233,8 +231,9 @@
>& 3
for model in add domin over_domin recess 2df; do
- echo -n "QT check --robust ($model model): prob vs. prob_fv"
- run_diff height_ngp2_robust_${model}.out.txt height_ngp2_robust_fv_${model}.out.txt
+ run_diff height_ngp2_robust_${model}.out.txt \
+ height_ngp2_robust_fv_${model}.out.txt \
+ "QT check --robust ($model model): prob vs. prob_fv"
done
@@ -257,6 +256,7 @@
>& 3
for model in add domin over_domin recess 2df; do
- echo -n "QT check --robust --interactions ($model model): prob vs. prob_fv"
- run_diff height_ngp2_robust_int1_${model}.out.txt height_ngp2_robust_int1_fv_${model}.out.txt
+ run_diff height_ngp2_robust_int1_${model}.out.txt \
+ height_ngp2_robust_int1_fv_${model}.out.txt \
+ "QT check --robust --interactions ($model model): prob vs. prob_fv"
done
Copied: branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/run_diff.sh (from rev 1199, pkg/ProbABEL/examples/run_diff.sh)
===================================================================
--- branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/run_diff.sh (rev 0)
+++ branches/ProbABEL-pacox/v.0.3.0/ProbABEL/examples/run_diff.sh 2013-04-26 19:58:12 UTC (rev 1200)
@@ -0,0 +1,27 @@
+# This file contains a function used in the various example/test scripts
+
+run_diff()
+{
+ # This function is run after each check. It needs two arguments:
+ # $1: first file to compare
+ # $2: second file to compare
+ # $3: start message to print on the output line before OK or FAILED
+ # $4-: any arguments to pass to the diff command
+ file1=$1
+ file2=$2
+ name=""
+ if [ ${#} -ge 3 ]; then
+ name=$3
+ shift 3
+ args=$@
+ fi
+
+ blanks=" "
+
+ if diff "$file1" "$file2" $args; then
+ echo -e "${name}${blanks:${#name}} OK"
+ else
+ echo -e "${name}${blanks:${#name}} FAILED"
+ exit 1
+ fi
+}
More information about the Genabel-commits
mailing list