Question and Background I'm using NCBI's Blast Perl API to interrogate Genbank for example blastp
. I don't get the throughput using their point and click web stuff.
I tried Biopython's Bio.Blast import NCBIWWW
but its under access restrictions from the host, notably attempting to use it during the day (works sporadically). The API however gets through and runs as fast as a web search ... that's good.
Here's an example of the command I'm running:
CMD=Put&PROGRAM=blastp&DATABASE=nr&HITLIST_SIZE=2500&ALIGNMENTS=2500&QUERY=%3Emytest%0AMSILANKDTR%0A
The above query gives default Blast output. What I'm trying to do is increase the number of hit recovered to the maximum (5000). The options for this are HITLIST_SIZE
, ALIGNMENTS
, DESCRIPTIONS
. In the above example I'm attempting a hit_size of 2500 ... but the same output is returned as for default. More generally I can't get any of the "number of hits/descriptions/alignments returned" options to work, the default is returned each time.
Has anybody solved this?
Typical options for the API are given below
Typical options
Parameter Definition Type CMD Allowed values
QUERY Search query String Put * Accession, GI, or FASTA.
DATABASE BLAST database String Put * Database from appendix 2 or one uploaded to blastdb_custom (see appendix 4)
PROGRAM BLAST program String Put * One of blastn, blastp, blastx, tblastn, tblastx. To enable megablast, use PROGRAM=blastn&MEGABLAST=on.
FILTER Low complexity filtering String Put F to disable. T or L to enable. Prepend “m” for mask at lookup (e.g., mL)
FORMAT_TYPE Report type String Put, Get HTML, Text, XML, XML2, JSON2, or Tabular. HTML is the default.
EXPECT Expect value Double Put Number greater than zero.
HITLIST_SIZE Number of databases sequences to keep Integer Put,Get Integer greater than zero.
DESCRIPTIONS Number of descriptions to print (applies to HTML and Text) Integer Put,Get Integer greater than zero.
ALIGNMENTS Number of alignments to print (applies to HTML and Text) Integer Put,Get Integer greater than zero.
Just to feedback on the answer and comment
Using
-remote
by locally installing blast as recommended by @Scott. This is a valid answer so definitely upvoted and recommended its further upvoted. I had tried this but not mentioned it in the question (really sorry), but it times out due to traffic issues. The API overcomes traffic issues. Again, @Scott's is a valid solution (considering I'd not explained I'd tried it).More details ...
The Perl API is here https://blast.ncbi.nlm.nih.gov/docs/web_blast.pl
Line 95 below ...
$args = "CMD=Put&PROGRAM=$program&DATABASE=$database&QUERY=" .
$encoded_query;
This is changed to,
$args = "CMD=Put&PROGRAM=$program&DATABASE=$database&HITLIST_SIZE=$maxhits&QUERY=" . $encoded_query;
Also need to add an additional line at line 73
$maxhits = shift;
From the command line,
perl ./web-blast.pl blastp nr 2500 ./example.fa
(Note, The variable order is switched in the program).
example.fa - e.g.
>rleguminosarum
WGFDGSSTQQAEGRSSDCVLKPVAIYPDPARTNGALVMCEVMMPDGVTPHASNARATILDDEDAWFGFEQ
EYFFYQNGRPLGFPEQGYPAPQGPYYTGVGYSNVGDVAREIVEEHLDLCLAAGINHEGINAEVAKGQWEF
QIFGKGSKKAADQIWMARYLLQRLTEKYGIDI
I'm proficient in Perl5, i.e. there's no error in changes to the code in the API, albeit my expertise is object oriented and high performance Python.
Limit on the request ... I'm testing that now.
First results eeek @terdon might be right ... :-(