tag:blogger.com,1999:blog-8499895524521663926.post8963114503740231259..comments2024-06-09T18:35:46.962-04:00Comments on Phylogenetic Tools for Comparative Biology: Plotting method for Mk model with intraspecific polymorphismLiam Revellhttp://www.blogger.com/profile/04314686830842384151noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-8499895524521663926.post-60068372698946088142022-08-15T03:55:19.533-04:002022-08-15T03:55:19.533-04:00Dear Liam,
First of all thanks for the quick repl...Dear Liam,<br /><br />First of all thanks for the quick reply! <br /><br />I also thought it was unnecessary to have all levels in the data. Turned out it was a silly data framing mistake; I took a subset of the data because there are some missing values for some characters, and this was read wrong by r... Anyway, it works now.<br /><br />Thank you for leading me to the solution! And a big thanks to your wonderful blogs!!!<br /><br />All the best,<br /><br />VickyVicky Beckershttps://www.blogger.com/profile/06851314604899449417noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-49291090488788682082022-08-11T09:28:09.234-04:002022-08-11T09:28:09.234-04:00Dear Vicky.
It's not necessary to have all le...Dear Vicky.<br /><br />It's not necessary to have all levels in the data for them to be included in the model.<br /><br />Do you want A+B in the model, or just B+C?<br /><br />In other words, do you hypothesize that to get from A to B evolution must go through A+B. If so, it can be included in your model (even if it is not observed).<br /><br />In summary: [1] your 'subscript out of bounds' error is probably not due to A+B not being in your data; [2] if you want A+B in your model, that's fine -- if not, you will need to write your own custom model.<br /><br />To write a custom model please email me & I will send you a worked example.<br /><br />-- LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-43352269245581977192022-08-11T05:45:39.394-04:002022-08-11T05:45:39.394-04:00Dear Liam,
I was wondering how/if you can alter ...Dear Liam, <br /><br />I was wondering how/if you can alter the design matrix for the fitpolyMK models. Currently I have a dataset where A, B, C, B+C are options, but A+B and A+C not (A+C is not opted in the matrix design, but A+B is, though both are not in the data). Because not all options in the design matrix are in the actual data I get a 'subscript out of bounds' error. Do you know how you can alter the design matrix to correct for these missing options? <br /><br />Big thanks in advance!Vicky Beckershttps://www.blogger.com/profile/06851314604899449417noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-44763731211717167612019-05-15T21:50:15.626-04:002019-05-15T21:50:15.626-04:00Hi Liam,
Well, it seems like I'm gonna have t...Hi Liam,<br /><br />Well, it seems like I'm gonna have to email you the files, the pies matrix has only zeros in it and I have no idea what happened.<br /><br />I'll send it to you in a moment.<br /><br />Thank you!Patricia Sperottohttps://www.blogger.com/profile/17732092761609547082noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-39282582688274745802019-05-14T22:58:57.804-04:002019-05-14T22:58:57.804-04:00Hi Patricia.
Yes, I remember you.
Does your data...Hi Patricia.<br /><br />Yes, I remember you.<br /><br />Does your data contain polymorphism (i.e., more than one state at some tips containing a "+" to separate the two or more states)? That is what the strsplit line is for.<br /><br />Does the pies matrix look right? I.e., does it contain a 1.0 under the corresponding state for every tip - and a 0.5 0.5 (if two states) for every bimorphic taxon?<br /><br />Other than these simple checks I would need to see the tree & data. Please feel free to email me the files & a minimum script to reproduce the error & I would be happy to look into it.<br /><br />- LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-33733661685064864012019-05-14T21:50:17.733-04:002019-05-14T21:50:17.733-04:00Hi, Liam!
It's Patricia, I don't know if ...Hi, Liam!<br /><br />It's Patricia, I don't know if you remember me but we met at the Maldonado course (I am the girl who works with climbing plants). I was trying to plot the pie charted phylogeny for a 4-state character and kept getting an error right after trying to plot the little pie charts. Can you maybe help me? Here's the code with the error message:<br /><br />###<br />> plotTree(climber.tree,ftype="off",lwd=1,type="fan")<br />> X<-strsplit(setNames(as.character(Mechs),names(Mechs)),"+",fixed=TRUE)<br />> pies<-matrix(0,Ntip(climber.tree),4,dimnames=list(climber.tree$tip.label,c("1","2","3","4")))<br />> for(i in 1:Ntip(climber.tree)) <br />+ pies[climber.tree$tip.label[i],X[[climber.tree$tip.label[i]]]]<-rep(1/length(<br />+ X[[climber.tree$tip.label[i]]]),length(X[[climber.tree$tip.label[i]]]))<br />> tiplabels(pie=pies,piecol=c("black","yellow","red","blue"),cex=0.2)<br /><br />Error in seq.default(x[i], x[i + 1], length = n) : <br /> 'to' must be a finite number<br /><br />> legend(x="topleft",legend=c("Leaning","Root climbing","Main stem twining",<br />+ "Prehensile/Twining structures"),pt.cex=2,pch=21,<br />+ pt.bg=c("black","yellow","red","blue"))<br />###<br /><br />Everything else but the pie charts is plotted. Any light you can give me will be much appreciated.<br /> <br />Thank you so much!<br /><br />Best,<br />Patricia Sperottohttps://www.blogger.com/profile/17732092761609547082noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-68051580819770579082019-04-03T10:55:36.967-04:002019-04-03T10:55:36.967-04:00Mark - this would be really cool, right? Unfortuna...Mark - this would be really cool, right? Unfortunately, within the current framework its a bit complicated....Liam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-25124858942531788262019-04-03T10:51:00.848-04:002019-04-03T10:51:00.848-04:00Hi Joe. The implicit model is similar, but it look...Hi Joe. The implicit model is similar, but it looks like in polymorphism parsimony the derived character state can only be acquired once, whereas here there is no such implicit restriction (unless we specify it). - LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-83014226546596502252019-03-19T06:46:57.174-04:002019-03-19T06:46:57.174-04:00This is very impressive. Do you think there will b...This is very impressive. Do you think there will be a way to expand this method to also model the relative proportion of different states? So not just A+B, but 40% A, 60% B? I guess such proportions would make the function very computationally challenging, right? Mark Scherzhttps://www.blogger.com/profile/03161662782057832907noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-49854785097636477002019-03-17T13:27:42.165-04:002019-03-17T13:27:42.165-04:00Liam, all this reminds me of Polymorphism Parsimon...Liam, all this reminds me of Polymorphism Parsimony, which was explored in the 1960s-1970s and was mentioned in my phylogenies book. Any relation?Joe Felsensteinhttps://www.blogger.com/profile/06359126552631140000noreply@blogger.com