| 1 |
#! /usr/bin/perl |
| 2 |
|
| 3 |
# Test the hmmalign --mapali option. |
| 4 |
# |
| 5 |
# Usage: ./i6-hmmalign-mapali.pl <hmmalign binary> <esl-reformat binary> <testsuitedir> <tmpfile prefix> |
| 6 |
# Example: ./i6-hmmalign-mapali.pl ../src/hmmalign ../easel/miniapps/esl-reformat . foo |
| 7 |
# |
| 8 |
# SRE, Mon May 25 09:52:48 2009 |
| 9 |
|
| 10 |
|
| 11 |
$hmmalign = shift; |
| 12 |
$eslreformat = shift; |
| 13 |
$testsuitedir = shift; |
| 14 |
$tmppfx = shift; |
| 15 |
|
| 16 |
if (! -x "$hmmalign") { print "FAIL: didn't find hmmalign binary $hmmalign\n"; exit 1; } |
| 17 |
if (! -x "$eslreformat") { print "FAIL: didn't find esl-reformat binary $eslreformat\n"; exit 1; } |
| 18 |
if (! -r "$testsuitedir/Caudal_act.hmm") { print "FAIL: didn't find $testsuitedir/Caudal_act.hmm\n"; exit 1; } |
| 19 |
if (! -r "$testsuitedir/Caudal_act.sto") { print "FAIL: didn't find $testsuitedir/Caudal_act.sto\n"; exit 1; } |
| 20 |
|
| 21 |
|
| 22 |
system("$eslreformat -u --rename foo fasta $testsuitedir/Caudal_act.sto > $tmppfx.fa"); |
| 23 |
if ($? != 0) { print "FAIL: esl-reformat failed unexpectedly\n"; exit 1; } |
| 24 |
|
| 25 |
system("$hmmalign -o $tmppfx.sto --mapali $testsuitedir/Caudal_act.sto $testsuitedir/Caudal_act.hmm $tmppfx.fa"); |
| 26 |
if ($? != 0) { print "FAIL: hmmalign failed unexpectedly\n"; exit 1; } |
| 27 |
|
| 28 |
system("$eslreformat -u fasta $tmppfx.sto > $tmppfx.2.fa"); |
| 29 |
if ($? != 0) { print "FAIL: esl-reformat failed unexpectedly\n"; exit 1; } |
| 30 |
|
| 31 |
system("$eslreformat -u fasta $testsuitedir/Caudal_act.sto > $tmppfx.3.fa"); |
| 32 |
if ($? != 0) { print "FAIL: esl-reformat failed unexpectedly\n"; exit 1; } |
| 33 |
|
| 34 |
system("cat $tmppfx.fa >> $tmppfx.3.fa"); |
| 35 |
if ($? != 0) { print "FAIL: cat failed unexpectedly\n"; exit 1; } |
| 36 |
|
| 37 |
system("diff $tmppfx.2.fa $tmppfx.3.fa"); |
| 38 |
if ($? != 0) { print "FAIL: --mapali doesn't produce expected sequences\n"; exit 1; } |
| 39 |
|
| 40 |
print "ok\n"; |
| 41 |
unlink "$tmppfx.fa"; |
| 42 |
unlink "$tmppfx.sto"; |
| 43 |
unlink "$tmppfx.2.fa"; |
| 44 |
unlink "$tmppfx.3.fa"; |
| 45 |
exit 0; |