Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
SequenceComparison:PairwiseAlignment
ShifraBen-DorIritOrr
Bioinformatics Lecture 5 2019
PAIRWISE ALIGNMENT
DATABASE SEARCHING
MULTIPLE ALIGNMENT
MULTIPLE ALIGNMENT
Phylogenetic Analysis
Homology Modeling
Advanced Database Searches, Patterns, Motifs, Promoters
Theproblems:
IhaveaDNAsequence:Whatdoesitdo?possiblecodingregionpossibleregulatoryregionIhaveaproteinsequence:Whatdoesitdo??
SequenceComparison
• Generally,sequencedeterminesstructureandstructuredeterminesfuncHon
• Bystudyingsequencesimilarity,wehopetofindcorrelaHonsbetweenoursequenceandothersequenceswithknownstructureorfuncHon
• ThisapproachisoKensuccessful,howevermanymoleculeshavelowsequencesimilarity,yetsHllsharesimilarstructureorfuncHon.
SequenceComparison
• MoHfs/Domains-similarityoversmallstretches
• Sequencefamilies-similarityoverlongersequences
• Comparisoncanhelpuswith:• structure• funcHon• evoluHon
ComparisonQuesHons:
• Arethesequencesrelated(homology)?
• Canwequalifytheirsimilarity?
• Dotheyhavesimilarsegments?
Terminology:
• Homology
• IdenHty
• Similarity
Homology
• Commonancestry
• Sequence(andusuallystructure)conservaHon
• HomologyisnotameasurablequanHty
• Homologycanbeinferred,undersuitablecondiHons
IdenHty
• ObjecHveandwelldefined
• CanbequanHfiedbyseveralmethods:
• Percent
• ThenumberofidenHcalmatchesdividedbythelengthofthealignedregion
Similarity
• Mostcommonmethodused
• Notsowelldefined
• Dependsontheparametersused(alphabet,scoringmatrix,etc.)
Whatarewecomparing?
• DNAorRNA• Fournucleicacids(basicset)
• Protein• Twentyaminoacids(basicset)
Alignment• Analignmentisanarrangementoftwosequencesoppositeoneanother
• Itshowswheretheyaredifferentandwheretheyaresimilar
• WewanttofindtheopHmalalignment-themostsimilarityandtheleastdifferences
Alignment
• Alignmentshavetwoaspects:
• QuanHty:Towhatdegreearethesequencessimilar(percentage,otherscoringmethod)
• Quality:Regionsofsimilarityinagivensequence
TheopHmalalignmentoftwosequencesisonethatfindsthelongestsegmentofhighsequencesimilarity.
Howisanalignmentdone?
• Whenwecomparesequences,wetaketwostringsofleXers(nucleoHdesoraminoacids)andalignthem.
• WherethecharactersareidenHcal,wegivethemaposiHvescore,andwheretheydiffer,anegaHvevalue.
• WecounttheidenHcalandnon-idenHcalcharacters,andgivethealignmentascore(usuallycalledthequality)
Differencesinthesequencecanbe
causedbydeleHonsorinserHonsin
theDNA,orbypointmutaHons.These
changescanbeseenattheproteinlevel
aswell(changesinthetranslaHonof
theprotein)
ThisschemeworksfineaslongasyouassumethatallpossiblemutaHonsoccuratthesamefrequency.However,naturedoesn’tworkthisway.IthasbeenfoundthatinDNA,transiHonsoccurmoreoKenthantransversions.
Purines(A,G) are2-ringbasesPyrimidines(C,T)are1-ringbasesTransiHon:purinetopurineor pyrimidinetopyrimidineTransversion:purinetopyrimidineorpyrimidinetopurineTransiHonsconserveringnumberTransversionschangeringnumber
takenfromMolecularCellBiology,DarnellLodishBalHmore1990
Forproteins,thesituaHonisfarmorecomplex
• AminoacidscanbegroupedbyanumberofclassificaHons:
• Chemical:aromaHc,aliphaHc,sulphuric
• FuncHonal:hydrophobic,hydrophilic,acidic,basic
• Charge:posiHve,negaHve,neutral
• Structural:internal,external
ScoringMatrices
• Scoringmatricesareusedtoassignascoretoeachcomparisonofapairofcharacters
• ThescoresinthematrixareintegervalueswhichassignaposiHvescoretoidenHcalorsimilarcharacterpairs,andanegaHvevaluetodissimilarpairs
• Thematriceswereconstructedbyanalyzingknownfamiliesofproteins
Anexample:Blosum62Henikoff&Henikoff
A B C D E F G H I K L M N P Q R S T V W X Y Z A 4 -2 0 -2 -1 -2 0 -2 -1 -1 -1 -1 -2 -1 -1 -1 1 0 0 -3 -1 -2 -1 B -2 6 -3 6 2 -3 -1 -1 -3 -1 -4 -3 1 -1 0 -2 0 -1 -3 -4 -1 -3 2 C 0 -3 9 -3 -4 -2 -3 -3 -1 -3 -1 -1 -3 -3 -3 -3 -1 -1 -1 -2 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W -3 -4 -2 -4 -3 1 -2 -2 -3 -3 -2 -1 -4 -4 -2 -3 -3 -2 -3 11 -1 2 -3 X -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 Y -2 -3 -2 -3 -2 3 -3 2 -1 -2 -1 -1 -2 -3 -1 -2 -2 -2 -1 2 -1 7 -2 Z -1 2 -4 2 5 -3 -2 0 -3 1 -3 -2 0 -1 2 0 0 -1 -2 -3 -1 -2 5
Alignmentalgorithms
• Visualalignment• allowsintegraHonofrelevantdatanotavailabletocomputerizedalgorithms
• Timeconsuming,notfeasibleforallbuttheshortestsequences
• Fixedlengthalgorithms• donotconsiderinserHonsanddeleHons• inserHonsanddeleHonsareneededevenforcloselyrelatedsequences
AlignmentAlgorithms
• Thenaïveapproach:• generateallpossiblealignmentsfor2sequences(includinggaps)andchoosethealignmentwiththehighestscore
• TooHmeconsuming
Dynamicprogrammingalgorithms
• Eachcharacteralongbothsequencesisevaluated.AteachposiHontherearefourpossibilites• idenHty• subsHtuHon• deleHoninsequence1• deleHoninsequence2
Dynamicprogramming
• IdenHcalcharacters(matches)orsubsHtuHons(mismatches)arescoredaccordingtoamatrix.
• DeleHonsineitherofthesequencesarecalledgaps.
• GapsaregivenanegaHvescore,referredtoasthegappenalty
Thealignmentisgivenascore,calledthequalityQuality=matches-(mismatches+gappenalty)Theprogramwillfindthealignmentwiththehighestquality.ThechoicebetweengapsandsubsHtuHonsismadetogivethehigherqualityofthetwo.
TheGapPenaltyConsiderthetwofollowingalignments: V I T K L G T C V G S V I T K L G T C V G S
V I T . . . T C V G S V . T K . G T C V . S
Accordingtothealgorithmthese2caseswillgetthesamegappenalty:
Match=3Gap=-2 8(3) + 3(-2) = 18 8(3) + 3(-2) = 18
Howevernatureisdifferent.Inmost
casesinserHons/deleHonsarelonger
thanasingleresidue,evenforvery
similarsequences.
Tocompensateforthis,andtodifferenHatebetweencasesliketheoneabove,thegappenaltyismadeupoftwofactors:ThegapcreaHonpenalty-subtractedfromthealignmentqualitywheneveragapisopened.Thegapextensionpenalty-subtractedfromthealignmentqualityaccordingtothelengthofthegap.
Thuswehave:Quality=matches-(mismatches+gappenalty)Gappenalty=gapcreaHonpenalty+(gapextensionpenaltyXgaplength)
TheGapPenaltySonowwehave: V I T K L G T C V G S V I T K L G T C V G S V I T . . . T C V G S V . T K . G T C V . S
Match=3Gapopen=-4Gapextension=-1 8(3)+[1(-4)+3(-1)]=178(3)+[3(-4)+3(-1)]=9
Gappenaltyparameters
InserHonofagapmustimprovethequalityofthealignment(raisethequalityscore).
IfthegapcreaHonandgapextensionpenalHesarehigh,lessgapswillbeinsertedintothealignment.
IfthegapcreaHonandgapextensionpenalHesarelow,moregapswillbeinsertedintothealignment.
SoifyouareinterestedinanalignmentbetweentwoverysimilarsequencesthegappenalHesshouldberaised,toreducethechancesofgejngsomethingrandom.
IfyouareinterestedindetecHnghomology(findingaweaksimilarity)betweentwodistantlyrelatedsequencesthegappenalHesshouldbelowered.
Ifyoudon'tknowwhattoexpect,startoffwiththedefaultparameters
Tosummarize:■ Alignmentscoresaredependentonwhatwechoosefor:matches,mismatches,subsHtuHonsandgaps.
■ Dynamicprogrammingcanbeusedforglobalorlocalalignment
Twotypesofalignment:
• Globalalignment
• Localalignment
Globalalignment
Localalignment
Globalalignment
Aglobalpairwisealignmentisonewhereitisassumedthatthetwosequenceshavedivergedfromacommonancestorandthattheprogramshouldtrytostretchthetwosequences,introducinggapswherenecessary,inordertoshowthealignmentoverthewholelengthofthetwosequencesthatbestillustratestheirsimilariHes.
Globalalignment
• Comparessequencesandgivesbestoverallalignment
• Mayfailtofindthebestlocalregionofsimilarity(suchasasharedmoHf)amongdistantlyrelatedsequences
• Will(generally)returnonlythebestmatchingsegmentforagivenpairofsequences
Globalalignment–EndGaps
• Sinceaglobalalignmentcanonlygiveoneoveralloutput,thequesHonarisesofhowwedealwithoverhangingends,alsoknownas‘endgaps’
• ThereisanopHonalpenaltyforendgapsinmostglobalalignmentprograms,thoughtheyarenotnecessarilyonbydefault
Globalalignment
• TheclassicalalgorithmforglobalalignmentistheNeedleman-Wunsch
AgeneralmethodapplicabletothesearchforsimilariHesintheaminoacidsequenceoftwoproteins.NeedlemanSB,WunschCDJMolBiol1970Mar;48(3):443-53
LocalAlignment• SearchesforregionsoflocalsimilaritybetweentwosequencesandneednotincludetheenHrelengthofthesequences.
• Findsregionsof(ungapped)sequencewithahighdegreeofsimilarity
• BeXeratfindingmoHfs,especiallyforsequencesthataredifferentoverall
• Canreturnmorethanonematchingsegmentforagivenpairofsequences
LocalAlignment
• TheclassicalalgorithmforlocalalignmentistheSmith-Waterman
IdenHficaHonofcommonmolecularsubsequencesSmithTF,WatermanMSJMolBiol1981Mar25;147(1):195-7
SequenceComparisonPrograms
• Global
• Needle(EMBOSS)
• Stretcher(EMBOSS)–modifiedtoconserve
memory,goodforlongsequences
SequenceComparisonPrograms
• Local
• Lalign(Fasta)–canreturnmorethanonesegment
• Matcher(EMBOSS)-basedonlalign,canreturn
morethanonesegment
• Water(EMBOSS)-Smith-Waterman,onlyonehit
• Bl2Seq–Blast2sequences
LocalpairwisealignmentusingBL2SEQatNCBI
■ ThistoolproducesthealignmentoftwogivensequencesusingBLASTalgorithmforlocalalignment.
■ Reference:TaHanaA.Tatusova,ThomasL.Madden(1999),"Blast2sequences-anewtoolforcomparingproteinandnucleoHdesequences",FEMSMicrobiolLeX.174:247-250
LocalpairwisealignmentusingBL2SEQ
■ ThistooluHlizestheBLASTengineforpairwisesequencecomparisonandisbasedonthesamealgorithmandstaHsHcsoflocalalignmentsthathavebeendescribedintheBLASTpaper.
■ TheBLASTalgorithmgeneratesagappedalignmentbyusingdynamicprogrammingtoextendthecentralsegmentofalignedresidues.
■ Becausetheparameterswerebasedondatabasesearching,somemayhavetobechangedtofindamatch
StaHsHcalEvaluaHonofAlignments
TheproblemwiththeseprogramsisnomaXerhowdissimilarthesequencesyoucompare,theprogramswillalwaysalignthem.
Evena5%idenHtywillbedisplayedasavalidresult.
SohowcanyoutellifthealignmentisstaHsHcallyvalid????
StaHsHcsbyrandomizaHon
■ Aprogramwilltakethesecondsequenceyouinputandshuffleit,toobtainarandomsequencewiththesamecharactercomposiHon.
■ Thisrandomsequencewillbecomparedtothefirstsequence,usingeitheraglobalorlocalalgorithm(thesamethatyouusedoriginally),andaqualityscorewillbeobtained.
RandomizaHon■ ThisprocessisrepeatedmanyHmes,(numberofHmesgenerallyspecifiedbytheuser)inordertoobtainapopulaHonofsequencesthatcanbeusedforstaHsHcalanalysis.
■ ThequalityofthesealignmentsisploXedinadistribuHonandcomparedtotheoriginalquality,andthenbeusedtogiveastaHsHcallymeaningfulanswertothealignment.
IntheFASTApackage,thePRSSprogramcanperformshufflingofsequencesItcanbedoneuniformlythroughoutthesequence,orusingwindows(whichisusefuliftherearenon-randomwindowsinasequence,likeatransmembranedomain,whichwillbeskewedtowardshydrophobicaminoacids).
Dotplotsaretwodimensionalgraphs,showingacomparisonoftwosequences.Thetwoaxesofthegraphrepresentthetwosequencesbeingcompared.Everyregionofthesequenceiscomparedtoeveryregionoftheothersequence.
Dotplots
DotplotsDotplojngisthebestwaytoseeallofthestructuresincommonbetweentwosequences.Dotplojngcanalsobeusedtoviewrepeatedstructuresorinvertedrepeatsinasinglesequence.Thisisaccomplishedbycomparingasequencetoitself.Dotplojnghelpsrecognizelargeregionsofsimilarity.InmostcasesitisnotsensiHveenoughtoseesmallstructures.
ComparisonCriteriaThematchcriterioncanbemetintwodifferentways:Thewindow/stringencymethod.Thewordmethod.
Thewindow/stringencymethod
Searchesforalltheplaceswhereagivennumberofmatches(stringency)occurwithinagivenrange(window).ThismethodismoreHme-consuming,butmoresensiHve.Comparisonsaredoneaccordingtoascoringmatrix.
Mustbespecifiedonthecommandline(-wordsize=X,whereXisthesizeyouchoose).Searchesforshortperfectmatchesofasetlength(words).Thismethodisabout1000Hmesfasterthanthewindow/stringencymethod,butismuchlesssensiHve.Ifthesequencesdonotcontainshortperfectmatchesthenthismethodwillfindnothing.
Thewordmethod
HintsIfyouhavelongsequences,tryawordcomparisonfirst.Thisismuchfaster,andwillgiveyouanideaofwhatthedotplotforthemoresensiHvewindow/stringencymethodwilllooklike.Whenusingthewordmethod,startoffwithawordsizeof6fornucleicacidsequencesofupto1,000bases,or8forsequencesofupto10,000.
Hints
ForpepHdesequences,startoffwithawordsizeof2-3.Whenusingthewindow/stringencymethodstartoffwithawindowof21andastringencyof14fornucleicacids.ForpepHdesequencesstartoffwithawindowof30andastringencyof11.
Programsfordotplots
■ FASTA– PLALIGN
■ EMBOSS– Dotmatcher-window/stringency– DoXup-wordplot– Dotpath-non-overlappingwordplot– Polydot-allagainstallwordplot
AlternaHve“dotplots”
DoXerisagraphicaldotplotprogramfordetailedcomparisonoftwosequences.Tomakethescorematrixmoreintelligible,thepairwisescoresareaveragedoveraslidingwindowwhichrunsdiagonally.Theaveragedscorematrixformsathree-dimensionallandscape,withthetwosequencesintwodimensionsandtheheightofthepeaksinthethird.
Thislandscapeisprojectedontotwodimensionsbyaidofgreyscales-thedarkergreyofapeak,thehigheritis.DoXerprovidesatooltoexplorethevisualappearanceofthislandscape,aswellasatooltoexaminethesequencealignmentitrepresents.