| 1 |
#! /usr/bin/perl |
| 2 |
|
| 3 |
# bug i15 - cmalign HMM banded optimal accuracy alignments can include |
| 4 |
# B states with impossible children. |
| 5 |
# |
| 6 |
# |
| 7 |
# EPN, Tue Nov 17 11:20:24 2009 |
| 8 |
# |
| 9 |
# In very rare cases when aligning to a CM using HMM banded optimal accuracy, |
| 10 |
# the optimal parse, the parse that maximizes the summed posterior labelling |
| 11 |
# of all emitted residues, includes a B state with left and right |
| 12 |
# subtrees, one of which has an IMPOSSIBLE score. |
| 13 |
# See BUGTRAX i15 description for more information. |
| 14 |
# |
| 15 |
# bug-i15.sto - SSU-ALIGN 0.1 bacteria seed alignment, with pre-defined |
| 16 |
# RF line created by any column with < 80% gaps as an 'x', |
| 17 |
# and all other columns as '.' |
| 18 |
# bug-i15.fa - a SSU sequence that causes the bug *AT LEAST IN INFERNAL 1.0.2* |
| 19 |
# it does not reproduce in current development code svn r3046, |
| 20 |
# and I'm not sure why (it is NOT b/c the bug was fixed but |
| 21 |
# rather due to some other code difference (in easel?), i.e. |
| 22 |
# the bug does not manifest itself in this example in r3046, |
| 23 |
# even though it is there and could manifest itself in other |
| 24 |
# examples.) |
| 25 |
|
| 26 |
$usage = "perl bug-i15.pl <cmbuild> <cmalign> <path to bug-i15.sto> <path to bug-i15.fa>\n"; |
| 27 |
if ($#ARGV != 3) { die "Wrong argument number.\n$usage"; } |
| 28 |
|
| 29 |
$cmbuild = shift; |
| 30 |
$cmalign = shift; |
| 31 |
$alifile = shift; |
| 32 |
$seqfile = shift; |
| 33 |
$ok = 1; |
| 34 |
|
| 35 |
if ($ok) { |
| 36 |
system("$cmbuild --hand --wgsc --enone -F i15.cm $alifile > /dev/null 2> /dev/null"); |
| 37 |
if ($? != 0) { $ok = 0; } |
| 38 |
} |
| 39 |
if ($ok) { |
| 40 |
system("$cmalign -g --sub --notrunc i15.cm $seqfile > /dev/null 2> /dev/null"); |
| 41 |
if ($? != 0) { $ok = 0; } |
| 42 |
} |
| 43 |
|
| 44 |
foreach $tmpfile ("i15.cm") { |
| 45 |
unlink $tmpfile if -e $tmpfile; |
| 46 |
} |
| 47 |
|
| 48 |
if ($ok) { print "ok\n"; exit 0; } |
| 49 |
else { print "FAILED\n"; exit 1; } |
| 50 |
|
| 51 |
|