[Genabel-commits] r1923 - pkg/ProbABEL/checks
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Feb 20 11:39:30 CET 2015
Author: lckarssen
Date: 2015-02-20 11:39:30 +0100 (Fri, 20 Feb 2015)
New Revision: 1923
Modified:
pkg/ProbABEL/checks/Makefile.am
pkg/ProbABEL/checks/check_dose_input.sh
pkg/ProbABEL/checks/check_pacoxph_nocovar.sh
pkg/ProbABEL/checks/check_probabel_chunk.sh
Log:
In ProbABEL's check scripts replace direct calls to sed and awk with variables that contain the binaries found by autoconf's AC_PROG_AWK and AC_PROG_SED.
This should improve portability.
Modified: pkg/ProbABEL/checks/Makefile.am
===================================================================
--- pkg/ProbABEL/checks/Makefile.am 2015-02-19 13:35:25 UTC (rev 1922)
+++ pkg/ProbABEL/checks/Makefile.am 2015-02-20 10:39:30 UTC (rev 1923)
@@ -53,6 +53,8 @@
endif
AM_TESTS_ENVIRONMENT= \
+ AWK=$(AWK) \
+ SED=$(SED) \
PA_BINDIR=$(top_builddir)/src
TESTS = $(check_SCRIPTS)
Modified: pkg/ProbABEL/checks/check_dose_input.sh
===================================================================
--- pkg/ProbABEL/checks/check_dose_input.sh 2015-02-19 13:35:25 UTC (rev 1922)
+++ pkg/ProbABEL/checks/check_dose_input.sh 2015-02-20 10:39:30 UTC (rev 1923)
@@ -8,6 +8,9 @@
# Exit with error when one of the steps in the script fails
set -e
+if [ -z ${sed} ]; then
+ SED=sed
+fi
if [ -z ${srcdir} ]; then
srcdir="."
fi
@@ -15,7 +18,7 @@
results="${srcdir}/verified_results/"
outfile="height_base_add.out.txt"
-sed 's/^[[:digit:]]*->//' $inputdir/test.mldose > test.mldose
+${SED} 's/^[[:digit:]]*->//' $inputdir/test.mldose > test.mldose
../src/palinear \
Modified: pkg/ProbABEL/checks/check_pacoxph_nocovar.sh
===================================================================
--- pkg/ProbABEL/checks/check_pacoxph_nocovar.sh 2015-02-19 13:35:25 UTC (rev 1922)
+++ pkg/ProbABEL/checks/check_pacoxph_nocovar.sh 2015-02-20 10:39:30 UTC (rev 1923)
@@ -6,6 +6,10 @@
echo "Testing pacoxph without covariates..."
+if [ -z ${AWK} ]; then
+ AWK=awk
+fi
+
# Exit with error when one of the steps in the script fails
set -e
@@ -24,9 +28,9 @@
outfile="pacoxph_nocovar"
pacoxph="${padir}/pacoxph"
-# ------ Prepare the phenotype file be removing the covariate column
+# ------ Prepare the phenotype file by removing the covariate column
# from the existing phenotype file ------
-awk '{print $1, $2, $3}' $orig_phenofile > $phenofile
+${AWK} '{print $1, $2, $3}' $orig_phenofile > $phenofile
# ---------- function definitions ----------
Modified: pkg/ProbABEL/checks/check_probabel_chunk.sh
===================================================================
--- pkg/ProbABEL/checks/check_probabel_chunk.sh 2015-02-19 13:35:25 UTC (rev 1922)
+++ pkg/ProbABEL/checks/check_probabel_chunk.sh 2015-02-20 10:39:30 UTC (rev 1923)
@@ -5,6 +5,13 @@
echo "Testing probabel..."
+if [ -z ${AWK} ]; then
+ AWK=awk
+fi
+if [ -z ${sed} ]; then
+ SED=sed
+fi
+
# Exit with error when one of the steps in the script fails
set -e
@@ -28,7 +35,7 @@
chrsep="_._chr_._"
# ------ Prepare probabel and the config file ------
-sed 's;"./";"../src/";g' $probabel > probabel
+${SED} 's;"./";"../src/";g' $probabel > probabel
chmod a+x probabel
cp $probabelcfg probabel_config.cfg
chmod +w probabel_config.cfg # Need this for make distcheck to work
@@ -50,50 +57,50 @@
# ------------------ No chunks test -------------------
# Split the dose, prob and info files up into two chromosomes
# with some chunks
- awk '{print $1,$2,$3,$4}' $dosefile > chr1.dose
- awk '{print $1,$2,$5,$6,$7}' $dosefile > chr2.dose
+ ${AWK} '{print $1,$2,$3,$4}' $dosefile > chr1.dose
+ ${AWK} '{print $1,$2,$5,$6,$7}' $dosefile > chr2.dose
- awk '{print $1,$2,$3,$4,$5,$6}' $probfile > chr1.prob
- awk '{print $1,$2,$7,$8,$9,$10,$11,$12}' $probfile > chr2.prob
+ ${AWK} '{print $1,$2,$3,$4,$5,$6}' $probfile > chr1.prob
+ ${AWK} '{print $1,$2,$7,$8,$9,$10,$11,$12}' $probfile > chr2.prob
- sed -n '1,3p' $infofile > chr1.info
- sed -n '1p' $infofile > chr2.info
- sed -n '4,6p' $infofile >> chr2.info
+ ${SED} -n '1,3p' $infofile > chr1.info
+ ${SED} -n '1p' $infofile > chr2.info
+ ${SED} -n '4,6p' $infofile >> chr2.info
- sed -n '1,3p' $mapfile > chr1.map
- sed -n '1p' $mapfile > chr2.map
- sed -n '4,6p' $mapfile >> chr2.map
+ ${SED} -n '1,3p' $mapfile > chr1.map
+ ${SED} -n '1p' $mapfile > chr2.map
+ ${SED} -n '4,6p' $mapfile >> chr2.map
WithOrWithout="without"
elif [ "$1" = "chunk" ]; then
# ------------------ Chunks test ----------------------
# Split the dose and info files up into two chromosomes with
# some chunks
- awk '{print $1,$2,$3}' $dosefile > chr1.chunk1.dose
- awk '{print $1,$2,$4}' $dosefile > chr1.chunk2.dose
- awk '{print $1,$2,$5,$6}' $dosefile > chr2.chunk1.dose
- awk '{print $1,$2,$7}' $dosefile > chr2.chunk2.dose
+ ${AWK} '{print $1,$2,$3}' $dosefile > chr1.chunk1.dose
+ ${AWK} '{print $1,$2,$4}' $dosefile > chr1.chunk2.dose
+ ${AWK} '{print $1,$2,$5,$6}' $dosefile > chr2.chunk1.dose
+ ${AWK} '{print $1,$2,$7}' $dosefile > chr2.chunk2.dose
- awk '{print $1,$2,$3,$4}' $probfile > chr1.chunk1.prob
- awk '{print $1,$2,$5,$6}' $probfile > chr1.chunk2.prob
- awk '{print $1,$2,$7,$8,$9,$10}' $probfile > chr2.chunk1.prob
- awk '{print $1,$2,$11,$12}' $probfile > chr2.chunk2.prob
+ ${AWK} '{print $1,$2,$3,$4}' $probfile > chr1.chunk1.prob
+ ${AWK} '{print $1,$2,$5,$6}' $probfile > chr1.chunk2.prob
+ ${AWK} '{print $1,$2,$7,$8,$9,$10}' $probfile > chr2.chunk1.prob
+ ${AWK} '{print $1,$2,$11,$12}' $probfile > chr2.chunk2.prob
- sed -n '1,2p' $infofile > chr1.chunk1.info
- sed -n '1p' $infofile > chr1.chunk2.info
- sed -n '3p' $infofile >> chr1.chunk2.info
- sed -n '1p' $infofile > chr2.chunk1.info
- sed -n '4,5p' $infofile >> chr2.chunk1.info
- sed -n '1p' $infofile > chr2.chunk2.info
- sed -n '6p' $infofile >> chr2.chunk2.info
+ ${SED} -n '1,2p' $infofile > chr1.chunk1.info
+ ${SED} -n '1p' $infofile > chr1.chunk2.info
+ ${SED} -n '3p' $infofile >> chr1.chunk2.info
+ ${SED} -n '1p' $infofile > chr2.chunk1.info
+ ${SED} -n '4,5p' $infofile >> chr2.chunk1.info
+ ${SED} -n '1p' $infofile > chr2.chunk2.info
+ ${SED} -n '6p' $infofile >> chr2.chunk2.info
- sed -n '1,2p' $mapfile > chr1.chunk1.map
- sed -n '1p' $mapfile > chr1.chunk2.map
- sed -n '3p' $mapfile >> chr1.chunk2.map
- sed -n '1p' $mapfile > chr2.chunk1.map
- sed -n '4,5p' $mapfile >> chr2.chunk1.map
- sed -n '1p' $mapfile > chr2.chunk2.map
- sed -n '6p' $mapfile >> chr2.chunk2.map
+ ${SED} -n '1,2p' $mapfile > chr1.chunk1.map
+ ${SED} -n '1p' $mapfile > chr1.chunk2.map
+ ${SED} -n '3p' $mapfile >> chr1.chunk2.map
+ ${SED} -n '1p' $mapfile > chr2.chunk1.map
+ ${SED} -n '4,5p' $mapfile >> chr2.chunk1.map
+ ${SED} -n '1p' $mapfile > chr2.chunk2.map
+ ${SED} -n '6p' $mapfile >> chr2.chunk2.map
WithOrWithout="with"
else
More information about the Genabel-commits
mailing list