Debian Codegraph @

testsuite/bug-i1.pl

raw
1 #! /usr/bin/perl
2
3 # bug i1 - bad SS_cons line in vault full.
4 # SRE, Thu Jan 2 04:49:12 2003
5 # CVS $Id$
6 #
7 # A model built from vault seed, then aligned to
8 # one or more seqs in vault.full, produces an alignment
9 # that is truncated at the 3' end, with an invalid
10 # Stockholm SS_cons line.
11 #
12 # Problem manifests when target sequence doesn't have both
13 # bases in a consensus base pair, and that column happens to
14 # be at either end of the alignment (so it gets dropped).
15 # The consensus SS is then truncated as well, and only
16 # one of the < or > is annotated, not both.
17 #
18 # i1.1 = small hairpin alignment
19 # i1.2 = a 3' truncated seq
20 #
21 # xref STL7 p.12
22
23 $usage = "perl bug-i1.pl <cmbuild> <cmalign>\n";
24 if ($#ARGV != 1) { die "Wrong argument number.\n$usage"; }
25
26 $cmbuild = shift;
27 $cmalign = shift;
28 $ok = 1;
29
30
31 # Make our test alignment file, i1.1
32 #
33 open (OUT, ">i1.1") || die;
34 print OUT <<END;
35 # STOCKHOLM 1.0
36
37 seq1 GGGGAACCCC
38 seq2 GGGGAACCCC
39 #=GC SS_cons <<<<..>>>>
40 //
41 END
42 close OUT;
43
44
45 # Make our test sequence file, i1.2
46 #
47 open (OUT, ">i1.2") || die;
48 print OUT <<END;
49 >badseq
50 GGGGAACCC
51 END
52 close OUT;
53
54 if ($ok) {
55 system("$cmbuild i1.tmp.1 i1.1 > /dev/null 2> /dev/null");
56 if ($? != 0) { $ok = 0; }
57 }
58 if ($ok) {
59 system("$cmalign -o i1.tmp.2 i1.tmp.1 i1.2 > /dev/null 2> /dev/null");
60 if ($? != 0) { $ok = 0; }
61 }
62 if ($ok) {
63 system("$cmbuild -F i1.tmp.1 i1.tmp.2 > /dev/null 2> /dev/null");
64 if ($? != 0) { $ok = 0; }
65 }
66
67 foreach $tmpfile ("i1.1", "i1.2", "i1.tmp.1", "i1.tmp.2") {
68 unlink $tmpfile if -e $tmpfile;
69 }
70
71 if ($ok) { print "ok\n"; exit 0; }
72 else { print "FAILED\n"; exit 1; }
73
74