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

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

gunzip EUR_test.bed.gz
gunzip EUR_test.bim.gz
gunzip EUR_test.fam.gz
gunzip phased.sample.gz
gunzip ref.bcf.gz

# From upstream run_example.sh
bio-eagle \
    --bfile=EUR_test \
    --geneticMapFile=USE_BIM \
    --chrom=21 \
    --outPrefix=phased \
    --numThreads=4

bio-eagle \
    --bfile=EUR_test \
    --geneticMapFile=USE_BIM \
    --chrom=21 \
    --outPrefix=phased \
    --numThreads=4 \
    --v1

bio-eagle \
    --bfile=EUR_test \
    --geneticMapFile=USE_BIM \
    --chrom=21 \
    --outPrefix=phased \
    --numThreads=4 \
    --v1fast

rm -rf $ADTTMP/*

