| 1 |
#! /usr/bin/perl |
| 2 |
|
| 3 |
# Bug #h77: hmmalign corrupts column preceding an all-delete column |
| 4 |
# |
| 5 |
# Usage: ./i12-delete-corruption.pl <builddir> <srcdir> <tmpfile prefix> |
| 6 |
# Example: ./i12-delete-corruption.pl .. .. tmpfoo |
| 7 |
## |
| 8 |
# |
| 9 |
# This test is now obsolete. hmmalign by default now saves all |
| 10 |
# consensus columns, which removes the problematic execution path. |
| 11 |
# The hmmalign --allcol option is gone (as of 25 May 2010). |
| 12 |
# |
| 13 |
# SRE, Tue Mar 2 11:11:07 2010 [Janelia] |
| 14 |
|
| 15 |
|
| 16 |
BEGIN { |
| 17 |
$builddir = shift; |
| 18 |
$srcdir = shift; |
| 19 |
$tmppfx = shift; |
| 20 |
} |
| 21 |
|
| 22 |
# Verify that we have all the executables we need for the test. |
| 23 |
if (! -x "$builddir/src/hmmbuild") { die "FAIL: didn't find hmmbuild binary in $builddir/src\n"; } |
| 24 |
if (! -x "$builddir/src/hmmalign") { die "FAIL: didn't find hmmalign binary in $builddir/src\n"; } |
| 25 |
|
| 26 |
# Create our test files. |
| 27 |
# The test seqs are missing one column, K, in an unambiguous small alignment. |
| 28 |
if (! open(ALI1, ">$tmppfx.sto")) { die "FAIL: couldn't open $tmppfx.sto for write\n"; } |
| 29 |
if (! open(SEQ1, ">$tmppfx.fa")) { die "FAIL: couldn't open $tmppfx.fa for write\n"; } |
| 30 |
|
| 31 |
print ALI1 <<"EOF"; |
| 32 |
# STOCKHOLM 1.0 |
| 33 |
seq1 ACDEFGHIKLMNPQRSTVWY |
| 34 |
seq2 ACDEFGHIKLMNPQRSTVWY |
| 35 |
seq3 ACDEFGHIKLMNPQRSTVWY |
| 36 |
// |
| 37 |
EOF |
| 38 |
|
| 39 |
print SEQ1 <<"EOF"; |
| 40 |
>test1 |
| 41 |
ACDEFGHILMNPQRSTVWY |
| 42 |
>test2 |
| 43 |
ACDEFGHILMNPQRSTVWY |
| 44 |
EOF |
| 45 |
|
| 46 |
close ALI1; |
| 47 |
close SEQ1; |
| 48 |
|
| 49 |
@output = `$builddir/src/hmmbuild $tmppfx.hmm $tmppfx.sto 2>&1`; |
| 50 |
if ($? != 0) { die "FAIL: hmmbuild failed\n"; } |
| 51 |
|
| 52 |
$output = `$builddir/src/hmmalign $tmppfx.hmm $tmppfx.fa 2>&1`; |
| 53 |
if ($? != 0) { die "FAIL: hmmalign failed\n"; } |
| 54 |
|
| 55 |
($testseq) = ($output =~ /\ntest1\s+(\S+)/); |
| 56 |
if ($testseq ne "ACDEFGHI-LMNPQRSTVWY") { die "FAIL: test sequence corrupted by hmmalign\n"; } |
| 57 |
|
| 58 |
#$output = `$builddir/src/hmmalign --allcol $tmppfx.hmm $tmppfx.fa 2>&1`; |
| 59 |
#if ($? != 0) { die "FAIL: hmmalign failed\n"; } |
| 60 |
# |
| 61 |
#($testseq) = ($output =~ /\ntest1\s+(\S+)/); |
| 62 |
#if ($testseq ne "ACDEFGHI-LMNPQRSTVWY") { die "FAIL: hmmalign --allcol produced unexpected result\n"; } |
| 63 |
|
| 64 |
print "ok\n"; |
| 65 |
unlink "$tmppfx.sto"; |
| 66 |
unlink "$tmppfx.fa"; |
| 67 |
unlink "$tmppfx.hmm"; |
| 68 |
exit 0; |
| 69 |
|