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