1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#!/bin/bash
set -e
if [ "$AUTOPKGTEST_TMP" = "" ] ; then
AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
fi
cp /usr/share/doc/seqkit-examples/tests/SIRV_150601a.fasta.gz $AUTOPKGTEST_TMP
cp /usr/share/samtools/test/ampliconclip/ac_test.bed $AUTOPKGTEST_TMP
cp /usr/share/samtools/test/dat/view.001.sam $AUTOPKGTEST_TMP
cd $AUTOPKGTEST_TMP
gunzip -r *
mv SIRV_150601a.fasta input.fasta
echo "Test 1 - Get length for sequences"
bioawk -c fastx '{ print $name, length($seq) }' input.fasta 1>test1 2>>test1
[ -s test1 ] || exit 1
echo "================================="
echo "PASS"
echo "Test 2 - Get reverse compliment"
bioawk -c fastx '{ print ">"$name;print revcomp($seq) }' input.fasta 1>test2 2>>test2
[ -s test2 ] || exit 1
echo "=================================="
echo "PASS"
echo "Test 3 - Convert FASTA to tabular form"
bioawk -t -c fastx '{ print $name, $seq }' input.fasta 1>test3 2>>test3
[ -s test3 ] || exit 1
echo "=================================="
echo "PASS"
echo "Test 4 - Print feature length"
bioawk -c bed '{ print $end - $start }' ac_test.bed 1>test4 2>>test4
[ "$(cat test4 | wc -l)" -gt 1 ] || exit 1
[ -s test4 ] || exit 1
echo "=================================="
echo "PASS"
echo "Test 5 - Extract mapped reads"
bioawk -c sam -H '!and($flag,4)' view.001.sam 1>test5 2>>test5
[ -s test5 ] || exit 1
echo "=================================="
echo "PASS"
|