#!/bin/sh
# autopkgtest check: Run example test data through AUGUSTUS, with training 
# Author: Sascha Steinbiss <sascha@steinbiss.name>
set -e

ORIGDIR=$(pwd)
DATADIR=$ORIGDIR/debian/tests/
WORKDIR=$(mktemp -d)

trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR

# prepare custom config directory
cp -prv /usr/share/augustus/config .
export AUGUSTUS_CONFIG_PATH=$WORKDIR/config

# training
/usr/share/augustus/scripts/new_species.pl --species=test
etraining --species=test $ORIGDIR/examples/hsackI10.gb

# test new species models
augustus --species=test $ORIGDIR/examples/example.fa | tee out.gff3

[ -s out.gff3 ]
