Debian Codegraph @

testsuite/bug-i33.pl

raw
1 #! /usr/bin/perl
2
3 # bug i33 - cmsearch -A with cmconvert'ed CM files originally built
4 # from v1.0 can lead to corrupt output alignments due to
5 # changes in SS_cons->CM construction procedure (to fix
6 # bugs i19 and i20.
7 #
8 # EPN, Tue Oct 30 11:41:37 2012
9 #
10 # i33.1 = sequence to search that causes this script to fail v1.1rc1
11 # i33.2 = output alignment from cmsearch -A
12 # i33.3 = output model, built from i33.2
13
14 $usage = "perl bug-i33.pl <cmsearch> <cmbuild> <path to bug-i33.cm>\n";
15 if ($#ARGV != 2) { die "Wrong argument number.\n$usage"; }
16
17 $cmsearch = shift;
18 $cmbuild = shift;
19 $cmfile = shift;
20 $ok = 1;
21
22 # Make our test sequence file, i33.1
23 #
24 open (OUT, ">i33.1") || die;
25 print OUT <<END;
26 >seq1
27 GGCUUUGGGAUGUCGGGUGUAAAGUACCCGCGAAGCC
28 END
29 close OUT;
30
31 if ($ok) {
32 system("$cmsearch -A i33.2 $cmfile i33.1 > /dev/null 2> /dev/null");
33 if ($? != 0) { $ok = 0; }
34 }
35
36 # try to build a model from i33.2, this verifies it is a valid stockholm alignment
37 if ($ok) {
38 system("$cmbuild -F i33.3 i33.2 > /dev/null 2> /dev/null");
39 if ($? != 0) { $ok = 0; }
40 }
41
42 foreach $tmpfile ("i33.1", "i33.2", "i33.3") {
43 unlink $tmpfile if -e $tmpfile;
44 }
45 if ($ok) { print "ok\n"; exit 0; }
46 else { print "FAILED\n"; exit 1; }
47
48