#!/bin/sh -e
# http://dep.debian.net/deps/dep8/

pkg=plink2
if [ "$AUTOPKGTEST_TMP" = "" ] ; then
  AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
  trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
fi
cd $AUTOPKGTEST_TMP

plink2 --debug --dummy 33 65537 0.1 dosage-freq=0.1 --out tmp_data
if [ ! -e tmp_data.pgen ] ; then
  echo "plink2 failed to create tmp_data.pgen"
  exit 1
fi
plink2 --debug --pfile tmp_data --export vcf vcf-dosage=DS --out tmp_data2
plink2 --debug --vcf tmp_data2.vcf dosage=DS --out tmp_data2
