METU Informatics Institute Min720 Pattern Classification with Bio-Medical Applications
Web Application Development Application To Bio-Informatics-III
description
Transcript of Web Application Development Application To Bio-Informatics-III
WEB APPLICATION DEVELOPMENT
APPLICATION TO BIO-INFORMATICS-III
Vicky Khanna
200960013
M-Tech Bioinformatics
WHY DO WE NEED WEB APPLICATIONS???
Parsing the NCBI Files to extract a particular pattern.
Removal of Hetro-Atoms from RCSB files for Drug Discovery Analysis.
Automated Search and parsing for a particular gene or gene sequence from Meta-Databases like KEGG, NCBI-Genbank,BRENDA etc.
3
WEB TECHNOLOGIES
World Wide Web is based on Client-Server technology One of the most popular and dominant client server
technologies today
Web Server
HTTP
Computer
Laptop
Web ApplicationHTML Documents
4
CONSTITUENTS OF WORLD WIDE WEB
Web Browsers Web Content Web Site URL – Uniform Resource Locator HTTP – Hyper Text Transfer Protocol HTML – Hyper Text Markup Language Gateway to Non-Web Resources
5
Web Server
Web Gateway
OVERVIEW
File System
HTML Pages
GIF/JPG Images etc
DatabaseNon-Web Content
(Dynamic Content)
6
WEB CONTENT - TYPES OF CONTENT Static Content
Content resides in a file Author determines the content at the time of creation Each request will return exactly the same data (Content doesn’t
change) Example: HTML files, gif/jpeg files Disadvantage: Not possible to implement applications
Dynamic Content Created on the fly by a web server upon a request to reflect the current
info Content may vary for each request Example: A typical web application (Banking etc) Disadvantage: More processing power required on the server
Active Content Server returns a run-able copy of the program Browser executes the program locally on the client machine May need continuous information feed Examples: Java Applets, Active-X controls for IE Disadvantage: Possible Security risks
7
WEB TECHNOLOGIES
The Web Application employs various technologies in different layers.
Client Side Scripting Web browser
HTML, XHTML, CSS Scripting Languages
Server Side Scripting ASP, ASP.NET ( Microsoft Technology) Servlet and JSP ( Java Technology)
Web Services XML, DTD, Schema, XML DOM, SOAP, WSDL
8
COMMON GATEWAY INTERFACE (CGI)
A general framework for creating server side web applications.
The first mechanism for creating dynamic web site.
Instead of returning a static web document, web server returns results of a program.
CGI programs can be written in languages like C/C++, Perl, Java, etc.
9
CGI OVERVIEW
Web Browser
Genename=chaperone
For example Browser sends the parameter: Genename=chaperone . Web server passes the request to a C:\Perl program C:\Perl Program returns HTML that says,
TotalGenes=36896 !
TotalGenes=36896
Genename=chaperone
TotalGenes=36896
10
PERL – CGI PROGRAMMING CONTD
computer2
server
Name.pl
Client sends a HTTP request encoded with the data to be passed to the server (shiv,27 etc)
Web server receives the requestand understands that this request is for a dynamic page and invokes the perl interpreter by passing the parameters
Perl interpreter executes the corresponding perl script and gives back the HTML document.
Web server collects the HTML document from the perl and sends It to the browser.
11
PERL – CGI PROGRAMMING CONTD
HTML form & CGI Script<html><body><form action=“name.pl" method="POST">Your Name: <input type="text" name="name"><br>Age : <input type="text" name="age"><br><input type="submit" value="Send"></form></body></html>
use CGI;print header;print "<HTML> <BODY>";print "<H1> Hi ".param('name')."!</H1><BR>";print "<H2> You are ".param('age')." years old!</H2><BR>";print "</BODY></HTML>";
12
WORKING OF A CGI APPLICATION
PC
Web Browser
Web Server(Internet)
abcbooks.co.in202.68.33.49
DNS Server(Local Network)
TheInternet
1. User Submits form; URL http://abcbooks.co.in/cgi-bin/getinfo.exe?title=Web+Servers
2. Translate DNS name to IP address
3. Cannot resolve locally? Resolve from other DNS…
4. Returns IP Address 202.68.33.49
5. Connect th
ru the
n/w to server
6. Send HTTP Request
7. Invoke getinfo.exe under cgi-bin, passes params thru env variable/stdin
8. Query DB for Data
9. Compose HTML
on stdout
10. Send HTTP Response
which contains HTML
generated dynamically
getinfo.exe
13
PERL – DBI & DBD
DBD Database Driver Have libraries for connecting to various databases Examples
DBD-Oracle DBD-Mysql DBD-CSV DBD-ODBC
DBI Database Interface module DBI modules do not have vendor libraries to access
database It locates the corresponding DBD module for interacting
with database
14
PERL – DBI & DBD
Perl Script DBI Module
DBD - Oracle
DBD - Mysql
DBD – CSV
Oracle
CSV Format
Mysql
15
PERL – DBI & DBD
Connecting to Oracle Database# !c:\perl\bin\perl.exeuse DBI;use DBI::Oracle;# Connecting to database$DBHandle=DBI->connect(“dbi:Oracle:test:172.17.36.166:3306” ,”vicky”,”password”)or die($DBI::errstr);# Database Operations# Disconnecting $DBHandle->disconnect();
use DBI; use DBI::mysql(:sql_types);$DBHandle=DBI->connect(“dbi:mysql:test:172.17.36.166:3306, ”vicky”,”password”)or die(“Error=> DBI::errstr);
Connecting to Mysql Database
16
PERL – DBI & DBD
Executing Insert statements
#!/usr/bin/perl$Fname=“Vicky"; $Roll=200960013;use DBI qw(:sql_types);$DBHandle=DBI->connect("DBI:mysql:test:10.3.4.59:3306","root",”password") or
die($DBI::errstr);
$query="insert into table values(\"".$Fname."\",".$Roll.")";
$queryhandle=$DBHandle->prepare("$query");$queryhandle->execute();
$DBHandle->disconnect();
17
PERL – DBI & DBD Executing an Select Query
#!/usr/bin/perl$Fname=“Vicky"; $Roll=200960013;#use param(“Fname”) in case of HTMLuse DBI qw(:sql_types);$DBHandle=DBI->connect("DBI:mysql:test:10.3.4.59:3306","root",”password") or
die($DBI::errstr);$query1="select * from table";$queryhandle=$DBHandle->prepare("$query1");$queryhandle->execute();$queryhandle->bind_columns(\$FName,\$Roll);while($queryhandle->fetch()) {
print $FName." ".$Roll;print "\n";
}$DBHandle->disconnect();
THANK YOU….