12.1 Running Other Programs And CGI Scripts. 12.2 Please fill the teaching survey at: I read it closely, and I.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

Adding Dynamic Content to your Web Site
Html: getting started HTML is hyper text markup language. It is what web browsers look at on the Internet. HTML documents should be created in a simple.
Unit 3 Day 4 FOCS – Web Design. No Journal Entry.
 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
XP Information Technology Center - KFUPM1 Microsoft Office FrontPage 2003 Creating a Web Site.
Server-Side vs. Client-Side Scripting Languages
11ex.1 Modules and BioPerl. 11ex.2 sub reverseComplement { my ($seq) $seq =~ tr/ACGT/TGCA/; $seq = reverse $seq; return $seq; } my $revSeq = reverseComplement("GCAGTG");
Building Web Pages With Microsoft Office. Introduction This tutorial is for the beginning web builder. It utilizes software that you already have, Microsoft.
Master’s course Bioinformatics Data Analysis and Tools Lecture 6: Internet Basics Centre for Integrative Bioinformatics.
CIS101 Introduction to Computing Week 05. Agenda Your questions CIS101 Survey Introduction to the Internet & HTML Online HTML Resources Using the HTML.
Sup.1 Supplemental Material (NOT part of the material for the exam)
13.1 Wrapping up Running Other Programs 13.3 You may run programs using the system function: $exitValue = system("blastall.exe..."); if ($exitValue!=0)
CGI Programming in Perl Software Tools. Lecture 22 / Slide 2 CGI Programming l Last time we looked at designing a static web page. Today we will see how.
CGI programming in Perl Learning Objectives: 1. To understand how a CGI program works in Perl and how to make it runnable in web browsers 2. To learn how.
1ex.1 Perl Programming for Biology Exercise 1 The Bioinformatics Unit G.S. Wise Faculty of Life Science Tel Aviv University, Israel March 2009 Eyal Privman.
Guide To UNIX Using Linux Third Edition
Creating and Publishing Your own website
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
1 Spidering the Web in Python CSC 161: The Art of Programming Prof. Henry Kautz 11/23/2009.
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
Python programs How can I run a program? Input and output.
1 Homework / Exam Exam 3 –Solutions Posted –Questions? HW8 due next class Final Exam –See posted schedule Websites on UNIX systems Course Evaluations.
Internet Skills An Introduction to HTML Alan Noble Room 504 Tel: (44562 internal)
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
1 HTML and CGI Scripting CSC8304 – Computing Environments for Bioinformatics - Lecture 10.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
Chapter 6 The World Wide Web. Web Pages Each page is an interactive multimedia publication It can include: text, graphics, music and videos Pages are.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
2 1 Sending Data Using a Hyperlink CGI/Perl Programming By Diane Zak.
Python CGI programming
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 6.
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
CPSC 203 Introduction to Computers Lab 23 By Jie Gao.
HTML Hyper Text Markup Language A simple introduction.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
15.1 Fundamentals of HTML.
ECT 250: Survey of E-Commerce Technology FrontPage Publishing pages Unix.
Building PERL Scripts on a Windows system* *and running those scripts on an Apache server!
13.1 בשבועות הקרובים יתקיים סקר ההוראה (באתר מידע אישי לתלמיד)באתר מידע אישי לתלמיד סקר הוראה.
Creating and Publishing Your own web site PC Version SEAS 001 Professor Ahmadi.
1 ITI 1120 Lab # 1 An Introduction to the Lab Environment Contributors: G. Arbez, M. Eid, D. Inkpen, A. Williams, D. Amyot.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
1 © Copyright 2000 Ethel Schuster The Web… in 15 minutes Ethel Schuster
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
CS4710 Why Progam?. Why learn to program? Utility of programming skills: understand tools modify tools create your own automate repetitive tasks automate.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
Introduction to Programming the WWW I CMSC Winter 2003.
A Genomics View of Unix. General Unix Tips To use the command line start X11 and type commands into the “xterm” window A few things about unix commands:
Creating Programs on UNIX This term you can create programs on UNIX or you can create programs using a C++ compiler on your PC. This set of slides steps.
HTLM Forms CS3505. Form Handling in Browser html User Files out form WEbBROWSErWEbBROWSEr User read response submit Get URL?input html Get file html script.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
Getting Started with HTML. HTML  Hyper Text Markup Language  HTML isn’t a program language, its known as a markup language  A Markup language has tags.
HTML Hyper Text Markup Language. The Basics u HTML documents contain “tags” which instruct the Browser software on how to present the information within.
1 2/16/05CS120 The Information Era Chapter 4 Basic Web Page Construction TOPICS: Intro to HTML and Basic Web Page Design.
BIF703 FTP (File Transfer Protocol) Utility vi editor Utility.
HTML Hyper Text Markup Language. Agenda Basics Tools Important tags Tables & databases Forms Publishing at Stern.
Lesson 11. CGI CGI is the interface between a Web page or browser and a Web server that is running a certain program/script. The CGI (Common Gateway Interface)
University of Kansas Department of Electrical Engineering and Computer Science Dr. Susan Gauch April 21, 2005 I T T C Introduction to Web Technologies.
Online PD Basic HTML The Magic Of Web Pages
Tonga Institute of Higher Education IT 141: Information Systems
CS 330 Class 7 Comments on Exam Programming plan for today:
Introduction to Programming the WWW I
Chapter 27 WWW and HTTP.
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Presentation transcript:

