Posts

Showing posts from September, 2017

Local NCBI BLAST+ in WebServer - Easy Steps

Image
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 loc BLAST executes the NCBI BLAST+ programs using exec() function through passing parameters from the HTML form fields. In loc BLAST , 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 loc BLAST PHP library and test database files were freely available at GitHub . Requirements for loc BLAST 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 s

Extracting Multiple FASTA Sequences using PHP

Image
This is a simple tutorial which explains how to safely extract multiple sequences from a FASTA file using PHP script. I have used four functions to perform different tasks: read_fas_file() - to check invalid file, fas_check() - to check FASTA file format, get_seq() - to retrieve sequence and sequence name pairs, and fas_get() - to extract and display multiple FASTA file formatted sequences. The full source code and multiple protein sequences in FASTA file format used in this tutorial is given below. Source Code function read_fas_file($x) { // Check for Empty File if (!file_exists($x)) { print "File Not Exist!!"; exit(); } else { $fh = fopen($x, 'r'); if (filesize($x) == 0) { print "File is Empty!!"; fclose($fh); exit(); } else { $f = fread($fh, filesize($x)); fclose($fh); return $f; } } } function fas_check($x) { // Check FASTA File Format $gt = substr($x, 0, 1); if ($gt != ">") { print "Not F

Simple Show/Hide Text using JavaScript

Image
This is a simple tutorial which explains how to show or hide lines in a paragraph using JavaScript. The concept is to split the lines in the paragraph into two sections and show/hide the second section by clicking a hyperlinked text (to create a toggle effect). By default, the first section in the paragraph is set to always visible, and a hyperlink at the end of the line with onclick action to display the second section . Similarly, a hyperlink at the end of the line of the second section with onclick action is displayed after a mouse click event to hide the second section . Example This is a simple tutorial which explains how to show or hide lines in a paragraph using JavaScript. <a style = 'text-decoration: none' id = 'show_line' href = 'javascript:void(0)' onclick = "document.getElementById('more').style.display = 'inline'; document.getElementById('hide_line').style.display = 'inline'; document.getElemen