[R-sig-phylo] TreeTools limit on number of tips
Hi Martin and list members, Happy New Year. I'm trying to explore the phylogenetic tree space represented by a few thousands trees of ~2500 tips. The packages TreeTools and TreeDist, which hold the most advanced R functionality for such analysis (AFAIK) are limited to dealing with trees smaller than 500 tips, presumably due to memory requirements. So my first questions is: what could I do to bypass this limitation? Second, are there alternative packages for robust quantification of phylogenetic space (i.e. not Robinson-Foulds, see Smith 2022: https://academic.oup.com/sysbio/article/71/5/1255/6486431)? My fallback plan is either (1) to trim the trees to genus level and make do from there, or (2) split the trees taxonomically and somehow tally up the results from each sub-tree. Perhaps even better would be to do (2) and then prune out clades that show little between-tree variability before doing (1). Any comments on this plan are more than welcome. My current reviewers didn't respond well to "was not feasible due to computational limitations"... Many thanks in advance for any help or advice! Very best wishes for the new year, Roi [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] ancestral state reconstruction with a complex discrete trait
Hi Chris, I sent this message a few days ago but can't see any sign that it was received so trying again. Apologies if anyone ends up seeing both. To the question- in addition to the other (good) solutions given in this thread, both HiSSE (R package) and BayesTraits (stand alone software) can handle ASR of multi-level categorical traits. I have used BayesTraits with option "Multi" for ASRs of traits with 3 and 4 states. Can't remember any limitations on using it for traits that take a larger number of character states (but it was a while ago I admit). Using HiSSE, coding your response character should be fairly straightforward depending on the number of character states you're looking at. If you have a trait with 4 observed states as you mention, it seems to me that there is an implied assumption that transitions between "black" and "white" must go through either "gray" (mixed) or "black-and-white" (patched). In this case you can encode observed phenotypes as {00} ,{01}, {10}, {11} and disable transitions between any two states (e.g. between {01} and {10}) based on your biological model/hypotheses. The original HiSSE paper (Beaulieu & O'Meara 2016 Syst. Biol.) is very clear, there is a helpful online tutorial. Nakov, Beaulieu & Alverston (Evolution, 2019) was also useful to me. HTH, Roi [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] suspected error in hisse:::TransMatMakerMuHiSSE()
Hello again everyone, So I just ran the my code on version 1.9.18 and it still produces the same faulty output. As Daniel mentioned, it is very easy to fix manually until the next update comes. Sorry everyone for the inefficient messaging - I should have done the check before replying to Daniel. Take care all, Roi On Thu, 13 May 2021 at 20:42, roee maor wrote: > Dear Daniel, > > I understand from Jeremy that this issue has already been addressed in a > more recent version of the package, so I seem to have caused a fuss for no > reason. > Thanks for these suggestions though, and for the very quick response! > > All the best, > Roi > > On Thu, 13 May 2021 at 14:19, Daniel Caetano wrote: > >> Dear Roi and R-sig-phylo community, >> >> Thanks for your feedback! >> >> The "TransMatMakerMuHiSSE" as well as all other functions in the >> TransMatMaker family output matrices which you are free to edit before >> using it to run your analysis. You can add, subtract, and constrain >> parameters by changing the numeric indexes of the matrix. My suggestion is >> for you to modify the output matrix to fit your analyses at the moment. >> >> We will verify this and make sure that it is fixed if necessary. If >> changes are made, they will be pushed to github first and later made >> available in RCran when the new version of the package is released. Please >> check the github page "https://github.com/thej022214/hisse; for the >> development version of the hisse package. >> >> Cheers, >> >> Daniel Caetano >> >> > > -- > Roi Maor > School of Zoology, Tel Aviv University > Centre for Biodiversity and Environment Research, UCL > -- Roi Maor School of Zoology, Tel Aviv University Centre for Biodiversity and Environment Research, UCL [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] suspected error in hisse:::TransMatMakerMuHiSSE()
Hi all, I've been advised that this error was known and is already fixed in more recent versions of the package. Updating to the latest version (1.9.18) sorts this out. Apologies for the unnecessary posting. Best, Roi On Thu, 13 May 2021, 11:01 , wrote: > Send R-sig-phylo mailing list submissions to > r-sig-phylo@r-project.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://stat.ethz.ch/mailman/listinfo/r-sig-phylo > or, via email, send a message with subject or body 'help' to > r-sig-phylo-requ...@r-project.org > > You can reach the person managing the list at > r-sig-phylo-ow...@r-project.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of R-sig-phylo digest..." > > > Today's Topics: > > 1. suspected error in hisse:::TransMatMakerMuHiSSE() (roee maor) > > -- > > Message: 1 > Date: Wed, 12 May 2021 18:15:07 +0100 > From: roee maor > To: r-sig-phylo@r-project.org, Jeremy Michael Beaulieu > > Subject: [R-sig-phylo] suspected error in > hisse:::TransMatMakerMuHiSSE() > Message-ID: > z6...@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear Jeremy and list, > I'm running a bunch of evolutionary models using the package hisse v1.9.13, > and noticed some anomalous parameterisation. Specifically, I obtained > erroneous model specification when defining a muCID model with 4 hidden > states and varying among-state transition rates, i.e.: > > TransMatMakerMuHiSSE(hidden.traits=4, make.null = TRUE, cat.trans.vary = > TRUE) > this line should produce a matrix with 28 different rates, but instead > there are 27. > > This resulting matrix has 27 parameters instead of 28, and, perhaps more > importantly, the transition matrix specifies identity between two > transition rates against the user's specification. > > I located the error to line #318 of the source code, which should read > sub.mat17, sub.mat12, sub.mat5, sub.mat1)) > > instead of the current > sub.mat2, sub.mat17, sub.mat5, sub.mat1)) > > Having said that, I'd be very grateful for advice on how to patch the > source code without geopardising the correct functionality of this and any > other function in the package (I don't actually know how all this computer > thing works ;) Otherwise I'll just add a conditional correction in my code > until the next version is on CRAN. > > Cheers all, and stay safe, > Roi > > -- > Roi Maor > School of Zoology, Tel Aviv University > Centre for Biodiversity and Environment Research, UCL > > [[alternative HTML version deleted]] > > > > > -- > > Subject: Digest Footer > > ___ > R-sig-phylo mailing list > R-sig-phylo@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-phylo > > > -- > > End of R-sig-phylo Digest, Vol 160, Issue 1 > *** > [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
[R-sig-phylo] suspected error in hisse:::TransMatMakerMuHiSSE()
Dear Jeremy and list, I'm running a bunch of evolutionary models using the package hisse v1.9.13, and noticed some anomalous parameterisation. Specifically, I obtained erroneous model specification when defining a muCID model with 4 hidden states and varying among-state transition rates, i.e.: TransMatMakerMuHiSSE(hidden.traits=4, make.null = TRUE, cat.trans.vary = TRUE) this line should produce a matrix with 28 different rates, but instead there are 27. This resulting matrix has 27 parameters instead of 28, and, perhaps more importantly, the transition matrix specifies identity between two transition rates against the user's specification. I located the error to line #318 of the source code, which should read sub.mat17, sub.mat12, sub.mat5, sub.mat1)) instead of the current sub.mat2, sub.mat17, sub.mat5, sub.mat1)) Having said that, I'd be very grateful for advice on how to patch the source code without geopardising the correct functionality of this and any other function in the package (I don't actually know how all this computer thing works ;) Otherwise I'll just add a conditional correction in my code until the next version is on CRAN. Cheers all, and stay safe, Roi -- Roi Maor School of Zoology, Tel Aviv University Centre for Biodiversity and Environment Research, UCL [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
Re: [R-sig-phylo] Problem date consensus phylogeny
Hi Alina, I'm not entirely sure I understand the problem, but perhaps phangorn::maxCladeCred() could help? I have used at some point to summarize 100 posterior mammal trees, and got a binary ultrametric tree. Note that my input trees were also fully binary and ultrametric, so if your results may vary if that's not the case with your data. Hope I'm not missing the point completely, Roi [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
[R-sig-phylo] plotting geologic time scale on circular tree
Hi Jake, Liam and list, I have used function ring() in APE (see help for ape::phydataplot) to do this. It gives you full control over colours, transparency etc., but you'll have to manually specify the inner and outer radii of each 'donut'. >From my experience, block colours override the tree branches (the tree disappears if time scale is plotted subsequently), while plotting the time scale before plotting the tree makes it difficult to get the right proportionality between the time scale and the branch lengths. HTH, Roi [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
[R-sig-phylo] Error in split MuSSE analysis (diversitree::make.musse.split)
Dear list, I'm trying to use MuSSE (package diversitree, FitzJohn 2012) to test for associations between diversification rates and a 3-state (discrete) character. I ran make.musse() for models where same rates affect the whole tree. I used this code from the diversitree tutorial, which worked fine for most models: > lik <- make.musse(phy, states, 3, sampling.f=freq, strict=TRUE, control=list()) ## arguments details below > lik.base <- constrain(lik, lambda2 ~ lambda1, lambda3 ~ lambda1, mu2 ~ mu1, mu3 ~ mu1, q13 ~ 0, q21 ~ q12, q23 ~ q12, q31 ~ 0, q32 ~ q12) > p <- starting.point.musse(phy, 3) > fit.base <- find.mle(lik.base, p[argnames(lik.base)]) > lik.lambda <- constrain(lik, mu2 ~ mu1, mu3 ~ mu1, q13 ~ 0, q21 ~ q12, q23 ~ q12, q31 ~ 0, q32 ~ q12) ## the line above defines an alternative model to be tested against the null. > fit.lambda <- find.mle(lik.lambda, p[argnames(lik.lambda)]) Now I want to run a similar analysis using make.musse.split() so as to let rates vary between sections of the tree (based on the diversification shifts recovered by MEDUSA). However, I keep getting this error message: > lik.split <- make.musse.split(phy, states, 3, nodes=Nodes, split.t=Times, sampling.f=freq) Error in check.split(phy, nodes, split.t) : Invalid node specification - The values in Nodes are taken from the MEDUSA summary (MedusaSUM$break.pts). One of the nodes is the root node and another is a tip (I guess it means a shift along a terminal branch). I have tried omitting the root node and/or the tip, thinking their location at either end of the tree might be causing the problem. - Times is the same length as Nodes. I have tried specifying all '0's, all 'Inf', and several combinations thereof, like non-zero for the tip node and zero for the root etc. - freq is the different states' frequencies in the data. (3 elements that sum up to 1). - phy is a fully dichotomous, family-level phylogeny, so most tips have richness >1. - states is the same length and order as phy$tip.label. I'm running diversitree v0.9.8 in R v3.2.3 on a Windows10 machine. 1- My first question is what am I doing wrong with make.musse.split that gives the error? I searched the diversitree tutorial and help files, and of course google, but found nothing to help me solve this problem. 2- For standard MuSSE models (where lambda was constrained equal regardless of character, e.g.: > lik.lambda <- constrain(lik, lambda2~lambda1, lambda3~lambda1, q13 ~ 0, q31 ~ 0) > fit.lambda <- find.mle(lik.lambda, p[argnames(lik.lambda)]) find.mle() failed to return any output. Such lambda-constrained models were left to run for up to 13 hours (compared to <1min for models with unconstrained lambda) before terminating the process. The question here is what could make the algorithm fail there? In my mind it should theoretically be possible that multiple extinction rates result in a given richness pattern even if the speciation rate is equal for all character states. Any help will be greatly appreciated! Many thanks, Roi Maor PhD student Department of Zoology, Tel Aviv University, Tel Aviv, 6997801 Israel [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/