Debian Codegraph @

testsuite/bug-i49.pl

raw
1 #! /usr/bin/perl
2
3 # bug i49 - cmscan/cmsearch removes overlapping hits (--hmmonly)
4 #
5 # EPN, Sat Nov 9 16:43:00 2019
6 #
7
8 $usage = "perl bug-i49.pl <cmsearch> <path to bug-i49.cm> <path to bug-i49.fa>\n";
9 if ($#ARGV != 2) { die "Wrong argument number.\n$usage"; }
10
11 $cmsearch = shift;
12 $cmfile = shift;
13 $seqfile = shift;
14 $ok = 1;
15
16 if ($ok) {
17 $output = `$cmsearch --cpu 0 --toponly --tblout i49.tbl $cmfile $seqfile > /dev/null`;
18 if ($? != 0) { $ok = 0; }
19 # make sure there's two hits in the tab file (if the bug exists, there will be only 1 hit)
20 if(open(IN, "i49.tbl")) {
21 $ok = 0;
22 $nhit = 0;
23 while($line = <IN>) {
24 chomp $line;
25 if($line !~ m/^\#/) { $nhit++; }
26 }
27 close(IN);
28 if($nhit == 2) { $ok = 1; }
29 }
30 else {
31 $ok = 0;
32 }
33 }
34 foreach $tmpfile ("i49.tbl") {
35 unlink $tmpfile if -e $tmpfile;
36 }
37
38 if ($ok) { print "ok\n"; exit 0; }
39 else { print "FAILED\n"; exit 1; }
40
41