#!/bin/sh -e
# http://dep.debian.net/deps/dep8/
# Autopkgtest: Test if GWAMA run analysis correctly
# Author: Dylan Aïssi <bob.dybian@gmail.com>
# Last-Update: 2014-12-24

pkg=gwama
if [ "$AUTOPKGTEST_TMP" = "" ] ; then
  AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
fi
cd $AUTOPKGTEST_TMP
cp -a /usr/share/doc/${pkg}/examples/samples/* $AUTOPKGTEST_TMP

# Fixed analysis
GWAMA --filelist "gwama.in" --quantitative --output "test_fixed"  --name_marker "SNP" --name_ea "EFFECT_ALLELE" --name_nea "NON_EFFECT_ALLELE"
diff test_fixed.out fixed.out

# Random analysis
GWAMA --filelist "gwama.in" --quantitative --output "test_random" --random  --name_marker "SNP" --name_ea "EFFECT_ALLELE" --name_nea "NON_EFFECT_ALLELE"
diff test_random.out random.out

rm -f $AUTOPKGTEST_TMP/*

