| 1 |
#! /usr/bin/perl |
| 2 |
|
| 3 |
# bug i36 - HMM banded traceback would (very rarely) fail due |
| 4 |
# to an out-of-bounds DP cell being used in the traceback. |
| 5 |
# |
| 6 |
# EPN, Fri Apr 19 10:58:21 2013 |
| 7 |
# |
| 8 |
# i36.1: fasta file to test for bug (sequence reported by Zasha) |
| 9 |
# i36.2: fasta file to test for bug (sequence found in Rfamseq) |
| 10 |
|
| 11 |
$usage = "perl bug-i36.pl <cmsearch> <path to bug-i36.cm>\n"; |
| 12 |
if ($#ARGV != 1) { die "Wrong argument number.\n$usage"; } |
| 13 |
|
| 14 |
$cmsearch = shift; |
| 15 |
$cmfile = shift; |
| 16 |
$ok = 1; |
| 17 |
|
| 18 |
# Make our test sequence file, i33.1 |
| 19 |
# |
| 20 |
open (OUT, ">i36.1") || die; |
| 21 |
print OUT <<END; |
| 22 |
>problemsequence |
| 23 |
UCAUAGUUACCCCGGGUUAUAGCCAUUCAUCUGUAGAUACUCAGAUAAAUCUAUACAAAAAUCAGGCCAUCAAAAAAGAC |
| 24 |
AGUGUUCUGACACCAGCAUAUCCUGUUUAGUUCGCAGAGCAAAAUAGUCAACAACGCUGCGGCUGCAAGUACGACAUAUC |
| 25 |
UAUUCUCUAAGUAAUUGCUGUUGCAGCUAGGCGACAAGAGUUCUAGUCCCCAGGAGCAUAGUUCACUAUGUGACUGGGGC |
| 26 |
UAGGACGUGAAGUCAACAACGCUGCGGCUGCAAGCACGACAUAUGUAUCCUCUAAGUAAUUGCUGUUGCAGCUAGGCGAC |
| 27 |
AAGAGUUCUAGUCCUCAGGAGCAUAGUUCACUAUGUGACUGGGGUUAGGACGUGAAGUCAACAACGCUGCGGCAGUAAGU |
| 28 |
END |
| 29 |
close OUT; |
| 30 |
open (OUT, ">i36.2") || die; |
| 31 |
print OUT <<END; |
| 32 |
>AFCV01000838.1/1524-1401 Salmonella enterica subsp. enterica serovar Uganda str. R8-3404 Contig838, whole genome shotgun sequence. |
| 33 |
CTGAGGATGTTTTTACAATAACGATACGCAACATCATTCGGGATGCATCGCGGCGGTAAG |
| 34 |
CGAGGAAATCTCCAGGAGCATAGATAACGATGTGANNNCACACACTTAATTAATTAAGTG |
| 35 |
TGTG |
| 36 |
END |
| 37 |
close OUT; |
| 38 |
|
| 39 |
if ($ok) { |
| 40 |
$output = `$cmsearch --tau 1E-5 --toponly --cyk --cpu 0 --notrunc --rfam $cmfile i36.1`; |
| 41 |
if ($? != 0) { $ok = 0; } |
| 42 |
# make sure output includes an 'ok' string indictating success |
| 43 |
if($output !~ /\n.ok.\n/) { |
| 44 |
$ok = 0; |
| 45 |
} |
| 46 |
|
| 47 |
$output = `$cmsearch --cpu 0 $cmfile i36.2`; |
| 48 |
if ($? != 0) { $ok = 0; } |
| 49 |
# make sure output includes an 'ok' string indictating success |
| 50 |
if($output !~ /\n.ok.\n/) { |
| 51 |
$ok = 0; |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
foreach $tmpfile ("i36.1", "i36.2") { |
| 56 |
unlink $tmpfile if -e $tmpfile; |
| 57 |
} |
| 58 |
if ($ok) { print "ok\n"; exit 0; } |
| 59 |
else { print "FAILED\n"; exit 1; } |
| 60 |
|
| 61 |
|