For reference purposes, NCBI provides an example Perl script that can submit BLAST searches to NCBI BLAST Server using BLAST URLAPI. The script is located at ftp://ftp.ncbi.nlm.nih.gov/blast/documents/web_blast.pl. Specifically, this script performs the following tasks:
a. takes three parameters as arguments: program, database, and FASTA_input_file (multiple FASTA files acceptable in case of memgablast)
b. reads in an entry from the file (containing single sequence in FASTA format)
c. formats the request URL
d. sends the request URL to the BLAST server
e. retrieves the RID and rtoe
f. polls the BLAST server for the result
g. prints the result to stdout when it is ready
The script also checks for common mistakes and returns informative error messages. Please refer to the comments at the beginning of the script for detailed disclaimers.
The purpose of this script is to demonstrate the functionality of the BLAST server, the procedures of posting request and check for result, the error checking, and waiting based on rote. It is not meant for reoutine or heavy duty usage. For example, it only demonstrated the batch search function of megablast, even though this functionality is available to other algorithms.