perl - How to get status update in NCBI standalone BLAST? -
for example, running standalone blast+ thousands of est sequences remote (ncbi) server. not getting status message 15 of 100 sequence running. possible status message that? or other way send 1 after sequence using perl scripts?
many thanks!
i suggest using bioperl (http://metacpan.org/pod/bioperl) , bio::tools::run::remoteblast
module. see http://metacpan.org/pod/bio::tools::run::remoteblast , here code example give in remoteblast.pm module
while (my $input = $str->next_seq()){ #blast sequence against database: #alternatively, pass in file many #sequences rather loop through sequence 1 @ time #remove loop starting 'while (my $input = $str->next_seq())' #and swap 2 lines below example of that. $r = $factory->submit_blast($input); #my $r = $factory->submit_blast('amino.fa'); print stderr "waiting..." if( $v > 0 ); while ( @rids = $factory->each_rid ) { foreach $rid ( @rids ) { $rc = $factory->retrieve_blast($rid); if( !ref($rc) ) { if( $rc < 0 ) { $factory->remove_rid($rid); } print stderr "." if ( $v > 0 ); sleep 5; } else { $result = $rc->next_result(); #save output $filename = $result->query_name()."\.out"; $factory->save_output($filename); $factory->remove_rid($rid); print "\nquery name: ", $result->query_name(), "\n"; while ( $hit = $result->next_hit ) { next unless ( $v > 0); print "\thit name ", $hit->name, "\n"; while( $hsp = $hit->next_hsp ) { print "\t\tscore ", $hsp->score, "\n"; } } } } } }
look @ method retrieve_blast
(http://metacpan.org/pod/bio::tools::run::remoteblast#retrieve_blast). return status code let know if blast job finished. let me know if have more questions , try clarify further.
paul
Comments
Post a Comment