12.1 Running Other Programs And CGI Scripts

12.2 Please fill the teaching survey at: I read it closely, and I make changes in the course from year to year according to the feedback. Teaching Survey

12.3 The exam will be on the computers in the PC classroom, on the 31/1/2007 at 9:00 The computers will be disconnected from the network (i.e. no internet access. Sorry… ) You will receive a floppy disk (diskette) with some files, and the exam questions on paper. You will write your solutions as normal Perl scripts and save them to the floppy, which you will submit at the end of the exam. 2 A4 pages Everything except BioPerl and CGI Exam

12.4 Write a script that reads a DNA sequence from STDIN and prints its reverse complement. The sequence may be in either small or capital letters. The file exam1.pl contains a script that reads a sequence file in Genbank format. Add the missing regular expression in order to find all CDS lines in line number 25. The regular expression should extract the coordinates of the start and stop codons. Fill in the appropriate variables in lines 27 and 28. The file exam2.pl contains a script that reads a file in PDB format (see example in EHD1.pbd) and finds all the “ATOM…” lines. Write the subroutine getAtomInfo that is called for each such line. The subroutine has one parameter – the scalar string of the ATOM line. It should return the following data structure: {‘amino_acid’ => AMINO_ACID, ‘coordinates’ => [X,Y,Z], ‘amino_acid_number’ => N} Make a copy of exam2.pl and name it exam3.pl. Add a new section at the end of the script that makes an array of arrays. Each internal array should hold all the hashes of the ATOMs that belong to a single amino acid of the protein. Some exam questions

12.5 Running Other Programs

12.6 e.g. Rate4Site: Still not very widely used (54 citations so far…) so there is no BioPerl modules that will run it for you and read its output:Rate4Site Dealing with less common formats #POS SEQ SCORE QQ-INTERVAL STD MSA DATA #The alpha parameter K [ , ] /6 2 V [ ,2.2169] /6 3 F [ ,0.4935] /6 4 S [ ,0.8962] /6 5 K [ ,0.1673] /6 6 C [ , ] /6 7 E [ , ] /6 8 L [ ,0.4935] /6 9 A [ , ] /6 10 H [ ,0.1673] /6 11 K [ ,0.1673] /6 12 L [ , ] /6 13 K [ , ] /6 14 A [0.4935,2.2169] /6 15 Q [0.1673,2.2169] /6 16 E [ ,0.8962] /6 17 M [ ,1.4226] /6

