[R-sig-phylo] interpreting PGLS results when lambda>1
Hi everyone, I have been running PGLS with gls from NLME and phyl.resid from PHYTOOLS. Most of my analyses are running well with no problems and give the same results in both packages. With just a few of my dependent variables, which happen to be evolutionary rates extracted from the program BAMM and the associated package BAMMtools, I get lambda values greater than 1 when using both gls and phyl.resid. I have read an older post that says that lambda can theoretically be >1, but I am wondering whether it is safe to interpret results from such PGLS analyses? If I constrain lambda to be 1 (instead of 1.0015, which gls and phyl.resid return when letting them optimize lambda) the results and p-values change considerably. Any advice or experience with how to proceed or interpret results in light of lambda greater than 1 would be greatly appreciated! Thanks for your time! Regards, Zach [[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] Unable to reorder any phylo object with reorder.phylo
Hi everyone, I seem to have an issue where I cannot get any trees (real data or simulated trees) to reorder. I've tried a lot of different things including updating packages, restarting R, using a different computer. My real trees have 501 tips, but I'm having this issue even when I simulate trees with just 25 or 50 tips. Currently using R 3.3.1 in Rstudio and APE 3.5. I also came across the trick of using: phy <- read.tree(text=write.tree(phy)) but that didn't seem to work either. The structure of the my phylo objects (my real trees and simulated trees) are fine when passed through checkValidPhylo. Ultimately, if it were just one tree I would do it in an outside program and just import the reordered tree, but I'm wanting to apply a reordering function across a multiphylo object. However, I can't seem to get a single tree reordered! I'm pasting some code below which is pretty boiler plate but *should* I believe work, but doesn't work for me. If anyone has any thoughts or advice, I would appreciate it. Thank you! #Simulate a single tree to test the reorder function tree1<-pbtree(n=500,scale=10,nsim=1) plot(tree1) #Reorder with pruningwise tree2<-reorder.phylo(tree1, "pruningwise") plot(tree2) Zach -- Zachary W. Culumber Postdoctoral Research Associate Kansas State University Division of Biology http://www.zwcresearch.com Coordinator Centro de Investigaciones Científicas de las Huastecas Aguazarca http://www.cichaz.org [[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] Unable to reorder any phylo object with reorder.phylo
Hi Liam, thanks for your message, Okay, I guess my objective is to order all of my nodes rather than edges either in ascending or descending order. It looks like ladderize will do this all at once rather than node by node with other commands. Thank you for pointing me towards that! In all of my googling since yesterday, ladderize never came across my radar. Cheers, Zach On Thu, Aug 11, 2016 at 11:09 AM, Liam Revell wrote: > Hi Zach. > > > > What is your objective here? reorder.phylo reorders the edges in the > “phylo” object, but does not usually change the order in which the tips are > plotted. For that, you should look at ape::rotate or phytools::rotateNodes > (I believe), ape::ladderize, or the argument tips in phytools::plotTree. > > > > All the best, Liam > > > > -- > Liam J. Revell, Associate Professor of Biology > University of Massachussetts Boston > email: liam.rev...@umb.edu > web: http://faculty.umb.edu/liam.revell > > Sent from Outlook Mail for Windows 10 phone > > > > *From: *Zach Culumber > *Sent: *Thursday, August 11, 2016 10:48 AM > *To: *r-sig-phylo@r-project.org > *Subject: *[R-sig-phylo] Unable to reorder any phylo object with > reorder.phylo > > > Hi everyone, > > I seem to have an issue where I cannot get any trees (real data or > simulated trees) to reorder. I've tried a lot of different things > including updating packages, restarting R, using a different computer. My > real trees have 501 tips, but I'm having this issue even when I simulate > trees with just 25 or 50 tips. Currently using R 3.3.1 in Rstudio and APE > 3.5. I also came across the trick of using: > > phy <- read.tree(text=write.tree(phy)) > > but that didn't seem to work either. The structure of the my phylo > objects (my real trees and simulated trees) are fine when passed > through checkValidPhylo. Ultimately, if it were just one tree I > would do it in an outside program and just import the reordered tree, > but I'm wanting to apply a reordering function across a multiphylo > object. However, I can't seem to get a single tree > reordered! I'm pasting some code below which is pretty boiler plate > but *should* I believe work, but doesn't work for me. If anyone has > any thoughts or advice, I would appreciate it. > Thank you! > > #Simulate a single tree to test the reorder function > > tree1<-pbtree(n=500,scale=10,nsim=1) > > plot(tree1) > > #Reorder with pruningwise > > tree2<-reorder.phylo(tree1, "pruningwise") > > plot(tree2) > > > Zach > > -- > Zachary W. Culumber > Postdoctoral Research Associate > Kansas State University > Division of Biology > http://www.zwcresearch.com > > Coordinator > Centro de Investigaciones Científicas de las Huastecas Aguazarca > http://www.cichaz.org > > [[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-ph...@r-project.org/ > -- Zachary W. Culumber Postdoctoral Research Associate Kansas State University Division of Biology http://www.zwcresearch.com Coordinator Centro de Investigaciones Científicas de las Huastecas Aguazarca http://www.cichaz.org [[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] mean phylogenetic distance for subsets of species from a tree
Hi everyone, I have a time-calibrated phylogeny with ~100 species and a list of ~1000 observed species assemblages which vary from 2-20 species in size. I'd like to get the mean phylogenetic distance among species in each assemblage, but I'm having difficulty finding a way to do this. The comm.phylo.cor command in picante throws an error in as.hclust.default(x), that x cannot be coerced to class hclust, and I've hit a dead end finding a solution to that error. I'm not sure whether comm.phylo.cor will do what I want even if it works. I wrote a loop to prune the phylogeny separately for each group of species, which can then theoretically be used to get the distances with cophenetic.phylo. However, as soon as I start to run cophenetic.phylo across my list of trees, R starts to hang up and freeze my entire computer even though my code is set to skip trees for which distance can't be measured. One time it managed run a few and gave a memory error (e.g., 6050235 Tb of memory is not available). But R freezes even when I try to run this on an 12 core mac. Does anyone have any other suggestions for how to get the mean phylogenetic distance for subsets of species on a tree? Thanks for any ideas! Zach -- Zachary W. Culumber Postdoctoral Research Associate Kansas State University Division of Biology [[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] mean phylogenetic distance for subsets of species from a tree
Yes, it looks like it! Thank you! Guess I was making it more complicated than it needed to be. Cheers, Zach On Thu, Feb 2, 2017 at 2:36 PM, Liam J. Revell wrote: > Hi Zach. > > Do you just mean the mean patristic distance among all pairwise > combinations of species in each assemblage? > > If you have your assemblages in a list of vectors, each containing the > species of the corresponding assemblage, I think you could do: > > library(ape) > D<-cophenetic(tree) > d<-sapply(assemblages,function(sp,D) mean(as.dist(D[sp,sp])),D=D) > > Does that work? > > All the best, Liam > > Liam J. Revell, Associate Professor of Biology > University of Massachusetts Boston > web: http://faculty.umb.edu/liam.revell/ > email: liam.rev...@umb.edu > blog: http://blog.phytools.org > > > On 2/2/2017 3:22 PM, Zach Culumber wrote: > >> Hi everyone, >> >> I have a time-calibrated phylogeny with ~100 species and a list of ~1000 >> observed species assemblages which vary from 2-20 species in size. I'd >> like to get the mean phylogenetic distance among species in each >> assemblage, but I'm having difficulty finding a way to do this. The >> comm.phylo.cor command in picante throws an error in as.hclust.default(x), >> that x cannot be coerced to class hclust, and I've hit a dead end finding >> a >> solution to that error. I'm not sure whether comm.phylo.cor will do what >> I >> want even if it works. >> >> I wrote a loop to prune the phylogeny separately for each group of >> species, >> which can then theoretically be used to get the distances with >> cophenetic.phylo. However, as soon as I start to run cophenetic.phylo >> across my list of trees, R starts to hang up and freeze my entire computer >> even though my code is set to skip trees for which distance can't be >> measured. One time it managed run a few and gave a memory error (e.g., >> 6050235 Tb of memory is not available). But R freezes even when I try to >> run this on an 12 core mac. >> >> Does anyone have any other suggestions for how to get the mean >> phylogenetic >> distance for subsets of species on a tree? Thanks for any ideas! >> >> Zach >> >> >> -- Zachary W. Culumber Postdoctoral Research Associate Kansas State University Division of Biology [[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] quantitative state dependent diversification of another quantitative trait
Hi everyone, We are interested in examining whether shifts in one continuous trait have preceded shifts in another continuous trait through evolutionary time for a phylogeny of ~80 species. To do this we were thinking of calculating the change in the value of each trait for each tip to its most recent ancestor (i.e., node) and then for each node to its most recent ancestral node. We have all the tip values and conducted ASR to get the node values. However, we are unaware of any functions or packages that would automate calculation of all these distances for teach tip and node to its most recent ancestor. Does anyone have any suggestions of functions or packages that might possibly do this? Alternatively, are there better existing options for exploring this question? I.e., something similar to QuaSSE but for analysis between two quantitative traits rather than traits and species diversification? Something like Bayes Traits or PGLS would allow tests of correlated evolution, but not the order of evolutionary shifts. Thank you for any insights! Zach [[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] quantitative state dependent diversification of another quantitative trait
Thank you Brian and Julien! Those packages do indeed make it easier to get at our question! Cheers, Zach On Wed, Apr 4, 2018 at 5:57 PM, Julien Clavel wrote: > Hi Zach, > > > > In addition to SLOUCH (for a OU tracking a BM process) you can use mvMORPH > for fitting a model where a trait evolving under an OU process follow > another trait evolving under OU with some evolutionary lag (see p. 14-15 of > the package vignette “How to use mvMORPH”). > > > > Best wishes, > > > > Julien > > -- > *De :* R-sig-phylo de la part de > Brian O'Meara > *Envoyé :* mercredi 4 avril 2018 22:39 > *À :* Zach Culumber > *Cc :* mailman, r-sig-phylo > *Objet :* Re: [R-sig-phylo] quantitative state dependent diversification > of another quantitative trait > > I think you want SLOUCH: Hansen et al. 2008: > https://onlinelibrary.wiley.com/doi/pdf/10./j.1558-5646.2008.00412.x. > One trait evolves under Brownian motion, another trait follows it. > > Best, > Brian > > ___ > Brian O'Meara, http://www.brianomeara.info, especially Calendar > <http://brianomeara.info/calendars/omeara/>, CV > <http://brianomeara.info/cv/>, and Feedback > <http://brianomeara.info/teaching/feedback/> > > Associate Professor, Dept. of Ecology & Evolutionary Biology, UT Knoxville > Associate Head, Dept. of Ecology & Evolutionary Biology, UT Knoxville > Associate Director for Postdoctoral Activities, National Institute for > Mathematical & Biological Synthesis <http://www.nimbios.org> (NIMBioS) > > > > On Wed, Apr 4, 2018 at 2:43 PM, Zach Culumber wrote: > > > Hi everyone, > > > > We are interested in examining whether shifts in one continuous trait > have > > preceded shifts in another continuous trait through evolutionary time > for a > > phylogeny of ~80 species. To do this we were thinking of calculating the > > change in the value of each trait for each tip to its most recent > ancestor > > (i.e., node) and then for each node to its most recent ancestral node. > We > > have all the tip values and conducted ASR to get the node values. > However, > > we are unaware of any functions or packages that would automate > calculation > > of all these distances for teach tip and node to its most recent > ancestor. > > Does anyone have any suggestions of functions or packages that might > > possibly do this? Alternatively, are there better existing options for > > exploring this question? I.e., something similar to QuaSSE but for > analysis > > between two quantitative traits rather than traits and species > > diversification? Something like Bayes Traits or PGLS would allow tests > of > > correlated evolution, but not the order of evolutionary shifts. > > > > Thank you for any insights! > > > > Zach > > > > [[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-ph...@r-project.org/ > > > > [[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-ph...@r-project.org/ > -- Zachary W. Culumber Postdoctoral Research Associate Florida State University Department of Biological Science http://www.zwcresearch.com [[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/