Local NCBI BLAST+ in WebServer - Easy Steps
This is a simple tutorial which explains how to design your own web interface for NCBI BLAST+ to perform local and online database search using PHP in webserver. The PHP library locBLAST executes the NCBI BLAST+ programs using exec()
function through passing parameters from the HTML form fields. In locBLAST, two list boxes were used to select program & database, and text area & file upload is used to input query sequence in the FASTA file format. A FASTA file validation function is included to validate the query sequence before executing the BLAST programs. The locBLAST PHP library and test database files were freely available at GitHub.
Requirements for locBLAST Setup
In this tutorial, I have given a brief explanation about embedding the latest NCBI BLAST+ (the latest version of NCBI BLAST+ as on November 17, 2020 is 2.11.0.) in any PHP enabled web server. The latest version of NCBI BLAST+ (standalone command-line BLAST programs) can be downloaded from the FTP server of NCBI (ftp://ftp.ncbi.nih.gov/blast/executables/blast+/LATEST). A simple PHP supporting web server is enough to run the local BLAST program through the web browser. Follow the steps given below to setup and run the locBLAST program.
1. Download the compressed NCBI BLAST+ software (I have downloaded ncbi-blast-2.11.0+-x64-win64.tar.gz for Windows 64-bit OS) from the NCBI FTP server.
2. Create a folder named locBLAST in the web directory (usually named htdocs, www, or wwwroot).
3. Decompress ncbi-blast-2.11.0+-x64-win64.tar.gz file and copy all the files present in the bin folder to locBLAST directory.
4. Download index.php and db folder from GitHub and copy to locBLAST directory.
5. Open the URL http://localhost/locBLAST in the web browser to run locBLAST program.
6. Click the hyperlink DEMO and Search button to test local database search. The default parameters will generate an HTML file formatted BLAST search report.
The form fields in locBLAST program can be extended with custom form fields to perform advanced search. Moreover, desired database files can be downloaded from the NCBI FTP directory (ftp://ftp.ncbi.nih.gov) and copied to the db directory to perform offline database search.
Custom Database Creation
We can also create custom database using makeblastdb program present in the locBLAST directory. To create a custom database, copy the FASTA file formatted multiple sequence file to the db directory. Then open the db directory and press ALT key + Right mouse click to open command-line window directing to the current directory. Enter the command “makeblastdb.exe -in db/pdt.fas -out db/pdt -dbtype prot -title PDTDB
” to create a custom database named PDTDB (already included in the db folder).
>pdt|pdtdbt00001|pdb|1OKE|A/B MRCIGISNRDFVEGV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PCTPRRCLGSLVFPRKLQGRPSPGPPAPEQLLS QARDFINQYYSSIKRSGSQAHEQRLQEVEAEVAATGTYQLRESELVFGAKQAWRNAPRCV GRIQWGKLQVFDARDCRSAQEMFTYICNHIKYATNRGNLRSAITVFPQRCPGRGDFRIWN SQLVRYAGYRQQDGSVRGDPANVEITELCIQHGWTPGNGRFDVLPLLLQAPDEPPELFLL PPELVLEVPLEHPTLEWFAALGLRWYALPAVSNMLLEIGGLEFPAAPFSGWYMSTEIGTR NLCDPHRYNILEDVAVCMDLDTRTTSSLWKDKAAVEINVAVLHSYQLAKVTIVDHHAATA SFMKHLENEQKARGGCPADWAWIVPPISGSLTPVFHQEMVNYFLSPAFRYQPDPWKGSAA KGTGITR >pdt|pdtdbt00008|pdb|4PQE|A EGREDAELLVTVRGGRLRGIRLKTPGGPVSAFLGIPFAEPPMGPRRFLPPEPKQPWSGVV DATTFQSVCYQYVDTLYPGFEGTEMWNPNRELSEDCLYLNVWTPYPRPTSPTPVLVWIYG GGFYSGASSLDVYDGRFLVQAERTVLVSMNYRVGAFGFLALPGSREAPGNVGLLDQRLAL QWVQENVAAFGGDPTSVTLFGESAGAASVGMHLLSPPSRGLFHRAVLQSGAPNGPWATVG MGEARRRATQLAHLVGCPPGGTGGNDTELVACLRTRPAQVLVNHEWHVLPQESVFRFSFV PVVDGDFLSDTPEALINAGDFHGLQVLVGVVKDEGSYFLVYGAPGFSKDNESLISRAEFL AGVRVGVPQVSDLAAEAVVLHYTDWLHPEDPARLREALSDVVGDHNVVCPVAQLAGRLAA QGARVYAYVFEHRASTLSWPLWMGVPHGYEIEFIFGIPLDPSRNYTAEEKIFAQRLMRYW ANFARTGDPNEPRDPKAPQWPPYTAGAQQYVSLDLRPLEVRRGLRAQACAFWNRFLPKLL SAT
Brief Video Tutorial
Thanks for creating this, have been using legacy wwwblast.
ReplyDeleteStep 4 is a bit confusing, I had to copy all files from the root i.e. not just index.php and the db folder to get it working - no surprise.
However, I now have a "file creation failed" error, even though IIs has write access to the folder.
Watch this video tutorial https://youtu.be/xmGQT8YW678
DeleteYou'll get clear idea.
Its a very good implementation.
ReplyDeleteI have a query:
I have configured locBLAST on wamp server. Its Demo run is showing "Invalid Input/Program/Database Selection!". Where had I made mistake ?
pls suggest.
Check (1) FASTA file format of the query sequence, (2) suitable BLAST program, and (3) read and write permission of the directory.
DeleteExample:
ReplyDeletehttps://www.hanlab.cc/blast/
Its also showing same processing hurdle.
pls suggest.
Do check (1) FASTA file format of the query sequence, (2) suitable BLAST program, and (3) read and write permission of the directory.
DeleteIf the above not works, carefully check the modified PHP lines.
I have uploaded all the locBLAST files at local server with database. is it required to upload blast .exe files also. because server not allowed .exe files to upload. when i am running from index.php it gives error "file creation failed" . Please Help
DeleteThe executables (.exe) place major role in locBLAST. Without the .exe files BLAST will not work.
Delete