#!/bin/sh -e

pkg=last-align

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

cp -a /usr/share/doc/${pkg}/examples/*.fa* .
gunzip -r *

# first example from tutorial
lastdb -cR01 humdb humanMito.fa
lastal humdb fuguMito.fa > myalns.maf

# multiMito example
lastdb -c humanMito humanMito.fa
lastal -e25 -j4 humanMito mouseMito.fa | last-split | maf-sort > hm.maf
lastal -e25 -j4 humanMito chickenMito.fa | last-split | maf-sort > hc.maf
lastal -e25 -j4 humanMito fuguMito.fa | last-split | maf-sort > hf.maf
maf-join hm.maf hc.maf hf.maf > out

