#!/bin/sh -e

pkg=pirs

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

cd $AUTOPKGTEST_TMP

mkdir gcContCvgBias
cd gcContCvgBias
cp -a /usr/share/doc/${pkg}/examples/gcContCvgBias/* .
# find . -type f -name "*.gz" -exec gunzip \{\} \;
gc_coverage_bias -r gcdeptestref.fa.gz -o test -w 100,200 --gcdump --depwindump gcdeptest.depth.gz
gc_coverage_bias_plot test_100.dat
gc_coverage_bias_plot test_200.dat
ls -l test*

cd ..

mkdir pirs
cd pirs
cp -a /usr/share/doc/${pkg}/examples/pirs/* .
find . -type f -name "*.gz" -exec gunzip \{\} \;

pirs diploid ref_seq.fa -s 0.001 -R 2 -d 0.0001 -v 0.000001 -c gzip -o ref22 >SimDiploid.out 2>SimDiploid.err
pirs simulate -A dist ref_seq.fa ref22.snp.indel.inversion.fa.gz -d -M lowercase -m 800 -l 100 -x 10 -v 40 -o Illumina >SimReads.out 2>SimReads.err
pirs simulate ref_seq.fa ref22.snp.indel.inversion.fa.gz -d -M lowercase -m 800 -l 100 -x 10 -v 40 -o EAMSS2 >SimReadsEAMSS2.out 2>SimReadsEAMSS2.err
