Debian Codegraph @

testsuite/bug-i38.pl

raw
1 #! /usr/bin/perl
2
3 # bug i38 - cmalign --mapali doesn't work if aln has no SS_cons
4 #
5 # EPN, Mon Jun 17 13:20:11 2013
6 #
7
8 $usage = "perl bug-i38.pl <cmbuild> <cmalign>\n";
9 if ($#ARGV != 1) { die "Wrong argument number.\n$usage"; }
10
11 $cmbuild = shift;
12 $cmalign = shift;
13 $ok = 1;
14
15 # Make our test alignment, i38.1
16 #
17 open (OUT, ">i38.1") || die;
18 print OUT <<END;
19 # STOCKHOLM 1.0
20
21 human AAGACUUCGGAUCUGGCGACACCC
22 //
23 END
24 close OUT;
25 # Make our test sequence to align, i38.2
26 #
27 open (OUT, ">i38.2") || die;
28 print OUT <<END;
29 >mouse
30 AUACACUUCGGAUGCACCAAAGUGA
31 END
32 close OUT;
33
34 # build the model
35 if ($ok) {
36 $output = `$cmbuild -F --noss i38.cm i38.1`;
37 if ($? != 0) { $ok = 0; }
38 # make sure output includes a 'CPU' string indicating success
39 if($output !~ /\n\# CPU/) {
40 $ok = 0;
41 }
42 }
43
44 # align the sequence and use --mapali
45 if ($ok) {
46 $output = `$cmalign --noss --mapali i38.1 -o i38.3 i38.cm i38.2`;
47 if ($? != 0) { $ok = 0; }
48 # make sure output includes a 'CPU' string indicating success
49 if($output !~ /\n\# CPU/) {
50 $ok = 0;
51 }
52 }
53
54 foreach $tmpfile ("i38.1", "i38.2", "i38.3", "i38.cm") {
55 unlink $tmpfile if -e $tmpfile;
56 }
57 if ($ok) { print "ok\n"; exit 0; }
58 else { print "FAILED\n"; exit 1; }
59
60