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

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

tar Jxvf $ADTTMP/examples.tar.xz

fastQTL \
     --vcf genotypes.vcf.gz \
     --bed phenotypes.bed.gz \
     --cov covariates.txt.gz \
     --interaction interaction.txt \
     --chunk 1 100 \
     --permute 100 \
     --seed 1 \
     --out fastqtl_output.txt \
     --log fastqtl_output.log

diff fastqtl_expected_output.txt fastqtl_output.txt

rm -f $ADTTMP/*

