96-Summer 生物資訊程式設計實習 ( 二 ) Bioinformatics with Perl 8/13~8/22 蘇中才 8/24~8/29 張天豪 8/31 曾宇鳯.

Slides:



Advertisements
Similar presentations
#!/bin/sh Jaeho Shin. Interface between user and the operating system sh, bash, csh, tcsh, ksh, … What is a Shell? OSuser Shell.
Advertisements

EMT 2390L Lecture 4 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts.
Run BLAST in command line mode Yanbin Yin Fall
CS 497C – Introduction to UNIX Lecture 22: - The Shell Chin-Chih Chang
Kate Milova MolGen retreat March 24, Microarray experiments. Database and Analysis Tools. Kate Milova cDNA Microarray Facility March 24, 2005.
Scripting Languages and C-Shell. What is a scripting language ? Script is a sequence of commands written as plain text and run by an interpreter (shell).
1 Course plan Course homepage tells you everything, updated Monday/Tuesday After each lecture, any extra material (slides, example programs) will become.
BNFO 235 Lecture 5 Usman Roshan. What we have done to date Basic Perl –Data types: numbers, strings, arrays, and hashes –Control structures: If-else,
Guide To UNIX Using Linux Third Edition
Kate Milova MolGen retreat March 24, Microarray experiments. Database and Analysis Tools. Kate Milova cDNA Microarray Facility March 24, 2005.
Unix Shell Scripts. What are scripts ? Text files in certain format that are run by another program Examples: –Perl –Javascript –Shell scripts (we learn.
Shell Script Examples.
2 $ command Command Line Options ls –a –l hello hi Command Arguments.
1 Day 16 Sed and Awk. 2 Looking through output We already know what “grep” does. –It looks for something in a file. –Returns any line from the file that.
BioPerl - documentation Bioperl tutorial tutorial Mastering Perl for Bioinformatics: Introduction.
Basic Introduction of BLAST Jundi Wang School of Computing CSC691 09/08/2013.
Introduction to UNIX / Linux - 11
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
Chapter 5 Bourne Shells Scripts By C. Shing ITEC Dept Radford University.
LIN 6932 Unix Lecture 6 Hana Filip. LIN 6932 HW6 - Part II solutions posted on my website see syllabus.
An Introduction to Unix Shell Scripting
The UNIX Shell. The Shell Program that constantly runs at terminal after a user has logged in. Prompts the user and waits for user input. Interprets command.
Linux Shell Programming Tutorial 3 ENGR 3950U / CSCI 3020U Operating Systems Instructor: Dr. Kamran Sartipi.
MCB 5472 Assignment #6: HMMER and using perl to perform repetitive tasks February 26, 2014.
CS 403: Programming Languages Lecture 21 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Additional UNIX Commands. 222 Lecture Overview  Multiple commands and job control  More useful UNIX utilities.
UNIX Shell Script (1) Dr. Tran, Van Hoai Faculty of Computer Science and Engineering HCMC Uni. of Technology
Shell Scripting AFNOG IX Rabat, Morocco May 2008.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
1 Week 2 The Crunchy Shell to the Soft and Chewy Kernel… Sarah Diesburg 8/3/2010 COP4610 / CGS5765.
生物資訊程式語言應用 Part 5 Perl and MySQL Applications. Outline  Application one.  How to get related literature from PubMed?  To store search results in database.
Assignment feedback Everyone is doing very well!
Bioinformatics Introduction to Perl. Introduction What is Perl Basic concepts in Perl syntax: – variables, strings, – Use of strict (explicit variables)
96-Summer 生物資訊程式設計實習 ( 二 ) Bioinformatics with Perl 8/13~8/22 蘇中才 8/24~8/29 張天豪 8/31 曾宇鳯.
Lesson 2 1.Commands 2.Filename Substitution 3.I/O Redirection 4.Command Grouping 5.Shell Responisibilites Review of the Basics.
Unix/Linux cs3353. The Shell The shell is a program that acts as the interface between the user and the kernel. –The shell is fully programmable and will.
Iteration While / until/ for loop. While/ Do-while loops Iteration continues until condition is false: 3 important points to remember: 1.Initialise condition.
Parsing BLAST output. Output of a local BLAST search “less” program Full path to the BLAST output file.
Operating Systems Lecture 10. Agenda for Today Review of previous lecture Input, output, and error redirection in UNIX/Linux FIFOs in UNIX/Linux Use of.
Department of Electrical and Computer Engineering Introduction to Perl By Hector M Lugo-Cordero August 26, 2008.
96-Summer 生物資訊程式設計實習 ( 二 ) Bioinformatics with Perl 8/13~8/22 蘇中才 8/24~8/29 張天豪 8/31 曾宇鳯.
Using Local Tools: BLAST
Compunet Corporation Introduction to Unix (CA263) Round and Round By Tariq Ibn Aziz Dammam Community College.
Review Please turn in your homework and practicals Packages, installation, rpm command Apache – Quick and easy way to set up a web server to play around.
2000 Copyrights, Danielle S. Lahmani Foreach example = ( 3, 5, 7, 9) foreach $one ) { $one*=3; } is now (9,15,21,27)
Agenda The Bourne Shell – Part I Redirection ( >, >>,
The Scripting Programming Language
Bioinformatics Introduction to Perl. Introduction What is Perl Basic concepts in Perl syntax: – variables, strings, – Use of strict (explicit variables)
Introducing Bioperl Toward the Bioinformatics Perl programmer's nirvana.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2014 Lecture 3 – I/O Redirection, Shell Scripts.
CS 403: Programming Languages Lecture 20 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
1 UNIX Operating Systems II Part 2: Shell Scripting Instructor: Stan Isaacs.
PROTEIN IDENTIFIER IAN ROBERTS JOSEPH INFANTI NICOLE FERRARO.
Bioinformatics Computing 1 CMP 807 – Day 4 Kevin Galens.
Week 3 Redirection, Pipes, and Background
Using Local Tools: BLAST
EMBL-EBI, programmatically - take a REST from manual searching: Sequence analysis tools Web Production Team Anna Foix Joon Lee.
Part 1: Basic Commands/Utilities
CSE 374 Programming Concepts & Tools
Chapter Four UNIX File Processing.
Shell Programming.
Lecture 4 Redirecting standard I/O & Pipes
Using Local Tools: BLAST
Using Local Tools: BLAST
Chapter 5 Bourne Shells Scripts
CST8177 Scripting 2: What?.
CSC 4630 Meeting 4 January 29, 2007.
Introduction to Bash Programming, part 3
Presentation transcript:

96-Summer 生物資訊程式設計實習 ( 二 ) Bioinformatics with Perl 8/13~8/22 蘇中才 8/24~8/29 張天豪 8/31 曾宇鳯

Schedule DateTimeSubjectSpeak er 8/13 一 13:30~17:30Perl Basics 蘇中才 8/15 三 13:30~17:30Programming Basics 蘇中才 8/17 五 13:30~17:30Regular expression 蘇中才 8/20 一 13:30~17:30Retrieving Data from Protein Sequence Database 蘇中才 8/22 三 13:30~17:30 Perl combines with BLAST and ClustalW 蘇中才 8/24 五 13:30~17:30PDB database and structure files 張天豪 8/27 一 8:30~12:30Extracting ATOM information 張天豪 8/27 一 13:30~17:30Mapping of Protein Sequence IDs and Structure IDs 張天豪 8/31 五 13:30~17:30Final and Examination 曾宇鳳

Process Management Introduction

system  system(“date”); ` `  `date`; exec  exec(“date”);

Introduction - system system (“ … ”); Example  system “date”;  system 'ls', "-al", '/home/course1/';  system ‘for i in *; do echo == $i ==; cat $i; done’;  system “~/course5/output.pl”; Return 0 if success

Execute ‘date’ by system #!/usr/bin/perl -w # date1.pl : execute a shell command - date my $ret = system "date"; print "return = $ret\n";

Execute ‘date’ by system without message #!/usr/bin/perl -w # date2.pl : execute a shell command - date my $ret = system "date > /dev/null"; print "return = $ret\n";

Introduction - ` ` ` … ` Example  $now = `date`;  $result = `ls –al /home/course1/`;  $result = `for i in *; do echo == $i ==; cat $i; done`;  `~/course5/output.pl`;

Execute ‘date’ by system without message #!/usr/bin/perl -w # date3.pl : execute a shell command - date my $ret = `date`; print "return = [$ret]\n";

Print message to STDOUT and STDERR #!/usr/bin/perl -w # output.pl : output a message to STDOUT and STDERR print STDOUT "print to STDOUT\n"; print STDERR "print to STDERR\n";

Print message to STDOUT and STDERR [course5]$./output.pl print to STDOUT print to STDERR [course5]$./output.pl > log print to STDERR [course5]$ cat log print to STDOUT [course5]$ (./output.pl 2>&1) > log [course5]$ cat log print to STDOUT print to STDERR

Execute ‘date’ by system without message #!/usr/bin/perl -w # redirect.pl : STDOUT and STDERR my $ret = system "./output.pl"; print "redirect nothing ($ret)\n"; $ret = system "./output.pl 1>/dev/null"; print "redirect STDOUT to /dev/null ($ret)\n"; $ret = system "./output.pl 1>/dev/null 2>&1"; print "redirect STDOUT and STDERR to /dev/null ($ret)\n";

Print message to STDOUT and STDERR #!/usr/bin/perl -w # exec_output1.pl : execute output.pl my $ret = `./output.pl`; chomp($ret); print "return = [$ret]\n";

Print message to STDOUT and STDERR #!/usr/bin/perl -w # exec_output2.pl : execute output.pl my $ret = `./output.pl 2>&1`; chomp($ret); print "return = [$ret]\n";

%ENV Shell command  env Example  $ENV{‘PATH’}  $ENV{‘HOME’}  $ENV{‘HOSTNAME’}  $ENV{‘USER’}

%ENV #!/usr/bin/perl -w # env.pl : execute a shell command - env = `env`; foreach { chomp; if (/PATH/) { print "$_\n"; } print "PATH=$ENV{'PATH'}\n";

Process Management Arguments, Here-document

Arguments parsing use Getopt::Std; getopts( "hvf:", \%opt ) or usage(); usage() if $opt{h}; usage() if (!defined{$opt{f}); sub usage() { print STDERR << "EOF"; usage: $0 [-hv] [-f file] -h : this (help) message -v : verbose output -f file : file containing usersnames, one per line example: $0 -v -f file EOF exit; }

Here-document print <<EOF; print me!!!! print you!!!! print us!!!! EOF print << x 3; print me!!!!

Exercise system and ` `

Quiz – system & ` ` Are they workable ?  system ‘for i in *; do echo == $i ==; cat $i; done’;  $result = `for i in *; do echo == $i ==; cat $i; done`; Why ?

Quiz – sleep10.pl #!/usr/bin/perl -w # sleep10.pl : sleep 10 seconds foreach (1..10) { print "$_\n"; sleep 1; }

Quiz – system & ` ` Do they execute by background mode?  system ‘./sleep10.pl &’;  $result = `./sleep10.pl &`; Why ?

Project BLAST, ClustalW

Project1 - BLAST Todo  Get the result from Blast  Extract its homology (evalue <= 10^-1) Input  A protein sequence (FASTA format) Output  All homologous sequences of the query sequence

BLAST Get BLAST packages  ftp://ftp.ncbi.nih.gov/blast/ ftp://ftp.ncbi.nih.gov/blast/ Get nr database  ftp://ftp.ncbi.nih.gov/blast/db/ ftp://ftp.ncbi.nih.gov/blast/db/ Command  ~/tools/PSSM/BLAST/blastall -p blastp -i P53_HUMAN.fa -o output.txt -d /home/sbb/tools/PSSM/BLAST/db/SwissProt.v50.fa –m 9

Project2 - ClustalW Todo  do multiple sequence alignment by ClustalW Input  A protein sequence with its homology (FASTA format) Output  The conserved score of each residue in the query sequence

ClustalW Get ClustalW package  ftp://ftp.ebi.ac.uk/pub/software/unix/clustalw/ ftp://ftp.ebi.ac.uk/pub/software/unix/clustalw/ Command ./clustalW