473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

First ten hits, blast scripts

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
1 2870
numberwhun
3,509 Expert Mod 2GB
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

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

Similar topics

7
by: Garyrek | last post by:
Hi I have a requirement where I need to make a report for each auto dealer how many hits they got on specified date range, so for each car detail page I increment the counter and total it while...
4
by: windandwaves | last post by:
Hi Folk I am making a website that is going to get lots of hits in one go (they will be doing lots of advertising). I am a bit scared the whole thing will fall over because it will get too many...
4
by: Stefan Mueller | last post by:
I have a table dynamically created with a JavaScript (insertRow, deleteRow). At the end I'd like to go through the whole table (beginning at the first and ending at the last row) to display all the...
1
by: DKode | last post by:
Here is my scenario: I have two methods that I only wish to have run the very first time a user hits the default.aspx page. This page is protected with Forms protection. default.aspx is the base...
32
by: Nu | last post by:
I want to protect myself from if someone with a fast connection hammers my site. It's not denial of service attacks, but offline downloaders (of course that don't show they're offline downloaders...
7
by: khunohm | last post by:
I would like to know how to select each item of data from text file transfer to each column in excel file. source 1..159662 /organism="Candidatus...
0
by: fripper | last post by:
I have a VB .Net 2005 windows app that has a bunch of controls on it ... buttons, textboxes, etc. ... it is a simulation program. When the user hits "Go" some stuff happens on the screen and the...
14
by: Thomas Mlynarczyk | last post by:
Hello, I started to write a lexer in Python -- my first attempt to do something useful with Python (rather than trying out snippets from tutorials). It is not complete yet, but I would like some...
1
by: cpdrews | last post by:
I currently have a User table in my database that has the columns: Username FirstName LastName Email LastActivityDate I created a page on the website in a DotNetNuke reports module where a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.