| 1 |
#! /usr/bin/perl |
| 2 |
|
| 3 |
# bug i31 - Negative database sizes for large databases (only on 32-bit systems). |
| 4 |
# |
| 5 |
# EPN, Tue Oct 9 14:52:18 2012 |
| 6 |
# |
| 7 |
# DB sizes greater than 2,147,483,647 (2^32-1) would be converted to |
| 8 |
# negative numbers due to an overflow of a long on 32-bit systems, |
| 9 |
# before bug i31 was fixed. |
| 10 |
# |
| 11 |
# bug-i31.cm - calibrated tRNA CM, could be any model really. |
| 12 |
# bug-i31.fa - consensus sequence for bug-i31.cm, created by |
| 13 |
# cmemit -c bug-i31.cm (cmemit-1.1rc1). |
| 14 |
|
| 15 |
$usage = "perl bug-i31.pl <cmsearch> <path to bug-i31.cm> <path to bug-i31.fa>\n"; |
| 16 |
if ($#ARGV != 2) { die "Wrong argument number.\n$usage"; } |
| 17 |
|
| 18 |
$cmsearch = shift; |
| 19 |
$cmfile = shift; |
| 20 |
$seqfile = shift; |
| 21 |
$ok = 1; |
| 22 |
|
| 23 |
if ($ok) { |
| 24 |
system("$cmsearch --tblout i31.tbl -Z 5000 $cmfile $seqfile > /dev/null 2> /dev/null"); |
| 25 |
if ($? != 0) { $ok = 0; } |
| 26 |
} |
| 27 |
if ($ok) { |
| 28 |
# make sure there's a hit in the tab file (if the bug exists, there won't be) |
| 29 |
if(open(IN, "i31.tbl")) { |
| 30 |
$ok = 0; |
| 31 |
while($line = <IN>) { |
| 32 |
chomp $line; |
| 33 |
if($line !~ m/^\#/) { $ok = 1; } |
| 34 |
} |
| 35 |
close(IN); |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
foreach $tmpfile ("i31.tbl") { |
| 40 |
unlink $tmpfile if -e $tmpfile; |
| 41 |
} |
| 42 |
|
| 43 |
if ($ok) { print "ok\n"; exit 0; } |
| 44 |
else { print "FAILED\n"; exit 1; } |
| 45 |
|
| 46 |
|