12.7 You may run programs using the system function: $exitValue = system("blast.exe..."); if ($exitValue!=0) {die "blast failed!";} This way the output of blast will be seen on the screen. Another way is to use “back-ticks” (left of the “1” key on your = `blast.exe...`; This way the output of blast is stored in the array. Running programs from a script

12.8 Class exercise Write a script that runs clustalw on a given protein FASTA file (use ex15.zip from the website, use the help file in there!) 2. Modify the script: Now do both multiple sequence alignment, and build an NJ tree. 3. Modify the script: Now add a rate4site run on the output of clustalw (type “ rate4site.exe -h ” for help)

12.9 CGI Scripts: Producing Web Pages

12.10 A CGI script is a script that is intended to be used over the internet. A CGI script on a web server can be used by a user to obtain data from databases (e.g. Genbank web server) or run analyses for the user (e.g. Blast at NCBI). The results of the script are an HTML page. CGI: Common Gateway Interface

12.11 All web pages that you see on the internet are written in HTML. HTML (HyperText Markup Language) is a computer language that defines how a web page will look in you web browser. Web browsers (such as Microsoft Internet Explorer) read HTML text files and produce colorful graphical pages. You can see the HTML source code of a web page in Explorer by clicking: View->Source Try it on the course web page: HTML: What is a web page? ob Perl Programming By Eyal Privman …

12.12 HTML uses tags. Tags are always enclosed in angle-brackets and are case- insensitive. For example: Tags typically occur in begin-end pairs. These pairs are in the form... For example, if you want some text to be underlined in your page: Aim: The aim of this course is to introduce the participant HTML basics

12.13 The whole document should be between... The text between... includes general information about the page. Inside the “head” section, use... to write the title of the page. The text between... is the actual contents of the page Structure of HTML documents

12.14 Class exercise Create the following HTML file and view it with Internet Explorer: Hello World Page Hello World! (name your file “ class_ex16.1.html ” )

12.15 The easiest way to get yourself a webserver is if you have an account at the bioinformatics unit. (On the bioinfo server)  You should place your HTML files and CGI script in your home directory on the bioinfo server. You will have to ask the staff of the bioinfo unit to open your account to web access. (They will create the needed directories for you) Running a CGI over the web

12.16 Any Perl script can output its results in HTML, using simple print commands. The Perl CGI module can make it easier for you: #!/usr/local/bin/perl  This is necessary on a UNIX server use CGI; my $cgi = new CGI; print $cgi->header. $cgi->start_html('Hello World Page'). $cgi->h1('Hello World!'). $cgi->end_html; exit (0);  Tells the server everything is fine Producing HTML page with a script

12.17 Class exercise Create the Perl script from the previous slide and test it.

12.18 An HTML form can run a CGI script

12.19 Here is the HTML that makes this form that takes input (a name) and invokes a CGI script named script.pl, which should be placed in the directory cgi-bin: An HTML form can run a CGI script HTML Form Example Enter your name: Submit this Form Reset this Form

12.20 Use the CGI function param to get the input that was entered into the form. To get a list of all parameter names: = $cgi->param(); To get the value for a specific parameter name: = $cgi->param(PARAM_NAME); For the example form in the previous slide, the CGI script could do this: print $cgi->h1('Hello '.$cgi->param("userName").'!'); Using the input in the CGI script

12.21 Class exercise 17 Create the HTML form and the Perl script from the previous slides on the bioinfo server (it ’ s a UNIX system!): 1. Log in to bioinfo using TeraTerm (Start  ???  Tera Term): The host is “ bioinfo.tau.ac.il ”, choose SSH, click OK, click Yes, user-name is “ symp ”, password is “ turj ”. 2. In UNIX you can use “ cd ” as in Windows, and “ ls ” or “ ls -l ” are like “ dir ”. 3. Use the command “ mkdir DIR_NAME ” to create a directory named as your first name inside the directory “ public_html ”. the HTML file should be in there. 4. To create and edit files use the editor pico ( “ pico FILE_NAME ” ). To paste into TeraTerm click the middle mouse button. 5. To access this HTML from your browser use this address:

12.22 Class exercise Create another directory for yourself inside the directory “ cgi-bin ”. The CGI script should be in there. 7. After creating the script you have to give it execution permissions: “ chmod +x SCRIPT_NAME ”. Use “ ls -l ” to check that it now has x ’ s like this: (bioinfo:symp)~/cgi-bin/eyal>ls –l -rwxr-xr-x 1 symp staff 167 Jan 23 13:14 hello.pl* 8. The reference to the CGI script in the HTML form should be: Bonus* Write another HTML form that ask the user for a FASTA file of DNA sequences, and runs a CGI version of ex3.4 (find ORFs in each sequence)

12.23 Installing packages: Do it yourself!

12.24  If you find a package in CPAN or elsewhere you can usually download a zip archive of all the files of the package, which usually is a.tar.gz file For example: Search for BioPerl version 1.4 in CPAN – it should be called something like “bioperl-1.4.tar.gz”  Unzip it (extract the files from the compressed archive)  Place the unzipped files or directories in the ActivePerl directory on your computer in the site\lib\ directory. (…\ActivePerl \site\lib\) For example – the “Bio” directory of BioPerl should be moved to: …\ActivePerl \site\lib\Bio Now you should be able to use modules named like Bio::SeqIO.  Test it with SeqIO_example.pl (available on the webpage) Download and install a package (Class exercise 17)

12.25 The command “use lib” asks Perl to search in certain directory when searching for packages that are used in the script: use lib 'D:\perl\myPackages'; use myPackage; (Assuming that the direcory “myPackages” contains “myPackage.pm”)  Move the “Bio” directory of BioPerl to a ‘D:\test’ and make SeqIO_example.pl find it by adding “use lib” Using packages from other directories (Class exercise 17)

12.26 Running Blast Remotely and Locally

12.27 BioPerl lets us to blast our sequence at the NCBI website: Use Bio::Tools::Run::RemoteBlast Instead of Bio::Tools::Blast (which I showed you before) use Bio::Tools::Run::RemoteBlast ; # here we define the parameters and input of blast my %runParam = (-method => 'remote', -prog => 'blastp', -database => 'swissprot', -seqs => [$seqObj1,$seqObj2]); # here we run it my $blastObj = Bio::Tools::Blast->new( -run => \%runParam, -parse => 1,# ask to parse the report -signif => '1e-10',# the cutoff -strict => 1); BioPerl: run blast over the web

You could install blast on your computer from: ftp.ncbi.nlm.nih.gov ftp.ncbi.nlm.nih.gov (There go to the directory: blast/executables/release/) But this may be difficult, and you will also need to download and install the databases you want to search. 2. You can also work on the Unix servers of the bioinformatics unit you can use local blast that is already installed there. Genbank databases that are installed there can be used for blast and for any other work, such as getting a sequence by its accession. Running a local blast

12.29 Class exercise Write a script that runs blast over the web on a given protein FASTA file (Use the same FASTA file as in ex. 14), and print the accessions of the first 20 hits for each input sequence. 2. Modify the script: Take the accession of a sequence as a command-line argument, fetch this sequence from Genbank over the web, and then blast it