Debian Codegraph @

hmmer/testsuite/i16-build-allins.pl

raw
1 #! /usr/bin/perl
2
3 # Bug #h82: hmmbuild corrupts resave alignment on all-insert seq
4 #
5 # Usage: ./i16-build-allins.pl <builddir> <srcdir> <tmpfile prefix>
6 # Example: ./i16-build-allins.pl .. .. tmpfoo
7 #
8 # SRE, Sun Jun 13 12:09:54 2010 [UA231 IAD->SAN]
9
10
11 BEGIN {
12 $builddir = shift;
13 $srcdir = shift;
14 $tmppfx = shift;
15 }
16
17 # Verify that we have all the executables we need for the test.
18 if (! -x "$builddir/src/hmmbuild") { die "FAIL: didn't find hmmconvert binary in $builddir/src\n"; }
19
20 # Create the test file
21 open(MSA, ">$tmppfx.sto") || die "FAIL: couldn't create $tmppfx.sto";
22 print MSA << "EOF";
23 # STOCKHOLM 1.0
24
25 seq1 ACD...E
26 seq2 FGH...I
27 seq3 KLM...N
28 seqx ---pqr-
29 #=GC RF xxx...x
30 //
31 EOF
32 close MSA;
33
34 $output = `$builddir/src/hmmbuild -O $tmppfx.sto2 --hand $tmppfx.hmm $tmppfx.sto`;
35 if ($? != 0) { die "FAIL: hmmbuild failed unexpectedly\n"; }
36
37 $output = `grep "^seqx" $tmppfx.sto2`;
38 if ($? != 0) { die "FAIL: grep failed unexpectedly\n"; }
39
40 if ($output !~ /^seqx\s+~~~pqr~/) { die "FAIL: bug #h82\n"; }
41
42 print "ok\n";
43 unlink "$tmppfx.sto";
44 unlink "$tmppfx.sto2";
45 unlink "$tmppfx.hmm";
46 exit 0;