![印度昌迪加爾市微生物技術(shù)研究所生物信息學(xué)課件_第1頁(yè)](http://file4.renrendoc.com/view/4873c7549a87b134631d552c02ea0bd3/4873c7549a87b134631d552c02ea0bd31.gif)
![印度昌迪加爾市微生物技術(shù)研究所生物信息學(xué)課件_第2頁(yè)](http://file4.renrendoc.com/view/4873c7549a87b134631d552c02ea0bd3/4873c7549a87b134631d552c02ea0bd32.gif)
![印度昌迪加爾市微生物技術(shù)研究所生物信息學(xué)課件_第3頁(yè)](http://file4.renrendoc.com/view/4873c7549a87b134631d552c02ea0bd3/4873c7549a87b134631d552c02ea0bd33.gif)
![印度昌迪加爾市微生物技術(shù)研究所生物信息學(xué)課件_第4頁(yè)](http://file4.renrendoc.com/view/4873c7549a87b134631d552c02ea0bd3/4873c7549a87b134631d552c02ea0bd34.gif)
![印度昌迪加爾市微生物技術(shù)研究所生物信息學(xué)課件_第5頁(yè)](http://file4.renrendoc.com/view/4873c7549a87b134631d552c02ea0bd3/4873c7549a87b134631d552c02ea0bd35.gif)
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Introduction to Perl & BioPerlDr G. P. S. Raghava Bioinformatics CentreIMTECH, ChandigarhEmail: raghavaimtech.res.inWeb: Perl IntroductionUsesShell scriptsCGI, web enginesGood atText processingSmall/Medium sized projectsQuick and dirty solutionsPortability (to a certain degree)PerlPractical Extracti
2、on and Report LanguageCreated by Larry WallRuns on just about every platformMost popular on Unix/Linux systemsExcellent language for file and data processingBasic ConceptsPerl files extension .PlCan create self executing scriptsAdvantage of PerlCan use system commandsComment entryPrint stuff on scre
3、enSimple Program#!/usr/local/bin/perl# This is a comment line. This program prints “Hello World.”# to the screen.print “Hello world.n”;On Unix, this is the location of the Perl interpreterComments start with # and end with the end of the lineProgram statements are terminated with semicolonsNewline c
4、haracterHow to Store ValuesScalar variablesList variablesPush,pop,shift,unshift,reverseHashes,keys,values,eachRead from terminal, command line argumentsRead and write to filesPerl Data TypesThree Main DatatypesScalarA single number, string or reference.$society = “Redbrick”;ListA collection of scala
5、r datatypes.societies = ( “RB”, “Drama”, “Film”);Length of an array with “scalar list”HashPairs of scalars, accessed by keys.%hash = ( “colour” = “red”,“make” = “corvette” ); Perl Basics ifSelective evaluate blocks of code depending on a condition.If ($string eq “blah”)print “String is blahn”;elsif
6、($string eq “spoo”)Print “String is spoon”;elsePrint “What the hell?n”;Perl Basics for Practically the same as C/C+/Javafor ($i = 0; $i 10; $i+)print “i is “ . $i . “n”;Perl Basics foreachA handy way of processing a listforeach $grocery (groceries)scan($grocery);Can use the default variable ($_)fore
7、ach (groceries)scan($_);Control Structures#!/usr/local/bin/perl# Print out 0,1,2,3,4,5,6,7,8,9# in this case, $x is local only to the loop because my is usedfor (my $x = 0; $x 10; $x+) print “$x”; if ($x 9) print “,”; print “n”;Control Structures#!/usr/local/bin/perl# Demonstrate the foreach loop, w
8、hich goes through elements# in an array.my users = (“bonzo”, “gorgon”, “pluto”, “sting”);foreach $user (users) print “$user is alright.n”;FunctionsUse sub to create a function.No named formal parameters, assign _ to local subroutine variables.#!/usr/local/bin/perl# Subroutine for calculating the max
9、imumsub max my $max = shift(_); # shift removes the first value from _ foreach $val (_) $max = $val if $max filename.txt” Truncate and write to file.“filename.txt” Append to file.Perl File I/O - ReadReading$string = ;list = ;while ($string = )print “LINE : “ . $string;Perl File I/O - WriteWriting to
10、 a file.print FILEHANDLE “Hello”;foreach $item (list)print FILEHANDLE $item;foreach (list)print FILEHANDLE;FilesFile handles are used to access filesopen and close functions#!/usr/local/bin/perl# Open a file and print its contents to copy.txtmy $filename = $ARGV0;open(MYFILE, “$filename”); # indicat
11、es writeopen(OUTPUT, “copy.txt”);while ($line = ) # The operator reads a line print OUTPUT $line; # no newline is needed, read from fileclose MYFILE; # Parenthesis are optionalPlatformsHP-UX / Itanium (ia64) 11.0 HP-UX / PA-RISC 11.0 MacOSMacOS XCygWin NT_5 v. 1.3.10 on Windows 2000 5.00 Win32, WinNT i386 IRIX64 6.5 SGI Solaris 2.8 UltraSparc OpenBSD 2.8 i386 RedHat Linux 7.2 i686 Linux i386 Perl CGI Example #!/usr/bin/perl w# My Third Perl script.# I call this scr
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 三年級(jí)數(shù)學(xué)下冊(cè)兩位數(shù)乘兩位數(shù)的口算乘法
- 第3課 聽覺(jué)(教案)-2023-2024學(xué)年六年級(jí)科學(xué)下冊(cè)同步備課(青島版)
- 山東藝術(shù)學(xué)院《計(jì)算機(jī)網(wǎng)絡(luò)C》2023-2024學(xué)年第二學(xué)期期末試卷
- 內(nèi)蒙古師范大學(xué)《管理學(xué)導(dǎo)論》2023-2024學(xué)年第二學(xué)期期末試卷
- 鄭州軌道工程職業(yè)學(xué)院《數(shù)據(jù)訪問(wèn)技術(shù)框架方向》2023-2024學(xué)年第二學(xué)期期末試卷
- 長(zhǎng)春醫(yī)學(xué)高等??茖W(xué)?!峨娔X圖文設(shè)計(jì)》2023-2024學(xué)年第二學(xué)期期末試卷
- 陜西中醫(yī)藥大學(xué)《機(jī)電一體化設(shè)計(jì)》2023-2024學(xué)年第二學(xué)期期末試卷
- 吉林師范大學(xué)《生物分析與檢測(cè)》2023-2024學(xué)年第二學(xué)期期末試卷
- 山東青年政治學(xué)院《國(guó)際采購(gòu)實(shí)務(wù)》2023-2024學(xué)年第二學(xué)期期末試卷
- 廣東財(cái)貿(mào)職業(yè)學(xué)院《醫(yī)學(xué)微生物學(xué)Ⅱ》2023-2024學(xué)年第二學(xué)期期末試卷
- 2025年魯泰集團(tuán)招聘170人高頻重點(diǎn)提升(共500題)附帶答案詳解
- 2024-2025學(xué)年成都高新區(qū)七上數(shù)學(xué)期末考試試卷【含答案】
- 企業(yè)員工食堂管理制度框架
- 《辣椒主要病蟲害》課件
- 電力溝施工組織設(shè)計(jì)-電纜溝
- 2024年煤礦安全生產(chǎn)知識(shí)培訓(xùn)考試必答題庫(kù)及答案(共190題)
- 《法律援助》課件
- 小兒肺炎治療與護(hù)理
- GB/T 36547-2024電化學(xué)儲(chǔ)能電站接入電網(wǎng)技術(shù)規(guī)定
- 學(xué)校物業(yè)管理投標(biāo)書范本
- 《高處作業(yè)安全》課件
評(píng)論
0/150
提交評(píng)論