tag:blogger.com,1999:blog-8499895524521663926.post7321804177194134444..comments2021-07-29T09:18:44.285-04:00Comments on Phylogenetic Tools for Comparative Biology: Mapping the reconstructed value of a quantitative character on the treeLiam Revellhttp://www.blogger.com/profile/04314686830842384151noreply@blogger.comBlogger28125tag:blogger.com,1999:blog-8499895524521663926.post-66750307238028584232016-07-18T13:53:16.259-04:002016-07-18T13:53:16.259-04:00Dear Liam. How can I visualize a tree with 182 tip...Dear Liam. How can I visualize a tree with 182 tips? I mean, how can I make "zoom" in the plot generated? Thanks, AliciaAnonymoushttps://www.blogger.com/profile/12715045341151446483noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-7647277609521159752015-06-15T04:57:29.518-04:002015-06-15T04:57:29.518-04:00I Am Usually To Blogging And I Actually Appreciate...I Am Usually To Blogging And I Actually Appreciate Your Content. The Article Has Actually Peaks My Interest. I Am Going To Bookmark Your Web Site And Maintain Checking For New Information. <a href="http://lalakhaylilla.wordpress.com/" rel="nofollow">judi online</a>Anonymoushttps://www.blogger.com/profile/08631721179481609563noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-39213706959764474742014-11-24T13:59:12.801-05:002014-11-24T13:59:12.801-05:00Well, not the same error as the others, but AN err...Well, not the same error as the others, but AN error...Josteinhttps://www.blogger.com/profile/14533146134202383551noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-7474339908606499752014-11-24T13:22:28.083-05:002014-11-24T13:22:28.083-05:00I had the same error as some of the others here:
...I had the same error as some of the others here:<br /><br />Error in while (x > trans[i]) { : missing value where TRUE/FALSE needed<br /><br />My phylogeny was fine; it worked when I used simulated data (fastBM). The problem was that contMap needed a named vector (which you, in your defense, state explicitly in the documentation).<br /><br />So I did as follows:<br /><br />named.vector<- sorteddata$CVbm<br />names(named.vector) <- ultrametric.tree$tip.label<br />contMap(ultrametric.tree,named.vector,lwd=2,res=200,legend=.5, fsize=.6)<br /><br />...which worked. Thought I'd share in case someone else has the same problem.<br /><br />Btw Liam, thanks for getting the last round in Seville. It was fun; hope to meet you at another conference, and I'll get you back.<br /><br />JosteinJosteinhttps://www.blogger.com/profile/14533146134202383551noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-49746965184798582572014-04-30T04:01:16.804-04:002014-04-30T04:01:16.804-04:00Hi Liam,
Yes thats what I did. In the end, I fou...Hi Liam, <br /><br />Yes thats what I did. In the end, I found the simplest way to make a pretty gradient shaded tree was to use the writeAncestors() function, then pop the tree into FigTree. Not very elegant but it works!<br /><br />Cheers,<br /><br />BenBennoreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-40218087280075899862014-04-28T10:42:31.510-04:002014-04-28T10:42:31.510-04:00Hi Liam
I am running into the same problem as a f...Hi Liam<br /><br />I am running into the same problem as a few people commenting here, namely Error in tree$maps[[i]] <- XX[, 2] - XX[, 1] :<br /><br />I have tried all the solutions presented here, and none of them have worked. In addition, I have 3 trees and trait sets, all of which are sub-trees of one larger tree. One of these works fine with contMap, but the other two return the error I mentioned above. Also, the one that works has a polytomy in it and works without first using multi2di, the two that fail also have polytomies, yet fail.<br /><br />Any help would be appreciated!<br /><br />Henryanonhttps://www.blogger.com/profile/17199809021902056884noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-21133837904847600552014-04-17T21:23:53.716-04:002014-04-17T21:23:53.716-04:00Hi Ben.
Yes - I'd forgotten this myself, but ...Hi Ben.<br /><br />Yes - I'd forgotten this myself, but it looks like if mode="nodes" then the vector x should be in order of the node numbers in tree$edge - that means 1:N (for N tips) should be the tip values in order tree$tip.label, and (N+1):(N+m), for m internal nodes, should be the nodes in the order of tree$edge. Let me know if this makes sense!<br /><br />- LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-19322335754703327372014-04-14T04:53:43.153-04:002014-04-14T04:53:43.153-04:00Think I have figured this out:
traits need to be ...Think I have figured this out:<br /><br />traits need to be a vector of tip values AND node values, with node labeling following phytools, rather than ape naming.Bennoreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-55383837040415637862014-04-11T11:26:41.005-04:002014-04-11T11:26:41.005-04:00Ok, sorry for the multiple questions: now relating...Ok, sorry for the multiple questions: now relating to plotBranchbyTrait- how do the nodes need to be labelled in the vector of states: <br /><br />is it using makeNodeLabel from ape (start labeling nodes from 1 at root) <br /><br />or as in phytools when you <br />> plot(tree) <br />>nodelabels()<br />(start labeling at root from 1+no of tips). <br /><br />Have tried both of these but am getting an error message:<br />from:<br /><br />>plotBranchbyTrait(tree, test, mode="nodes")<br /><br />Error in while (p >= breaks[i] && p > breaks[i + 1]) i <- i + 1 : <br /> missing value where TRUE/FALSE needed<br /><br />Can get plotBranchbyTrait to work fine for tips...Thanks in advance,<br /><br />Ben<br /><br />BenBennoreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-43297541763458383102014-04-11T05:37:54.079-04:002014-04-11T05:37:54.079-04:00Thanks Liam,
Will check try plotBranchbyTrait. A...Thanks Liam, <br /><br />Will check try plotBranchbyTrait. An alt might be to associate ancestral state with node labels then plot with FigTree- but will be a bit awkward to do I think...Hope to see something along these lines implemented in phytools at somepoint in the future! <br /><br />Thanks, BenBennoreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-62752546097422770392014-04-09T12:29:37.716-04:002014-04-09T12:29:37.716-04:00Not presently, Ben. Great idea.
One of the proble...Not presently, Ben. Great idea.<br /><br />One of the problems is that contMap estimates the states along the edges of the tree (as well as at nodes). (It does this using an equation from Felsenstein to interpolate - but this is equivalent to what we would get at any intermediate point along the edge if we had a node there.) If you have ancestral state estimates from an alternative model of evolution, then interpolating in this way becomes invalid.<br /><br />One alternative is to use plotBranchByTrait & then just color each edge by the state at the parent or daughter node (or their arithmetic mean). This is not too difficult to do & you can probably find demos on the blog; however you lose the continuous color gradient of contMap.<br /><br />- LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-39652329981427473062014-04-09T12:15:10.422-04:002014-04-09T12:15:10.422-04:00I may be missing something obvious here, but is th...I may be missing something obvious here, but is there a way to use the very nice plotting function utilized in contMap to plot data for a tree where the states at nodes have already been estimated? Thanks! Bennoreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-50337232047984127452014-03-22T01:27:48.174-04:002014-03-22T01:27:48.174-04:00Actually Liam, solved it by increasing the res val...Actually Liam, solved it by increasing the res value. Please ignore the previous query.<br />cheersAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-86568246239367020152014-03-21T05:55:36.588-04:002014-03-21T05:55:36.588-04:00Hi Liam,
I seem to be running into the same issue ...Hi Liam,<br />I seem to be running into the same issue with contMap, I keep getting the 'Error in tree$maps[[i]] <- XX[, 2] - XX[, 1] :<br />more elements supplied than there are to replace' message. Increasing tol in multi2di doesn't seem to do the trick. Any other suggestions for how to solve this problem? Any insights appreciated.<br />cheersAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-23754655584712065102013-11-11T22:30:50.176-05:002013-11-11T22:30:50.176-05:00Thanks Liam for your prompt response
Adding this ...Thanks Liam for your prompt response<br /><br />Adding this line did the job<br /><br />phy.OU<-di2multi(phy.OU, tol=1e-01)<br /><br />Best,<br /><br />OscarOscarhttps://www.blogger.com/profile/00649299755038703971noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-82270989906297477582013-11-11T14:29:25.902-05:002013-11-11T14:29:25.902-05:00Hi Oscar. Try increasing tol in multi2di. tol is t...Hi Oscar. Try increasing tol in multi2di. tol is the shortest branch length that is considered to be "zero length".<br /><br />Eventually, I will fix this bug. Sorry for the inconvenience. Note if you plot the OU tree the branch lengths will be stretched according to your OU model, which you may not want.<br /><br />All the best, LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-39038701436675300322013-11-11T13:06:33.134-05:002013-11-11T13:06:33.134-05:00Hi Liam and Marcelo,
I am dealing with the same ...Hi Liam and Marcelo, <br /><br />I am dealing with the same error. <br /><br />Error in tree$maps[[i]] <- XX[, 2] - XX[, 1] : <br /> more elements supplied than there are to replace<br /><br />What I am doing here is first transform the branch lengths of a phylogeny using the alpha parameter I obtained from a OU fit. Then, I want to perform an ancestral state reconstruction. It is true that, the transformation with the OU alpha makes some internal nodes close to zero, but even using "di2multi" I keep obtaining the same error. Please can you post how you solve this problem?<br /><br />Many thanks, <br /><br />Regards, <br /><br />Oscar<br /><br />phy.OU<-transform(phylo, model="OU", 0.127)<br /><br />phy.OU<-di2multi(phy.OU)<br /><br />trait_ancestral<-contMap(phy.OU, trait.vec, res=100, lwd=1, outline=T, fsize= 0.3)<br /><br />Error in tree$maps[[i]] <- XX[, 2] - XX[, 1] : <br /> more elements supplied than there are to replace<br />Oscarhttps://www.blogger.com/profile/00649299755038703971noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-4595281039995703222013-10-17T14:02:29.651-04:002013-10-17T14:02:29.651-04:00OK..thanks!OK..thanks!Marcelo Cardillohttps://www.blogger.com/profile/18386895265822015929noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-79101569866825210092013-10-17T13:43:32.932-04:002013-10-17T13:43:32.932-04:00Hi Marcelo.
Not sure. Why don't you send me y...Hi Marcelo.<br /><br />Not sure. Why don't you send me your tree file and I will troubleshoot?<br /><br />All the best, LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-18124132914672045702013-10-17T13:22:42.571-04:002013-10-17T13:22:42.571-04:00This is true, my tree have some branches of 0 leng...This is true, my tree have some branches of 0 length. I modify It but I still but unsuccessfully <br /><br />b$edge.length[which(b$edge.length==0)]<-1e-6<br />> x<-fastBM(b)<br />> contMap(b,x)<br /><br />Error en tree$maps[[i]] <- XX[, 2] - XX[, 1] : <br /> se dan más elementos que los que pueden ser sustituídos<br />Marcelo Cardillohttps://www.blogger.com/profile/18386895265822015929noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-82782687632582800112013-10-17T11:46:51.859-04:002013-10-17T11:46:51.859-04:00Does your branch have any branches of zero length ...Does your branch have any branches of zero length or very short branches. This is known to cause a problem for the function. You can do:<br /><br />b<-di2multi(b)<br />contMap(b,x)<br /><br />Let us know if this solves the problem. If it doesn't it may be that you have very short internal edges or terminal edges (tip branches) of zero length. Very short internal edges you can set to zero and then use multi2di; short terminal edges you can lengthen to give slightly non-zero length, e.g.:<br /><br />tree$edge.length[which(tree$edge.length==0)]<-1e-6<br /><br />for example.<br /><br />- LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-54814014207389573022013-10-17T11:29:07.335-04:002013-10-17T11:29:07.335-04:00Dear Liam, I hace a problem when I tried to map co...Dear Liam, I hace a problem when I tried to map continuous character on my tree this is the ouput with the error message<br /><br /> b<br /><br />Phylogenetic tree with 10 tips and 9 internal nodes.<br /><br />Tip labels:<br /> CDM, a49, a40, a41, a42, a46, ...<br /><br />Rooted; includes branch lengths.<br /><br />> x<-fastBM(b)<br />> contMap(b,x,lwd=6, plot=T, type="phylogram", legend=T)<br />Error en while (x > trans[i]) { : <br /> valor ausente donde TRUE/FALSE es necesario<br /><br />What I'm doing wrong..?..thanks! Marcelo Cardillohttps://www.blogger.com/profile/18386895265822015929noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-34669829530307707202013-01-30T05:55:49.187-05:002013-01-30T05:55:49.187-05:00Hi Liam.
I'm wondering whether is it possible...Hi Liam. <br />I'm wondering whether is it possible to invert colours used in this function, e.g. the largest values red and the lowest values blue? It seems to me as a more logical way. I was trying to do it myself, as it seemed easy, just invert the scale of "cols", though I got stuck on "object 'getState' not found". Would you mind give me a clue what to do?<br />IvanaAnonymoushttps://www.blogger.com/profile/08569296941879130871noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-48339746047933552212012-11-09T09:41:43.481-05:002012-11-09T09:41:43.481-05:00Hi David. Not sure, but I have been thinking about...Hi David. Not sure, but I have been thinking about similar things. LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-77190062762680651032012-11-09T00:43:23.093-05:002012-11-09T00:43:23.093-05:00Hmm. Is there anyway to map uncertainty in a simil...Hmm. Is there anyway to map uncertainty in a similar way; maybe by smoothing out the range of per-node confidence intervals across the branches?dwbapsthttps://www.blogger.com/profile/17606476387441191531noreply@blogger.com