#!/usr/bin/perl use strict; use warnings; my @roundData = (<', \$fastaDbs[-1]; # parse blast output (tab form) and add matched id's in hits hash while (defined (my $line = <$parse>)) { chomp $line; my @fields = split(/\t/, $line); ++$queryids{$fields[0]}; ++$hits{$fields[1]}; } # get header and sequence with 'fastacmd' and write to new fasta file my $hitcount; for my $hit (keys %hits) { next if exists $queryids{$hit}; # only write uniq ids to file print $fasta "fastacmd -d $blastdb -s 'lcl|$hit'\n"; $hitcount++; } close $fasta; close $parse; if ($hitcount) { print "Round $round has $hitcount unique hits\n\n"; next; } print "No hits in Round $round ==> STOP\n"; last; } print '-' x 20, "\n$_\n" for @fastaDbs; print "Total uniq hits found in all rounds: ", scalar keys %hits, "\n"; }