PhyloMah Lcur 8 by Dan Vandrpool March, 00 opics of Discussion ransiion:ransvrsion ra raio Kappa vs. ransiion:ransvrsion raio raio alculaing h xpcd numbr of subsiuions using marix algbra Why h nral im vrsibl modl can only hav 5 rlaiv ras Liklihood of a 5 axon r nx class will prform his calculaion bu ak accoun of ra hrogniy among sis h ransiion:ransvrsion ra raio vs. h raio. I is ofn obsrvd in ral daass ha ransiions i occur a a ra diffrn from and ofn fasr han ransvrsions v, rsuling in a i/v bias. hr ar mulipl ways for nucloid subsiuion modls o accoun for his bias. Som nucloid subsiuion modls accoun for i/v bias by calculaing h i:v ra raio. his raio is dfind as h ra a which ransiions ar occurring dividd by h ra a which ransvrsions ar occurring. his raio is ofn xprssd as h rk lr kappa as i is implmnd in h K80 KP, Kimura wo Paramr nucloid subsiuion modl. h Qmarix for h K80 modl looks lik his Q Obsrv ha h insananous ra a which all ranvrsions ar occurring is qual o. v ra Maxi has rfrncd h publicaions in which hs modls wr firs dscribd in h nos for lcur 7.
h insananous ra a which all ransiions ar occurring is, modifid by som numbr i ra o drmin ra raio w divid i ra by s ra and h rms cancl i ra s ra laving his is on way o accoun for h ransiion/ransvrsion bias obsrvd in a daa s. h raio is dfind as h probabiliy of any ransiion occurring in a singl insan of im, d an inrval during which only 0 or subsiuions can occur dividd by h probabiliy of any ransvrsion occurring in a singl insan of im d. Prny i occurring in insan of im d Prny v occurring in insan of im d Pr d Pr d Pr d Pr d d Pr d Pr d Pr d Pr d Pr d Pr d Pr d Pr If w solv for his quaion in rms of h i/v E!raio from h prvious d d d d d d d d d d d d d d rms cancl 8d d Whr h / rm abov rsuls from h assumpion of qual bas frquncis in h K80 modl. Wha his dmonsras is ha h quaniy known as h ransiion:ransvrsion raio raio in PUP* is only / h valu of h kappa paramr dfind as par of h K80 modl. So vn hough h ransiion:ransvrsion raio and h ransiion:ransvrsion ra raio sound lik h sam quaniy, hy masur diffrn aspcs of ransiion/ransvrsion bias and can hav qui diffrn numrical valus. By looking a h ra marix for h HK85 modl w s ha mus b s qual o on in ordr for h modl o b quivaln o h F8 modl in which ra of subsiuion is drmind nirly by h nucloid composiion. Q marix his
HK85 ra marix: Q From h HK85 ra marix obsrv ha if, maning ras ar qual For h F8 modl o b qual o h F8 modl, h kappa rm usd in h ra marix mus qual 0 zro. F8 ra marix: Q fr o h F8 ra marix and noic ha, for xampl, whn 0 in h ransiion, 0 so his ransiion occurs a h sam ra as h ransvrsion. s his is ru for h ohr hr kinds of ransiions, hr is no ransiion bias whn 0. PUP* will no l you spcify, only h raio. his is bcaus h xac maning of varis wih diffrn undrlying bas frquncis undr diffrn modls. For xampl, h raio of h ra of ransiions o h ra of ransvrsions for h HK85 modl diffrs dpnding on which ransiions and ransvrsions you compar. h raio of h ransiion o h ransvrsion is qual o undr HK85, bu h raio of h ransiion o h ransvrsion is. h raio can b compard bcaus is maning is h sam rgardlss of bas frquncis.
alculaing h xpcd numbr of subsiuions using marix algbra o calcula h probabiliy of a si changing in a givn insan of im d w hav o ak ino accoun h saring sa of h si and drmin h ransiion probabiliy of ha sa in a givn insan of im For xampl h probabiliy of subsiuion in an insan of im d Prsar wih Prnd wih a d d h im d, is an infinisimal amoun of im during which only zro or on subsiuions can occur. In his cas, h xpcd numbr of subsiuions quals h probabiliy of a subsiuion. o obain h xpcd numbr of subsiuions ovr som arbirarily larg amoun of im, w hav o ingra h xpcd numbr of subsiuions ovr d from zro o. 0 d Mov h firs par ou o lav d d 0 ara undr curv 0 So h probabiliy of an subsiuion occurring from im zro o undr modl would b his rprsns only on of probabiliis in h Qmarix. So in ordr o g h xpcd numbr of subsiuions for h whol marix w can us marix algbra o muliply marics oghr simplify h procss. call h HK85 Q marix from bfor Q
W can muliply h ra marix Q by a im o yild h following marix: Q mmbr o g h xpcd numbr of subsiuions w hav o muliply by h probabiliy of h saring bas bas frq. o do his for ach rm w can muliply h Π marix by h Q marix o g: 0 0 0 0 0 0 0 0 0 0 0 0 h ruls for muliplying marics dmonsrad wr a b c d f g h a bg af bh c dg cf dh his is a simpl xampl bu if hs ruls ar applid o h abov marics i yilds ΠQ W can now ak h ngaiv of h rac add h diagonal rms and muliply by of his marix o solv for h oal xpcd numbr of subsiuions d [ ] [ ] [ ] rac d ΠQ
W can chck his by sing if h xpcd numbr of subsiuions for h HK85 ar quivaln o ha for h J modl if w plug in / bas frquncis and qual ras. For h J modl d3α, so whn w s and bas / 6 6 3 3 8 3α ou can prform h algbra o s if his works for h KP modl as wll. Using marix alggra allows mor flxibiliy in h modls ha can b usd. I is possibl o do h marix muliplicaion numrically, and so h ransiion probabiliis ndd for liklihood calculaions can b obaind vn for modls in which i is impossibl o find algbraic formulas for h ransiion probabiliis. Why h modl only has 5 rlaiv ras call h marix allows diffrn ras of chang for ach nucloid pair. a b c Q a d b d f c f If bas frquncis wr qual, h xpcd numbr of subsiuions for h marix would b d 8 abcdf [ ] in h abov quaion, if w allow all of h rlaiv ras a, b, c, d,, and f o vary, hn hr ar many possibl combinaions ha will giv h sam valu for d. For xampl, halving h valu of and doubling h valu of ach of h 6 rlaiv ras would produc h sam valu for d as h abov formula bcaus h can b facord ou and cancls wih h in h dnominaor: d 8 a b c d f [ ] If on of h ras is
If on of h svn ra paramrs {, a, b, c, d,, f} is consraind o qual, howvr, hn d is uniquly dfind by h paramrs in h modl. For xampl, sing f givs d 8 a b c d [ ] Hr, w hav again halvd b and doubld all h rlaiv ra paramrs, bu now h canno b facord ou of h sum on h righ sid and hus halving and doubling h rlaiv ras changs h valu of d, as i should. alculaing h liklihood of a axon r hr is a worksh associad wih his. W calculad h liklihood for on si, k, on a axon r, producing a si liklihood L k. mmbr, o g h ovrall liklihood w would hav o muliply his by h h si liklihoods for all ohr sis in h daa marix LL L L 3 L L 5 L 6 L 7 L k o calcula h si liklihood assum branch lnghs in h blow figur qual h xpcd numbr of subsiuions. Sinc h modls ar im rvrsibl, i dos no mar wha poin in h r w considr h roo. d 0.5 d 0.05 d 0.0 d 3 0.05 d 5 0.05 If w arbirarily choos o sar a w calcula h si liklihood for his combinaion of inrnal nod sas L k PrPr d Pr d Pr d 3 Pr d Pr d 5 Whr Pr is h probabiliy of saring wih bas and Pr d is h probabiliy of changing from a o an along branch d c. Using h KP subsiuion modl his bcoms
5 5 3 3 k L h firs rm abov is h probabiliy of a ransiion, h scond is h probabiliy of a ransvrsion, and h las hr rms rprsn h probabiliy of no chang. Prransiion Prransvrsion PrNo hang h blow abl summarizs h ransiion probabiliis for h s of branch lnghs on h xampl r undr h KP modl. W can calcula h quaniy usd in h ransiion formulas abov givn h branch lngh d bcaus d for h K80 modl. For hs calculaions, w assumd k 6, hus d /6 d/. d Prno chang Pri Prs d 3, d, d 5 0.05 0.05 0.95937 0.03578 0.00675 d 0. 0.05 0.9075 0.068079 0.096 d 0.5 0.075 0.86699 09 0.0806 Plugging h valus from h abl abov ino h quaion blow: L k PrPr d Pr d Pr d 3 Pr d Pr d 5 w g L k 0.0680790.08060.95937 3.00065 his is h liklihood for on si wih on combinaion of ancsral sas and on paricular combinaion of branch lnghs and. In ordr o g h oal liklihood, w hav
o calcula his valu for all possibl combinaions of ancsral sas. For a axon r his mans w mus calcula i for all 6 possibl combinaions of ancsral sas and hn add hs oghr. W did his in class for h abov xampl, Paul providd h abl blow for h nos kappa 6 d3,d,d5 d d 0.05 0.0 0.5 Prsam 0.959369 0.907535867 0.8669905 Prrs 0.035780 0.06807886 0.09737689 Prrv 0.00675 0.096 0.08068
nc. Pc. Sa liklihood of sum 0.00065 63.% 7.303E 0.0%.0098E08 0.0% 7.303E 0.0%.6608E06 0.%.0769E08 0.0%.3379E09 0.0%.0393E0 0.0% 0.0003655 3.6% 9.6388E0 0.0%.977E06.% 9.6388E0 0.0%.7736E05 3.5% 3.593E09 0.0%.0799E08 0.0% 9.5793E08 0.0% 0.00099 00% oal si liklihood No addd by Paul: h NEXUS fil usd o calcula hs liklihoods in PUP* is also blow. his NEXUS fil conains blocks: a PUP block, a HES block, a EES block, and anohr PUP block. h firs PUP block ss h cririon o maximum liklihood crilik and lls PUP* o sor any branch lnghs i finds sorbrlns. h scond lin ss up PUP* o us h K80 modl: ns mans w wan o us a modl wih wo subsiuion classs ransiions and ransvrsions, raio3.0 ss 6 bcaus raio / for his modl, basfrqqual mans all rlaiv bas frquncis ar o b ¼, and varianhky is ncssary o disinguish his modl which is idnical o h hky modl wih qual frquncis from h F8 modl wih qual frquncis if you wand F8, you would spcify varianf8. No: h main rason for having wo PUP blocks is o g sorbrlns spcifid bfor PUP* rads in h EES block. h ohr suff could b movd o h scond PUP block. h HES block provids a small daa marix conaining sis for axa. h HES block lik a D block, wih which you ar probably mor familiar. h EES block provids h r dscripion. No ha axon5 is lisd in h r dscripion, bu hr is no daa for axon5 in h daa marix. axon5 is simply bing usd as a labl for on of h inrior nods of h r
hr. h ur dsignaion lls paup ha his is an unrood r hr is no maningful roo o his r. h final PUP block lls paup o compu h liklihood scors lscors for individual sis siliks, using h branch lnghs usrbrlns ha w providd i.. don' ry o sima branch lnghs using maximum liklihood. #nxus bgin paup; s crilik sorbrlns; ls ns varianhky raio3.0 basfrqqual; nd; bgin characrs; dimnsions nwaxa nax nchar; forma daaypdna; marix axon axon axon3 axon ; nd; bgin rs; ur s axon:0.5,axon:0.0axon5:0.05,axon3:0.05,axon:0.05; nd; bgin paup; lscors / usrbrlns siliks; nd;