Presentation is loading. Please wait.

Presentation is loading. Please wait.


Similar presentations

Presentation on theme: "W EB A PPLICATION D EVELOPMENT A PPLICATION T O B IO -I NFORMATICS -III Vicky Khanna 200960013 M-Tech Bioinformatics."— Presentation transcript:


2 W HY D O W E N EED W EB A PPLICATIONS ??? 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 3 W EB T ECHNOLOGIES World Wide Web is based on Client-Server technology One of the most popular and dominant client server technologies today

4 4 C ONSTITUENTS OF W ORLD W IDE W EB 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 5 Web Server Web Gateway O VERVIEW File System HTML Pages GIF/JPG Images etc Database Non-Web Content (Dynamic Content)

6 6 W EB C ONTENT - T YPES OF C ONTENT 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 7 W EB T ECHNOLOGIES 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 8 C OMMON G ATEWAY I NTERFACE (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 9 CGI O VERVIEW Web Browser Web Server C\Perl Program 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 10 PERL – CGI P ROGRAMMING CONTD Client sends a HTTP request encoded with the data to be passed to the server (shiv,27 etc) Web server receives the request and 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 11 PERL – CGI P ROGRAMMING CONTD HTML form & CGI Script Your Name: Age : use CGI; print header; print " "; print " Hi ".param('name')."! "; print " You are ".param('age')." years old! "; print " ";

12 12 W ORKING OF A CGI A PPLICATION 1. User Submits form; URL 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 5. Connect thru 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 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 14 PERL – DBI & DBD Perl ScriptDBI Module DBD - Oracle DBD - Mysql DBD – CSV Oracle CSVForm at Mysql

15 15 PERL – DBI & DBD Connecting to Oracle Database # !c:\perl\bin\perl.exe use DBI; use DBI::Oracle; # Connecting to database $DBHandle=DBI->connect(“dbi:Oracle:test:”,”vicky”,”password”)or die($DBI::errstr); # Database Operations # Disconnecting $DBHandle->disconnect(); use DBI; use DBI::mysql(:sql_types); $DBHandle=DBI->connect(“dbi:mysql:test:, ”vicky”,”password”)or die(“Error=> DBI::errstr); Connecting to Mysql Database

16 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:","root",”password") or die($DBI::errstr); $query="insert into table values(\"".$Fname."\",".$Roll.")"; $queryhandle=$DBHandle->prepare("$query"); $queryhandle->execute(); $DBHandle->disconnect();

17 17 PERL – DBI & DBD Executing an Select Query #!/usr/bin/perl $Fname=“Vicky"; $Roll=200960013; #use param(“Fname”) in case of HTML use DBI qw(:sql_types); $DBHandle=DBI->connect("DBI:mysql:test:","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();

18 T HANK Y OU ….

Download ppt "W EB A PPLICATION D EVELOPMENT A PPLICATION T O B IO -I NFORMATICS -III Vicky Khanna 200960013 M-Tech Bioinformatics."

Similar presentations

Ads by Google