| 1 |
#! /bin/sh |
| 2 |
set -e |
| 3 |
|
| 4 |
if ! dpkg --listfiles freebayes > /dev/null 2>&1 |
| 5 |
then |
| 6 |
cat >&2 <<-END |
| 7 |
error: package freebayes needed: provides test data for cuteSV. |
| 8 |
END |
| 9 |
exit 1 |
| 10 |
fi |
| 11 |
|
| 12 |
if [ "$AUTOPKGTEST_TMP" = "" ] |
| 13 |
then |
| 14 |
AUTOPKGTEST_TMP="$(mktemp -d /tmp/cutesv-test.XXXXXX)" |
| 15 |
trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM |
| 16 |
fi |
| 17 |
|
| 18 |
cd "$AUTOPKGTEST_TMP" |
| 19 |
|
| 20 |
set -x |
| 21 |
cuteSV --version |
| 22 |
cuteSV --help |
| 23 |
cuteSV \ |
| 24 |
/usr/share/doc/freebayes/examples/tiny/NA12878.chr22.tiny.hla.bam \ |
| 25 |
/usr/share/doc/freebayes/examples/tiny/hla.fa \ |
| 26 |
out1.vcf . |
| 27 |
cuteSV -t "$(nproc)" \ |
| 28 |
/usr/share/doc/freebayes/examples/tiny/1read.bam \ |
| 29 |
/usr/share/doc/freebayes/examples/tiny/hla.fa \ |
| 30 |
out2.vcf . |
| 31 |
cuteSV --genotype \ |
| 32 |
/usr/share/doc/freebayes/examples/tiny/NA12878.chr22.tiny.bam \ |
| 33 |
/usr/share/doc/freebayes/examples/tiny/q.fa \ |
| 34 |
out3.vcf . |
| 35 |
cuteSV -t "$(nproc)" --genotype \ |
| 36 |
/usr/share/doc/freebayes/examples/splice/1:883884-887618.bam \ |
| 37 |
/usr/share/doc/freebayes/examples/splice/1:883884-887618.fa \ |
| 38 |
out4.vcf . |
| 39 |
|
| 40 |
for vcf in out*.vcf |
| 41 |
do |
| 42 |
test "$(sed -n '1s/v[0-9.]\+$//p' "$vcf")" = "##fileformat=VCF" |
| 43 |
test "$(sed -n '2s/-[0-9.]\+$//p' "$vcf")" = "##source=cuteSV" |
| 44 |
done |
| 45 |
|
| 46 |
set +x |
| 47 |
echo PASS |