| 1 |
#! /usr/bin/perl |
| 2 |
|
| 3 |
# bug i13 - With cmalign --sub, some seqs cannot be aligned because |
| 4 |
# they require building sub CMs with 0 BIF, MATR, and MATL |
| 5 |
# nodes. |
| 6 |
# |
| 7 |
# EPN, Tue Sep 30 09:20:30 2008 |
| 8 |
# |
| 9 |
# During development between v0.81 to v1.0 it became apparent that |
| 10 |
# CMs built with 0 BIF, MATR and MATL nodes (that is just ROOT and |
| 11 |
# MATP nodes) are problematic because it is IMPOSSIBLE to align a |
| 12 |
# single residue to them in local mode. This is because a local |
| 13 |
# begin MUST right into the first MATP_MP state from ROOT_S which |
| 14 |
# necessarily emits 2 residues. The solution I provided was to |
| 15 |
# disallow the building of such CMs, because they are unlikely to |
| 16 |
# be practical anyway (adding a single consensus single stranded |
| 17 |
# residue as a loop in between a stem sidesteps this issue). |
| 18 |
# |
| 19 |
# However, with cmalign --sub, if you are using a CM with |
| 20 |
# two adjacent consensus positions that are basepaired to |
| 21 |
# each other (i is base paired to i+1), you sometimes exit |
| 22 |
# cmalign with an error b/c a sub CM with 0 MATL, MATR nodes |
| 23 |
# is attempted to be built. This is undesirable and was |
| 24 |
# reported by the RDP guys (who use such a CM) as a bug. |
| 25 |
# I thought I had fixed it between 1.0rc2 and 1.0rc3 but |
| 26 |
# apparently I hadn't as it was reported in 1.0rc3 by |
| 27 |
# Marcus Claesson from National University of Ireland, Cork. |
| 28 |
# |
| 29 |
# The proposed fix in 1.0rc3 is to only allow such CMs to be |
| 30 |
# built in the case when we're building sub CMs, which as |
| 31 |
# currently implemented will never be localized and thus never |
| 32 |
# have the problems mentioned above. |
| 33 |
# |
| 34 |
# ~/nawrockie/notebook/8_0930_inf_bug_1rc3_sub_illegal_cm/00LOG. |
| 35 |
# |
| 36 |
# i13.1 = simple example alignment (1 seq) |
| 37 |
# i13.2 = sequence to align |
| 38 |
|
| 39 |
$usage = "perl bug-i13.pl <cmbuild> <cmalign>\n"; |
| 40 |
if ($#ARGV != 1) { die "Wrong argument number.\n$usage"; } |
| 41 |
|
| 42 |
$cmbuild = shift; |
| 43 |
$cmalign = shift; |
| 44 |
$ok = 1; |
| 45 |
|
| 46 |
# Make our test alignment file, i13.1 |
| 47 |
# |
| 48 |
open (OUT, ">i13.1") || die; |
| 49 |
print OUT <<END; |
| 50 |
# STOCKHOLM 1.0 |
| 51 |
|
| 52 |
seq1 AAGGGCCCAA |
| 53 |
#=GC RF xxxxxxxxxx |
| 54 |
#=GC SS_cons ::<<<>>>:: |
| 55 |
// |
| 56 |
END |
| 57 |
close OUT; |
| 58 |
|
| 59 |
# Make our test sequence file, i13.2 |
| 60 |
# |
| 61 |
open (OUT, ">i13.2") || die; |
| 62 |
print OUT <<END; |
| 63 |
>seq |
| 64 |
GGGCCC |
| 65 |
END |
| 66 |
close OUT; |
| 67 |
|
| 68 |
if ($ok) { |
| 69 |
system("$cmbuild -F --hand i13.cm i13.1 > /dev/null 2> /dev/null"); |
| 70 |
if ($? != 0) { $ok = 0; } |
| 71 |
} |
| 72 |
if ($ok) { |
| 73 |
system("$cmalign -g --sub --notrunc i13.cm i13.2 > /dev/null 2> /dev/null"); |
| 74 |
if ($? != 0) { $ok = 0; } |
| 75 |
} |
| 76 |
|
| 77 |
foreach $tmpfile ("i13.1", "i13.2", "i13.cm") { |
| 78 |
unlink $tmpfile if -e $tmpfile; |
| 79 |
} |
| 80 |
|
| 81 |
if ($ok) { print "ok\n"; exit 0; } |
| 82 |
else { print "FAILED\n"; exit 1; } |
| 83 |
|
| 84 |
|