| 1 |
#! /usr/bin/perl |
| 2 |
|
| 3 |
# bug i11 - Incorrect insert state detachment in zero length |
| 4 |
# hairpin loops |
| 5 |
# EPN, Wed Jan 10 15:35:58 2007 |
| 6 |
# |
| 7 |
# cmalign --hbanded (or any executable that builds a CP9 HMM) |
| 8 |
# will fail if built on a model with two consensus positions |
| 9 |
# modelled by the same base pair. |
| 10 |
|
| 11 |
# |
| 12 |
# i11.1 = simple example alignment (1 seq) |
| 13 |
# i11.2 = sequence to align (irrelevant really) |
| 14 |
|
| 15 |
$usage = "perl bug-i11.pl <cmbuild> <cmalign>\n"; |
| 16 |
if ($#ARGV != 1) { die "Wrong argument number.\n$usage"; } |
| 17 |
|
| 18 |
$cmbuild = shift; |
| 19 |
$cmalign = shift; |
| 20 |
$ok = 1; |
| 21 |
|
| 22 |
# Make our test alignment file, i11.1 |
| 23 |
# |
| 24 |
open (OUT, ">i11.1") || die; |
| 25 |
print OUT <<END; |
| 26 |
# STOCKHOLM 1.0 |
| 27 |
|
| 28 |
human ACG |
| 29 |
#=GC SS_cons :<> |
| 30 |
#=GC RF xxx |
| 31 |
// |
| 32 |
END |
| 33 |
close OUT; |
| 34 |
|
| 35 |
# Make our test sequence file, i11.2 |
| 36 |
# |
| 37 |
open (OUT, ">i11.2") || die; |
| 38 |
print OUT <<END; |
| 39 |
>seq |
| 40 |
A |
| 41 |
END |
| 42 |
close OUT; |
| 43 |
|
| 44 |
if ($ok) { |
| 45 |
system("$cmbuild -F --hand i11.cm i11.1 > /dev/null 2> /dev/null"); |
| 46 |
if ($? != 0) { $ok = 0; } |
| 47 |
} |
| 48 |
if ($ok) { |
| 49 |
system("$cmalign --notrunc i11.cm i11.2 > /dev/null 2> /dev/null"); |
| 50 |
if ($? != 0) { $ok = 0; } |
| 51 |
} |
| 52 |
|
| 53 |
foreach $tmpfile ("i11.1", "i11.2", "i11.cm") { |
| 54 |
unlink $tmpfile if -e $tmpfile; |
| 55 |
} |
| 56 |
|
| 57 |
if ($ok) { print "ok\n"; exit 0; } |
| 58 |
else { print "FAILED\n"; exit 1; } |
| 59 |
|
| 60 |
|