Debian Codegraph @

hmmer/testsuite/i3-seqsearch-variation.sh

raw symbols SCIP
1 #! /bin/shscip-shell filesystem . . `/bin/sh`.
2 #
3 # Verify that phmmer/jackhmmer runs are reproducible (no stochastic variation),
4 # unless the RNG seed is deliberately varied.
5 #
6 # Example sequences here are carefully chosen to exercise stochastic clustering
7 # algorithm in domain postprocessing pipeline. [xref 2019/0410-h3-test-failures]
8 #
9 if testscip-shell system . . test. ! $# -eq 2; then
10 echoscip-shell system . . echo. "Usage: $0 <phmmer/jackhmmer binary> <tmpfile prefix>"
11 exit 1
12 fi
13
14 prog=$1; if testscip-shell system . . test. ! -x $prog; then echoscip-shell system . . echo. "FAIL: $prog not executable"; exit 1; fi
15 tmppfx=$2
16
17 # This is the 1st sequence in tutorial/fn3.sto
18 catscip-shell system . . cat. > ${tmppfx}.fa1 <<EOF
19 >LAR_DROME/418-503 P16621.2
20 SAPRNVQVRTLSSSTMVITWEPPETPNGQVTGYKVYYTTNSNQPEASWNSQMVDNSELTT
21 VSELTPHAIYTVRVQAYTSMGAGPMS
22 EOF
23
24 # This is a swissprot fragment that exercises stochastic clustering algorithm.
25 catscip-shell system . . cat. > ${tmppfx}.fa2 <<EOF
26 >sp|Q3UH53|SDK1_MOUSE/1564-1772 Protein sidekick-1 OS=Mus musculus OX=10090 GN=Sdk1 PE=1 SV=1
27 PGSVSATPHTTSSVLIQWQPPRDESLNGLLQGYRIYYRELESETGMSPEPKTLKSPSALR
28 AELTAQSSFKTVNSSSSLTTYELTHLKKYRRYEVIMTAYNIIGESPASVPVEVFVGEAAP
29 AMAPQNVQVTPLTASQLEVTWDPPPPESQNGNIQGYKVYYWEADSRNETEKMKVLFLPEP
30 VVKIKDLTSHTKYLISISAFNAAGDGPKS
31 EOF
32
33 # Running with default seed shows identical results... (a D=3 domain solution)
34 $prog ${tmppfx}.fa1 ${tmppfx}.fa2 > ${tmppfx}.out; if testscip-shell system . . test. $? -ne 0; then echoscip-shell system . . echo. "FAIL: crash"; exit 1; fi
35 catscip-shell system . . cat. ${tmppfx}.out | grepscip-shell system . . grep. -v "^#" > ${tmppfx}.out1
36 $prog ${tmppfx}.fa1 ${tmppfx}.fa2 > ${tmppfx}.out; if testscip-shell system . . test. $? -ne 0; then echoscip-shell system . . echo. "FAIL: crash"; exit 1; fi
37 catscip-shell system . . cat. ${tmppfx}.out | grepscip-shell system . . grep. -v "^#" > ${tmppfx}.out2
38 diffscip-shell system . . diff. ${tmppfx}.out1 ${tmppfx}.out2 > /dev/nullscip-shell filesystem . . `/dev/null`.; if testscip-shell system . . test. $? -ne 0; then echoscip-shell system . . echo. "FAIL: results differ"; exit 1; fi
39
40 # but running with different seeds shows different results. (D=3 and D=2 solutions)
41 $prog --seed 1 ${tmppfx}.fa1 ${tmppfx}.fa2 > ${tmppfx}.out; if testscip-shell system . . test. $? -ne 0; then echoscip-shell system . . echo. "FAIL: crash"; exit 1; fi
42 catscip-shell system . . cat. ${tmppfx}.out | grepscip-shell system . . grep. -v "^#" > ${tmppfx}.out3
43 $prog --seed 2 ${tmppfx}.fa1 ${tmppfx}.fa2 > ${tmppfx}.out; if testscip-shell system . . test. $? -ne 0; then echoscip-shell system . . echo. "FAIL: crash"; exit 1; fi
44 catscip-shell system . . cat. ${tmppfx}.out | grepscip-shell system . . grep. -v "^#" > ${tmppfx}.out4
45 diffscip-shell system . . diff. ${tmppfx}.out3 ${tmppfx}.out4 > /dev/nullscip-shell filesystem . . `/dev/null`.; if testscip-shell system . . test. $? -eq 0; then echoscip-shell system . . echo. "FAIL: results identical despite different RNG seeds"; exit 1; fi
46
47 rmscip-shell system . . rm. ${tmppfx}.fa1 ${tmppfx}.fa2 ${tmppfx}.out ${tmppfx}.out1 ${tmppfx}.out2 ${tmppfx}.out3 ${tmppfx}.out4
48
49 echoscip-shell system . . echo. "ok"
50 exit 0