#!/usr/bin/perl -w use strict; use warnings; use Bio::SeqIO; use Bio::Tools::Run::RemoteBlast; use Bio::Seq; use IO::String; use Bio::SearchIO; my $prog = 'blastp'; my $db = 'swissprot'; my $e_val= '20000'; my $matrix = 'PAM30'; #my $outfile = 'Output'; my @data; my $line_dataArray; my $rid; my $count = 1; my @params = ( '-prog' => $prog, '-data' => $db, '-expect' => $e_val, '-matrix' => $matrix); my $seqio_obj = Bio::SeqIO->new(-file => "Perm.txt", -format => "raw", ); print "entering blast...."; my $factory = Bio::Tools::Run::RemoteBlast->new (@params); print "Blast entered successfully \n"; while( my $query = $seqio_obj->next_seq ) { print "submit Sequence...just do it....\n"; my $r = $factory->submit_blast($query); print $query->seq; print "\n"; # Wait for the reply and save the output file print "entering while loop for saving Output.... \n"; while ( my @rids = $factory->each_rid ) { foreach my $rid ( @rids ) { my $rc = $factory->retrieve_blast($rid); print "retrieved Results successfully \n"; if( !ref($rc) ) { if( $rc < 0 ) { $factory->remove_rid($rid); } sleep 5; } else { #my $result = $rc->next_result; print $rid; print "\n"; my $filename = " $count .out"; $factory->save_output($filename); print "File saved successfully \n"; $count++; $factory->remove_rid($rid); # } } } print "\n"; print "\n"; } }