资源预览内容
第1页 / 共77页
第2页 / 共77页
第3页 / 共77页
第4页 / 共77页
第5页 / 共77页
第6页 / 共77页
第7页 / 共77页
第8页 / 共77页
第9页 / 共77页
第10页 / 共77页
亲,该文档总共77页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
*1按一下以編輯母片標題樣式按一下以編輯母片副標題樣式96-Summer生物資訊程式設計實習(二)Bioinformatics with Perl8/138/22 蘇中才8/248/29 張天豪8/31 曾宇鳯ScheduleDateTimeSubjectSpeaker8/13 一 13:3017:30 Perl Basics蘇中才8/15 三 13:3017:30 Programming Basics蘇中才8/17 五 13:3017:30 Regular expression蘇中才8/20 一 13:3017:30 Retrieving Data from Protein Sequence Database蘇中才8/22 三 13:3017:30 Perl combines with Genbank, BLAST蘇中才8/24 五 13:3017:30 PDB database and structure files張天豪8/27 一8:3012:30Extracting ATOM information張天豪8/27 一 13:3017:30 Mapping of Protein Sequence IDs and Structure IDs張天豪8/31五13:3017:30 Final and Examination曾宇鳳2Reference BooksnLearning Perl(Perl 學習手冊)nBeginning Perl for BioinformaticsnBioinformatics Biocomputing and Perl: An Introduction to Bioinformatics Computing Skills and Practice34*5按一下以編輯母片標題樣式按一下以編輯母片副標題樣式Learning PerlPerlnPractical Extraction and Report LanguagenCreated by Larry Wall in the middle 1980s.nSuitable for “quick-and-dirty”nSuitable for string-handlingnPowerful regular expression6PreparationnDownloading / nGetting materials for this course: http:/gene.csie.ntu.edu.tw/sbb/summer-course/nServer: sshId : course1 course20Password:7Installing Perl on WindowsnDownload package fromhttp:/nVersions of PerlUnix, Linux, Windows (ActivePerl), Mac (MacPerl)http:/8Text EditorsnA convenient (text) editor for programmingnUltraedit: good for menNotepad: just an editornVim: UNIX/Linux lovernJoe : easy to use for Unix beginner9Finding HelpnBest resource finding tool nOn-line Resources, usehttp:/http:/http:/nHTML Help in ActivePerlnCommand Line (highly recommended)perldoc f # search functionperldoc q # search FAQperldoc # search moduleperldoc perldoc10*11按一下以編輯母片標題樣式按一下以編輯母片副標題樣式Perl BasicStarting$ vi welcome#! /usr/bin/perl -wprint “Hello, worldn”;$ chmod +x welcome$ ./welcomeHello, world$ perl welcomeHello, worldProgram: run thyself!sbbgene perl$ ls -al-rw-rw-r- 1 sbb sbb 20 Jul 2 15:27 welcomesbbgene perl$ chmod +x welcomesbbgene perl$ ls -al-rwxrwxr-x 1 sbb sbb 20 Jul 2 15:27 welcome12#! /usr/bin/perl -w# The forever program - a (Perl) program,# which does not stop until someone presses Ctrl-C.use constant TRUE = 1;use constant FALSE = 0;while ( TRUE ) print Welcome to the Wonderful World of Bioinformatics!n; sleep 1;Using the Perl while construct13$ chmod +x forever$ ./foreverWelcome to the Wonderful World of Bioinformatics!Welcome to the Wonderful World of Bioinformatics!Welcome to the Wonderful World of Bioinformatics!Welcome to the Wonderful World of Bioinformatics!Welcome to the Wonderful World of Bioinformatics!Welcome to the Wonderful World of Bioinformatics!Welcome to the Wonderful World of Bioinformatics!Welcome to the Wonderful World of Bioinformatics!Welcome to the Wonderful World of Bioinformatics!.Running forever . 14*15按一下以編輯母片標題樣式按一下以編輯母片副標題樣式Perl BasicVariablesVariablesnScalar ($)Numbern1; 1.23; 12e34Stringn“abc”; ABC ; “Hello, world!”;nArray / List ()nHash (%)16Introducing variable containersnThe simplest type of variable container is the scalar (純量).nIn Perl, scalars can hold, for example, a number, a word, a sentence or a disk-file.$name$_address$programming_101$z$abc$swissprot_to_interpro_mapping$SwissProt2InterProMappingVariable naming is ART !17scalar#!/usr/bin/perl -w# lower case for user defined ; upper case for system defaultmy $ARGV = “;my $number = 1.2;my $string = Hello, world!;my $123 = 123;#errormy $abc = 123;my $_123 = 123;my $O000OoO00 = 1;my $OO00Oo000 = 2;my $OO00OoOOO = 3;$abc = $O000OoO00 * $OO00Oo000 - $OO00OoOOO;print $abc x 4 . n;print 5 x 4 . n;print 5 * 4 . n;18NumbernFormat (range: 1e-100 1e100 ?)2000-6.5e45 (-6.5*1045)123456789123_456_789nOther format0377 #octal (decimal 255)0 xFF #hexadecimal0b11111111#binary19number$integer = 12;$real = 12.34;$oct = 0377;$bin = 0b11111111;$hex = 0 xff;$long = 123456789;$long_ = 123_456_789;$large = 1E100;#1E200$small = 1E-100;#1E-200print integer : $integern;print real : $realn;print oct=$oct bin=$bin hex=$hexn;#printf(oct=0%o bin=0b%b hex=0 x%xn,$oct,$bin,$hex);20parameters of printf (ref : number)specifierOutputExamplecCharacterad or iSigned decimal integer392eScientific notation (mantise/exponent) using e character3.9265e+2EScientific notation (mantise/exponent) using E character3.9265E+2fDecimal floating point392.65gUse the shorter of %e or %f392.65GUse the shorter of %E or %f392.65oSigned octal610sString of characterssampleuUnsigned decimal integer7235xUnsigned hexadecimal integer7faXUnsigned hexadecimal integer (capital letters)7FApPointer addressB800:0000nNothing printed. The argument must be a pointer to a signed int, where the number of characters written so far is stored.%A % followed by another % character will write % to stdout.21operatorn2 + 3#5n3 * 12#36n14 / 2#7n10.2 / 0.3#34n10 / 3#3.333n10 % 3#122OperatorOperatorFunction+Addition-Subtraction, Negative Numbers, Unary Negation*Multiplication/Division%Modulus*ExponentOperatorFunction=Normal Assignment+=Add and Assign-=Subtract and Assign*=Multiply and Assign/=Divide and Assign%=Modulus and Assign*=Exponent
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号