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 47 48 49 50 51 52 53 54 55 56 57 58
|
#!/bin/sh
# autopkgtest check: Run sumatra on two different files with three sequences
# in each. We use a threshold of 0.7 and then 0.8, and we check that
# * 3 sequences are read in each file;
# * 5 lines are output if the threshold is 0.7;
# * 3 lines are output if the threshold is 0.8.
# (C) 2020 Pierre Gruet.
# Author: Pierre Gruet <pgt@debian.org>
set -e
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > input1.fasta
>SEQ1
ATGTGATCAATGCTGCTAGCTGCTAGCTGCTACGCACACGTGCATCGCTGCATGCACTGCTGCTGATGCTCAGCTAG
>SEQ2
AGGTATCTCGATCGATCACTCGCATCGTGTGCTAGCTGCTAGCTGCTACGATCGCATCGC
>SEQ3
AGGTATCTCGATCGATCACTCGCATCGTGTGCTAGCTGCTAGCTGCTACGATCGCATCGC
EOF
cat <<EOF > input2.fasta
>SEQ1
ATGTATATCGTAGCTCTGCTGCTACGCACACGTGCATCGCTGCATGCACTGCTGCTGATGCTCAGCTAG
>SEQ2
AGGTACTCGATCGATCATCCACGTGTCTAGCTGCTAGCTGCTACGATCGCATCGC
>SEQ3
AGGTAGATCGATCACTCGCATCGTGCTGCTACGATCGCATCGC
EOF
sumatra -t 0.7 input1.fasta input2.fasta 2>&1 | \
sed -n 's/^3.sequences//p' | \
wc -l |
grep -q "2"
if [ $? -ne 0 ]; then
exit 1
fi
sumatra -t 0.7 input1.fasta input2.fasta 2>&1 | \
sed -n 's/^SEQ.*SEQ//p' | \
wc -l |
grep -q "5"
if [ $? -ne 0 ]; then
exit 1
fi
sumatra -t 0.8 input1.fasta input2.fasta 2>&1 | \
sed -n 's/^SEQ.*SEQ//p' | \
wc -l |
grep -q "3"
if [ $? -ne 0 ]; then
exit 1
fi
|