| 1 |
#! /usr/bin/perl |
| 2 |
|
| 3 |
# bug i30 - Failure to allow zero length sequences in cmsearch. |
| 4 |
# |
| 5 |
# EPN, Mon Aug 27 05:51:17 2012 |
| 6 |
# |
| 7 |
# Zero length sequence in the input file would cause cmsearch to |
| 8 |
# fail before bug i30 was fixed. |
| 9 |
# |
| 10 |
|
| 11 |
$usage = "perl bug-i30.pl <cmbuild> <cmsearch>\n"; |
| 12 |
if ($#ARGV != 1) { die "Wrong argument number.\n$usage"; } |
| 13 |
|
| 14 |
$cmbuild = shift; |
| 15 |
$cmsearch = shift; |
| 16 |
$ok = 1; |
| 17 |
|
| 18 |
# Make our test alignment file, i11.1 |
| 19 |
# |
| 20 |
open (OUT, ">i30.1") || die; |
| 21 |
print OUT <<END; |
| 22 |
# STOCKHOLM 1.0 |
| 23 |
|
| 24 |
human ACG |
| 25 |
#=GC SS_cons :<> |
| 26 |
#=GC RF xxx |
| 27 |
// |
| 28 |
END |
| 29 |
close OUT; |
| 30 |
|
| 31 |
# Make our test sequence file, i11.2 |
| 32 |
# |
| 33 |
open (OUT, ">i30.2") || die; |
| 34 |
print OUT <<END; |
| 35 |
>seq1 seq1desc |
| 36 |
ACUG |
| 37 |
>seq2 |
| 38 |
>seq3 |
| 39 |
AGUCUCUG |
| 40 |
>seq4 |
| 41 |
GUCUCUCU |
| 42 |
>seq5 this is a desc |
| 43 |
>seq6 |
| 44 |
ACCGUGUGUUU |
| 45 |
END |
| 46 |
close OUT; |
| 47 |
|
| 48 |
if ($ok) { |
| 49 |
system("$cmbuild -F --hand i30.cm i30.1 > /dev/null 2> /dev/null"); |
| 50 |
if ($? != 0) { $ok = 0; } |
| 51 |
} |
| 52 |
if ($ok) { |
| 53 |
# need to use --hmmonly so we don't have to calibrate model |
| 54 |
system("$cmsearch --hmmonly i30.cm i30.2 > /dev/null 2> /dev/null"); |
| 55 |
if ($? != 0) { $ok = 0; } |
| 56 |
} |
| 57 |
|
| 58 |
foreach $tmpfile ("i30.1", "i30.2", "i30.cm") { |
| 59 |
unlink $tmpfile if -e $tmpfile; |
| 60 |
} |
| 61 |
|
| 62 |
if ($ok) { print "ok\n"; exit 0; } |
| 63 |
else { print "FAILED\n"; exit 1; } |
| 64 |
|
| 65 |
|