File: alignmentOneInput

package info (click to toggle)
sumatra 1.0.36%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 344 kB
  • sloc: ansic: 651; sh: 127; makefile: 42
file content (50 lines) | stat: -rw-r--r-- 1,109 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
# autopkgtest check: Run sumatra on one single file with three sequences to 
# test alignment against itself. We use a threshold of 0.5 and then a 
# threshold of 0.6, and we check that
# * 3 sequences are read in the file;
# * 3 lines are output with a threshold of 0.5;
# * 1 line is output with a threshold of 1.
# (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 > input.fasta
>SEQ1
ATGTGATCAATGCTGCTAGCTGCTAGCTGCTACGCACACGTGCATCGCTGCATGCACTGCTGCTGATGCTCAGCTAG
>SEQ2
AGGTATCTCGATCGATCACTCGCATCGTGTGCTAGCTGCTAGCTGCTACGATCGCATCGC
>SEQ3
AGGTATCTCGATCGATCACTCGCATCGTGTGCTAGCTGCTAGCTGCTACGATCGCATCGC
EOF

sumatra -t 0.5 input.fasta 2>&1 | \
  sed -n 's/^3.sequences//p' | \
  wc -l |
  grep -q "1"

if [ $? -ne 0 ]; then
  exit 1
fi

sumatra -t 0.5 input.fasta 2>&1 | \
  sed -n 's/^SEQ.*SEQ//p' | \
  wc -l |
  grep -q "3"

if [ $? -ne 0 ]; then
  exit 1
fi

sumatra -t 0.6 input.fasta 2>&1 | \
  sed -n 's/^SEQ.*SEQ//p' | \
  wc -l |
  grep -q "1"

if [ $? -ne 0 ]; then
  exit 1
fi