File: clusterTwoInputsTwoThresholds

package info (click to toggle)
sumaclust 1.0.36%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 452 kB
  • sloc: ansic: 2,191; sh: 111; makefile: 100
file content (37 lines) | stat: -rw-r--r-- 886 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
#!/bin/sh
# autopkgtest check: Run sumaclust on two different chains with two different 
# thresholds: 0.9 and 0.8. The first run must result in 2 clusters, the second 
# one must result in 1 cluster.
# (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 > inputTwoDifferent.fasta
>SEQ_TEST1
CCAGATCTAGCTAGCTAGCTACAGCATCGACATCAGCACTCAGCACTCAG
>SEQ_TEST2
CCAGATGATCTAGCTAGCTAGCTACAGCATTTGAACATCAGCACTGGATCAG
EOF

sumaclust -t 0.9 inputTwoDifferent.fasta 2>&1 | \
  sed -n '/clusters/ s/.*Done : 100 \% *//p' | \
  sed -n 's/ clusters.*//p' | \
  grep -q "2"

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

sumaclust -t 0.8 inputTwoDifferent.fasta 2>&1 | \
  sed -n '/clusters/ s/.*Done : 100 \% *//p' | \
  sed -n 's/ clusters.*//p' | \
  grep -q "1"

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