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