
use strict;
use File::Glob ":bsd_glob";
    
my $dir = shift;

my @files = bsd_glob("$dir/*");

foreach my $f (@files) {
    chomp($f);
    if ($f !~ /\.nhr$|\.nin$|\.nsd$|\.nsi$|\.nsq$|protein/) {
	print STDERR "indexing $f...\n";
	system("makeblastdb -in $f -title $f -dbtype nucl  -parse_seqids");
    }
    else {
	print STDERR "Ignoring $f.\n";
    }
}
print STDERR "Done.\n";
