您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 其它行业文档 > 生物资讯程式设计实习(二)
196-Summer生物資訊程式設計實習(二)BioinformaticswithPerl8/13~8/22蘇中才8/24~8/29張天豪8/31曾宇鳯2ScheduleDateTimeSubjectSpeaker8/13一13:30~17:30PerlBasics蘇中才8/15三13:30~17:30ProgrammingBasics蘇中才8/17五13:30~17:30Regularexpression蘇中才8/20一13:30~17:30RetrievingDatafromProteinSequenceDatabase蘇中才8/22三13:30~17:30PerlcombineswithGenbank,BLAST蘇中才8/24五13:30~17:30PDBdatabaseandstructurefiles張天豪8/27一8:30~12:30ExtractingATOMinformation張天豪8/27一13:30~17:30MappingofProteinSequenceIDsandStructureIDs張天豪8/31五13:30~17:30FinalandExamination曾宇鳳3ReferenceBooksLearningPerl(Perl學習手冊)BeginningPerlforBioinformaticsBioinformaticsBiocomputingandPerl:AnIntroductiontoBioinformaticsComputingSkillsandPractice45LearningPerl6PerlPracticalExtractionandReportLanguageCreatedbyLarryWallinthemiddle1980`s.Suitablefor“quick-and-dirty”Suitableforstring-handlingPowerfulregularexpression7PreparationDownloadingputty.exe/pietty.exeGettingmaterialsforthiscourse:~sbb/summer-course/Server:ssh140.112.28.186Id:course1~course20Password:8InstallingPerlonWindowsDownloadpackagefromVersionsofPerlUnix,Linux,Windows(ActivePerl),Mac(MacPerl)Aconvenient(text)editorforprogrammingUltraedit:goodformeNotepad:justaneditorVim:UNIX/LinuxloverJoe:easytouseforUnixbeginner10FindingHelpBestresourcefindingtool–On-lineResources,use://://HTMLHelpinActivePerlCommandLine(highlyrecommended)perldoc–ffunction#searchfunctionperldoc–qfaqkeywork#searchFAQperldocmodule#searchmoduleperldocperldoc11PerlBasicStarting12$viwelcome#!/usr/bin/perl-wprint“Hello,world\n”;$chmod+xwelcome$./welcomeHello,world$perlwelcomeHello,worldProgram:runthyself![sbb@geneperl]$ls-al-rw-rw-r--1sbbsbb20Jul215:27welcome[sbb@geneperl]$chmod+xwelcome[sbb@geneperl]$ls-al-rwxrwxr-x1sbbsbb20Jul215:27welcome13#!/usr/bin/perl-w#The'forever'program-a(Perl)program,#whichdoesnotstopuntilsomeonepressesCtrl-C.useconstantTRUE=1;useconstantFALSE=0;while(TRUE){printWelcometotheWonderfulWorldofBioinformatics!\n;sleep1;}UsingthePerlwhileconstruct14$chmod+xforever$./foreverWelcometotheWonderfulWorldofBioinformatics!WelcometotheWonderfulWorldofBioinformatics!WelcometotheWonderfulWorldofBioinformatics!WelcometotheWonderfulWorldofBioinformatics!WelcometotheWonderfulWorldofBioinformatics!WelcometotheWonderfulWorldofBioinformatics!WelcometotheWonderfulWorldofBioinformatics!WelcometotheWonderfulWorldofBioinformatics!WelcometotheWonderfulWorldofBioinformatics!..Runningforever...15PerlBasicVariables16VariablesScalar($)Number1;1.23;12e34String“abc”;‘ABC’;“Hello,world!”;Array/List(@)Hash(%)17IntroducingvariablecontainersThesimplesttypeofvariablecontaineristhescalar(純量).InPerl,scalarscanhold,forexample,anumber,aword,asentenceoradisk-file.$name$_address$programming_101$z$abc$swissprot_to_interpro_mapping$SwissProt2InterProMappingVariablenamingisART!18scalar#!/usr/bin/perl-w#lowercaseforuserdefined;uppercaseforsystemdefaultmy$ARGV=“example.pl;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$abcx4.\n;print5x4.\n;print5*4.\n;19NumberFormat(range:1e-100~1e100?)20001.25-6.5e45(-6.5*10^45)123456789123_456_789Otherformat0377#octal(decimal255)0xFF#hexadecimal0b11111111#binary20number$integer=12;$real=12.34;$oct=0377;$bin=0b11111111;$hex=0xff;$long=123456789;$long_=123_456_789;$large=1E100;#1E200$small=1E-100;#1E-200printinteger:$integer\n;printreal:$real\n;printoct=$octbin=$binhex=$hex\n;#printf(oct=0%obin=0b%bhex=0x%x\n,$oct,$bin,$hex);21parametersofprintf(ref:number)specifierOutputExamplecCharacteradoriSigneddecimalinteger392eScientificnotation(mantise/exponent)usingecharacter3.9265e+2EScientificnotation(mantise/exponent)usingEcharacter3.9265E+2fDecimalfloatingpoint392.65gUsetheshorterof%eor%f392.65GUsetheshorterof%Eor%f392.65oSignedoctal610sStringofcharacterssampleuUnsigneddecimalinteger7235xUnsignedhexadecimalinteger7faXUnsignedhexadecimalinteger(capitalletters)7FApPointeraddressB800:0000nNothingprinted.Theargumentmustbeapointertoasignedint,wherethenumberofcharacterswrittensofarisstored.%A%followedbyanother%characterwillwrite%tostdout.22operator2+3#55.1–2.4#2.73*12#3614/2#710.2/0.3#3410/3#3.333…10%3#123OperatorOperatorFunction+Addition-Subtraction,NegativeNumbers,UnaryNegation*Multiplication/Division%Modulus**ExponentOperatorFunction=NormalAssignment+=AddandAssign-=SubtractandAssign*=MultiplyandAssign/=DivideandAssign%=ModulusandAssign**=ExponentandAssign$number=$number+100;$number+=100;24Takeabreak…modulus10.5%3.2=?exponentiation2^3=?25stringFormatSinglequotes‘hello’‘hello\nhello’‘hello,$name’Doublequotes“hello”“hello\nhello”“hello,$name”
本文标题:生物资讯程式设计实习(二)
链接地址:https://www.777doc.com/doc-295342 .html