#!/usr/bin/perl

#genome file
if (! open (F1, $ARGV[0])) {
    print "file not found: $ARGV[0]\n";
    exit;
}

#bbh file
if (! open (F2, $ARGV[1])) {
    print "file not found: $ARGV[1]\n";
    exit;
}

while ($x = <F1>) {
    if ($x =~ />(\S+) /) {
	$name=$1;
	$name =~  s/\|/\\\|/g;
	push(@t, $name);
    }
}

while ($x = <F2>) {
    chomp $x;
    $tout .= $x;
}

#print $tout, "\n";

print "\nMissing entries: \n";
foreach $i (@t)  {
    if ($tout !~ /$i/) {
	$notfound++;
	$i =~  s/\\\|/\|/g;
	print "$i\n";
    }
}

print "\nTotal entries: ", $#t+1, "  Missing: ", $notfound, "\n";


