| 1 |
#! /usr/bin/perl |
| 2 |
|
| 3 |
# bug i39 - cmbuild -O can give corrupt alignment for zero bp models |
| 4 |
# |
| 5 |
# EPN, Thu Jun 20 15:09:39 2013 |
| 6 |
# |
| 7 |
|
| 8 |
$usage = "perl bug-i39.pl <cmbuild>\n"; |
| 9 |
if ($#ARGV != 0) { die "Wrong argument number.\n$usage"; } |
| 10 |
|
| 11 |
$cmbuild = shift; |
| 12 |
$ok = 1; |
| 13 |
|
| 14 |
# Make our test alignment, i39.1 |
| 15 |
# |
| 16 |
open (OUT, ">i39.1") || die; |
| 17 |
print OUT <<END; |
| 18 |
# STOCKHOLM 1.0 |
| 19 |
|
| 20 |
seq1 tgA. |
| 21 |
seq2 .g.. |
| 22 |
seq3 tg.. |
| 23 |
// |
| 24 |
END |
| 25 |
close OUT; |
| 26 |
|
| 27 |
# build the model |
| 28 |
if ($ok) { |
| 29 |
$output = `$cmbuild --noss -O i39.2 -F i39.cm i39.1`; |
| 30 |
if ($? != 0) { $ok = 0; } |
| 31 |
# make sure output includes a 'CPU' string indicating success |
| 32 |
if($output !~ /\n\# CPU/) { |
| 33 |
$ok = 0; |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
# try to build another model from the output alignment to check it's validity |
| 38 |
if ($ok) { |
| 39 |
$output = `$cmbuild --noss -F i39.2.cm i39.2`; |
| 40 |
if ($? != 0) { $ok = 0; } |
| 41 |
# make sure output includes a 'CPU' string indicating success |
| 42 |
if($output !~ /\n\# CPU/) { |
| 43 |
$ok = 0; |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
foreach $tmpfile ("i39.1", "i39.2", "i39.cm", "i39.2.cm") { |
| 48 |
unlink $tmpfile if -e $tmpfile; |
| 49 |
} |
| 50 |
if ($ok) { print "ok\n"; exit 0; } |
| 51 |
else { print "FAILED\n"; exit 1; } |
| 52 |
|
| 53 |
|