By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,374 Members | 2,014 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,374 IT Pros & Developers. It's quick & easy.

First ten hits, blast scripts

P: 2
hi, I need help with my blast script. I need to specify that i need only the first ten hits, any idea how i could go about that?Thanks. here;s the script

Expand|Select|Wrap|Line Numbers
  1. #! /usr/bin/perl
  2. use warnings;
  3. use strict;
  4.  
  5. use Bio::SeqIO;
  6. use Bio::Seq;
  7. use Bio::Tools::Run::StandAloneBlast;
  8.  
  9. my $seqio_obj;
  10. my $seq_obj;
  11. my @params;
  12. my $blast_obj;
  13. my $result_obj;
  14. my $report_obj;
  15.  
  16. $seqio_obj = Bio::SeqIO->new(-file => 'seq.fasta',
  17. -format => 'fasta' );
  18. # to wrtie the sequence to afasta file
  19. $seq_obj = $seqio_obj->next_seq;
  20. #print $seq_obj->seq,"\n";
  21. @params = (program => 'blastp',
  22. database => 'pdbaa',
  23. outfile => 'blast1.out');
  24. $blast_obj = Bio::Tools::Run::StandAloneBlast->new(@params);
  25. $report_obj = $blast_obj->blastall($seq_obj);
  26. $result_obj = $report_obj->next_result;
  27. print $result_obj->num_hits;
  28.  
Jul 15 '09 #1
Share this Question
Share on Google+
1 Reply


numberwhun
Expert Mod 2.5K+
P: 3,503
First, please use code tags. They are required around any and all code that you post in the forums.

Second, I don't really know all that much about BioPerl, but if you only want the first 10 of something, cycle through it and use a counter, exiting once it is greater than 10. Just a thought.

Regards,

Jeff
Jul 19 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.