BioPerlHOWTOBeginner.docx
- 文档编号:10260743
- 上传时间:2023-05-24
- 格式:DOCX
- 页数:35
- 大小:35.94KB
BioPerlHOWTOBeginner.docx
《BioPerlHOWTOBeginner.docx》由会员分享,可在线阅读,更多相关《BioPerlHOWTOBeginner.docx(35页珍藏版)》请在冰点文库上搜索。
BioPerlHOWTOBeginner
HOWTO:
Beginners
Abstract
ThisisaHOWTOthattalksaboutusingBioperl,forbiologistswhowouldliketolearnmoreaboutwritingtheirownbioinformaticsscriptsusingBioperl.WhatisBioperl?
Itisanopensourcebioinformaticstoolkitusedbyresearchersallovertheworld.Ifyou'relookingforascriptbuilttofityourexactneedsyouprobablywon'tfinditinBioperl.WhatyouwillfindisadiversesetofPerlmodulesthatwillenableyoutowriteyourownscript,andacommunityofpeoplewhoarewillingtohelpyou.
Introduction
Ifyou'reamolecularbiologistit'slikelythatyou'reinterestedingeneandproteinsequences,andyoustudytheminsomewayonaregularbasis.Perhapsyou'dliketotryyourhandatautomatingsomeofthesetasks,oryou'rejustcuriousaboutlearningmoreabouttheprogrammingsideofbioinformatics.InthisHOWTOyou'llseediscussionsofsomeofthecommonusesofBioperl,likesequenceanalysiswithBLASTandretrievingsequencesfrompublicdatabases.You'llalsoseehowtowriteBioperlscriptsthatchainthesetaskstogether,that'showyou'llbeabletodoreallypowerfulthingswithBioperl.
Youwillalsoseesomediscussionsofsoftwareconcepts;thiscan'tbeavoided.Themoreyouunderstandaboutprogrammingthebetterbutalleffortswillbemadetonotintroducetoomuchunfamiliarmaterial.However,therewillbeanintroductiontomodularity,orobjects.ThisisoneoftheaspectsoftheBioperlpackagethatyou'llhavetocometogripswithasyouattemptmorecomplextaskswithyourscripts.
Oneofthechallengingaspectsoflearninganewskillislearningthejargon,andprogrammingcertainlyhasitsshareofinterestingtermsandbuzzphrases.Bepatient-rememberthattheprogrammerslearningbiologyhavehadjustastoughatask(ifnotworse-justaskthem!
).
Note:
ThisHOWTOdoesnotdiscussaverynicemodulethat'sdesignedforbeginners,Bio:
:
Perl.Thereasonisthatthoughthisisanexcellentintroductorytool,itisnotobject-orientedandcan'tbeextended.Whatwe'reattemptinghereistointroducethecoreofBioperlandshowyouwaystoexpandyournew-foundskills.
InstallingBioperl
ThefirstthingtodetermineistheBioperlplatform-UnixorWindows?
Herearesomethingstoconsider,ifyou'rechoosingbetweenthetwo.
UnixAdvantages
∙KnowingsomeUnixisausefulskill.NomatterhowprevalentWindowsisonthedesktop,Unixrulesbioinformatics.
∙Unixisn'tashardasyoumaythink,ifyouknowlessthan10commandsyou'rereadytowork.
∙Everybioinformaticsapplicationyou'veeverheardofrunsonUnix.
∙IfyouwanttodoseriouscomputationthetypicalUnixserverisprobablymorestableandmorepowerfulthantheavailableWindowsmachine.
∙Theremaybeanadministratortakingcareofthemachine-maybeshe'lleveninstallBioperlforyou!
Askandsee.
UnixDisadvantages
∙Thecommand-linecanseemunfamiliarandawkwardatfirst.
∙YourUnixaccountmaybeonaserver-nottooportable!
∙Youmaynothaveeasyaccesstoallyourfamiliarprograms.
∙You'llprobablyhavetolearntouseaUnixwordprocessor,likeemacsorvi.
∙Youmaynothavecontrolofthemachine,theadministratorwill.YoumaynotbeabletodownloadallofGenbank,forexample!
WindowsAdvantages
∙Simplicity,ifWindowsiswhatyou'reworkingwithnow.
∙PlentyofBioperlusersrunitonWindows.
WindowsDisadvantages
∙NotallbioinformaticsapplicationsrunonWindows.
∙It'syourcomputer,youwillhavetodealwiththeinstallationdetailsyourself.
∙Yourcomputermaynotbeabletohandleseriouscomputationgracefully.
Tip:
IfyoudecidetouseUnixtherearemanyWebpagesthatcangiveyouagoodintroduction,google"introductionunix"toseemorethanafew.
YoushouldalsoreadtheinstructionsforUnixinstallationorWindowsinstallation.Manyoftheletterstothebioperl-lmailinglistconcernproblemswithinstallation,andthereisasetofconcernsthatcomeuprepeatedly:
∙OnWindows,messageslike:
"Error:
FailedtodownloadURLhttp:
//bioperl.org/DIST/GD.ppd",or"
∙OnUnix,messageslike"Can'tlocate
∙Seeingmessageslike"TestsFailed".IfyouseeanerrorduringinstallationconsiderwhetherthisproblemisgoingtoaffectyouruseofBioperl.Thereareroughly1000modulesinBioperl,andtentimesthatmanytestsarerunduringtheinstallation.Ifthere'sacomplaintaboutGDit'sonlyrelevantifyouwanttousetheBio:
:
Graphicsmodules,ifyouseeanerroraboutsomeXMLparserit'sonlygoingtoaffectyouifyou'rereadingXMLfiles.Yes,youcouldtryandmakeeachandeverytestpass,butthatmaybealotofwork,withmuchofitfixingmodulesthataren'tinBioPerlitself.
GettingAssistance
PeoplewillrunintoproblemsinstallingBioperlorwritingscriptsusingBioperl,nothingunusualaboutthat.Ifyouneedassistancethewaytogetitistomailbioperl-l@bioperl.org.Thereareagoodnumberofhelpfulpeoplewhoregularlyreadthislistbutifyouwanttheiradviceit'sbesttogivesufficientdetail.
Pleaseinclude:
∙TheversionofBioperlyou'reworkingwith.
∙Theplatformoroperatingsystemyou'reusing.
∙Whatyouaretryingtodo.
∙Thecodethatgivestheerror,ifyou'rewritingascript.
∙Anyerrormessagesyousaw.
Everyonceinawhileamessagewillappearinbioperl-lcomingfromsomeoneindistressthatgoesunanswered.Theexplanationisusuallythatthepersonneglectedtoinclude1ormoreofthedetailsabove,usuallythescriptortheerrormessages.
Andeveryonceinawhile,notoften,anemailwillgounansweredbecausethetoneisunpleasant.Bioperlisa100%volunteereffort,weallhaveotherjobs,complainingaboutbugsorlackofdocumentationisnotthewaytomakefriends!
PerlItself
HereareafewthingsyoumightwanttolookatifyouwanttolearnmoreaboutPerl:
∙LearningPerlisthemostfrequentlycitedbeginner'sbook.
∙PerlinaNutshellisalsogood.Notmuchinthewayofexamples,butcoversmanytopicssuccinctly.
∙Perl'sowndocumentation.Do"perldocperl"fromthecommand-lineforanintroduction.Perldoccangiveyoudocumentationofanymodulethatisinstalledonyoursystem:
do"perldoc
>perldocBio:
:
SeqIOor:
>perldocBio:
:
SearchIO
WritingascriptinUnix
Sometimesthetrickiestpartisthisstep,writingsomethingandgettingittorun,sothissectionattemptstoaddresssomeofthemorecommontribulations.
InUnixwhenyou'rereadytoworkyou'reusuallyinthecommand-lineor"shell"environment.FirstfindoutPerl'sversionbytypingthiscommand:
>perl-v
Youwillseesomethinglike:
Thisisperl,v5.10.0builtforcygwin-thread-multi-64int
Copyright1987-2007,LarryWall
PerlmaybecopiedonlyunderthetermsofeithertheArtisticLicenseorthe
GNUGeneralPublicLicense,whichmaybefoundinthePerl5sourcekit.
CompletedocumentationforPerl,includingFAQlists,shouldbefoundon
thissystemusing"manperl"or"perldocperl".Ifyouhaveaccesstothe
Internet,pointyourbrowserathttp:
//www.perl.org/,thePerlHomePage.
Hopefullyyou'reusingPerlversion5.4orhigher,earlierversionsmaybetroublesome.Nowlet'sfindoutwherethePerlprogramislocated:
>whichperl
Thiswillgiveyousomethinglike:
>/bin/perl
NowthatweknowwherePerlislocatedwe'rereadytowriteascript,andline1ofthescriptwillspecifythislocation.YoumightbeusingsomeUnixwordprocessor,emacsorvi,forexample(nanoorpicoareotherpossiblechoices,veryeasytouse,butnotfoundonallUnixmachinesunfortunately).Starttowriteyourscriptbyenteringsomethinglike:
>emacsseqio.pl
Andmakethisthefirstlineofthescript:
#!
/bin/perl-w
The-wflagtellsPerltowarnyouifandwhenvariouscommonerrorsareencountered,it'suseful.
Creatingasequence,andanObject
Ourfirstscriptwillcreateasequence.Well,notjustasequence,youwillbecreatingasequenceobject,sinceBioperliswritteninanobject-orientedway.Whybeobject-oriented?
Whyintroducetheseoddorintrusivenotionsintosoftwarethatshouldbebiologicalorintuitive?
Thereasonisthatthinkingintermsofmodulesorobjectsturnsouttobethemostflexible,andultimatelythesimplest,waytodealwithdataascomplexasbiologicaldata.Onceyougetoveryourinitialskepticism,andhavewrittenafewscripts,youwillfindthisideaofanobjectbecomingabitmorenatural.
Onewaytothinkaboutanobjectinsoftwareisthatitisacontainerfordata.Thetypicalsequenceentrycontainsdifferentsortsofdata(asequence,oneormoreidentifiers,andsoon)soitwillserveasaniceexampleofwhatanobjectcanbe.
AllobjectsinBioperlarecreatedbyspecificBioperlmodules,soifyouwanttocreateanobjectyou'realsogoingtohavetotellPerlwhichmoduletouse.Let'saddanotherline:
#!
/bin/perl-w
useBio:
:
Seq;
ThislinetellsPerltouseamoduleonyourmachinecalled"Bio/Seq.pm".WewillusethisBio:
:
SeqmoduletocreateaBio:
:
Seqobject.TheBio:
:
SeqmoduleisoneofthecentralmodulesinBioperl.TheanalogousBio:
:
Seqobject,or"Sequenceobject",or"Seqobj
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- BioPerlHOWTOBeginner