Re: [R-sig-phylo] Will phyloXML in R be useful?
Sounds like a good idea. Not sure if you’re reinventing the wheel or not. Sounds like something ROpenSci might support; see: https://github.com/ropensci/onboarding From: George Vega YonReply: George Vega Yon Date: December 12, 2017 at 4:13:59 PM To: Group R-sig-phylo Subject: [R-sig-phylo] Will phyloXML in R be useful? Hey, Right now, I'm working on a wrapper for jsPhyloSVG (a javascript library for visualizing phylogenetic trees on the web browser) in R, and just got to learn about the phyloXML format. Googling around and checking out this email list archives it seems that there's no support for this format in R. My question is: how useful do you think having this in R will be? I'm willing to write an R package to read/write trees in this format (done before with GEXF, which is for networks in general). But I just want to make sure that (1) this will be useful for the community, and (2) I'm not reinventing the wheel (is anybody working on this now?). What are your thoughts? Best, George G. Vega Yon +1 (626) 381 8171 http://ggvy.cl [[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/ [[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] Non Parametric PGLS
Sergio, You can fit a non-Gaussian phylo regression with MCMCglmm. HTH, Dan. On Jun 17, 2015, at 9:40 AM, Sergio Ferreira Cardoso sff.card...@campus.fct.unl.pt wrote: Hello all, I'm having a problem with a Multiple Regression PGLS analysis that I'm performing. The residuals are not normal and it's difficult to bring them to normality. In these cases, are there any alternatives to the linear model? I know that for non-phylogenetic analyses other models exist, but is there any alternative method for phylogenetic analysis? Thanks in advance. Best regards, Sérgio. -- Com os melhores cumprimentos, Sérgio Ferreira Cardoso. Best regards, Sérgio Ferreira Cardoso MSc. Paleontology candidate Departamento de Ciências da Terra - FCT /Universidade Nova de Lisboa Geociências - Universidade de Évora Lisboa, Portugal [[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 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] Standalone version of AWTY
What about using Tracer instead? It's well-maintained with quite recent versions. [[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] Phylogenetic regression with a trait homologous within lower taxonomic groups, but analogous between higher taxonomic levels
Fwd'ing to the list because I neglected to do so ...and in case others have something to add Original Message Subject: Re: [R-sig-phylo] Phylogenetic regression with a trait homologous within lower taxonomic groups, but analogous between higher taxonomic levels Date: Sun, 07 Jun 2015 19:13:42 -0700 From: Daniel Fulop dfulop@gmail.com To: David Labonte dl...@cam.ac.uk Hi David, You're correct that if you build phylogenies for each your 4 groups and then connect all 4 in a polytomy (i.e. with zero branch lengths) then you would get an appropriate tree to adjust for the effect of phylogenetic relatedness (shared evol. history) in your trait. In terms of the resulting matrix, as you suggest, you would have a block matrix (such as the one attached) with zeroes in the cells that specify trait covariance between species in different groups. If the trait evolved independently, i.e. is analogous, in flies and beetles then yes treat them as lacking trait phylogenetic covariance, just as between beetles and geckos, HTH, Dan. David Labonte wrote: Dear all, I have a data set on the size of a morphological trait, including representatives from very different groups (insects, frogs, lizards, spiders), and I am interested in its allometry, i.e. how its size changes with the weight of the animals. I started off with normal regression techniques, i.e. I treated the data points as independent, which is of course incorrect. I have good evidence that the allometry of the trait depends on the taxonomic level: the slope of the predicted relationship changes systematically from class to genus level. Now, I would like to correct for the dependence of the data introduced by relatedness. And here begins my problem: While the trait fulfils the same function across all taxa, it evolved independently several times. My, perhaps naive, question is: do I have to account for the relatedness with//respect/to the taxa/, or//with//respect/to the trait/ in question? If the trait was homologous across all taxa, this should be identical. However, it is not. For example, the trait is homologous within flies, beetles and geckos, but analogous between them. Now, should I treat flies more similar to beetles than to geckos (which seems intuitive), or should they be as unrelated to beetles as to geckos, given that the trait is analogous? As far as I understand phylogenetic generalised least squares, I construct a matrix to re-scale the residual error covariance structure, and the elements of this matrix are proportional to the branch length /shared /between two taxa. Thus, if the shared branch length is zero, the two taxa are effectively independent (is this interpretation actually correct?). If I attempted to build a tree based on the relatedness with respect to the trait, then my guess would be that first, I should build groups within which the trait is homologous, and second, all these groups should be connected directly to the root of my tree, so that their shared branch length is zero. Within these groups, I should be able to use the relatedness with respect to the taxa to create a reasonable tree topology. Would this procedure be horrifically wrong? If so, why, and are there reasonable alternatives? Thanks very much and best wishes David -- Daniel Fulop, Ph.D. Postdoctoral Scholar Dept. Plant Biology, UC Davis Maloof Lab, Rm. 2220 Life Sciences Addition, One Shields Ave. Davis, CA 95616 510-253-7462 dfu...@ucdavis.edu ___ 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] Constraining node values in an OUCH analysis
Thanks, Graham ...but I'm not the OP. I was just shooting off a quick lead without actually checking the specifics in case it was useful. [[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] Constraining node values in an OUCH analysis
Isn't at least some of this functionality in mvSLOUCH and/or geiger? ...it's definitely the case that mvSLOUCH can handle missing data at the tips, and I think fossil data can be incorporated in it and geiger as well. At least Slater 2013 has code for incorporating fossils in geiger or modified geiger functions. [[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] A perfect storm: phylogenetic trees, random effects and zero-inflated binomial data
MCMCglmm can definitely handle all of that. Post back here and/or at the R-sig-mixed-models list for help with priors and others stuff when you've got some code developed. Diederik Strubbe wrote: Dear all, I am struggling with analysing a dataset aimed at explaining invasion success of non-native species. At a country level, I need to relate invasion success (binomial: 0 for failed invasions, 1 for success) to socio-economic variables, taking into account - Phylogenetic relatedness among introduced species: including a phylogenetic tree - Country as a random effect - The fact that data are zero-inflated (most introductions fail). Any suggestions for R packages that can handle a binomial response variable, phylogenetic trees, random effects and zero-inflation? Thanks in advance, Diederik -- Daniel Fulop, Ph.D. Postdoctoral Scholar Dept. Plant Biology, UC Davis Maloof Lab, Rm. 2220 Life Sciences Addition, One Shields Ave. Davis, CA 95616 510-253-7462 dfu...@ucdavis.edu ___ 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] clade-specific release and radiate model?
to BM, but I would ideally still like compare standard models' fits (including OUwie models) to the fits of clade-specific release models. Any leads or suggestions would be much appreciated, especially about how to implement these clade-specific models with current tools or about how to roll my own. Thanks! Dan. -- Daniel Fulop, Ph.D. Postdoctoral Scholar Dept. Plant Biology, UC Davis Maloof Lab, Rm. 2220 Life Sciences Addition, One Shields Ave. Davis, CA 95616 ___ R-sig-phylo mailing list -R-sig-phylo@r-project.org mailto:R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive athttp://www.mail-archive.com/r-sig-phylo@r-project.org/ http://www.mail-archive.com/r-sig-phylo%40r-project.org/ -- Daniel Fulop, Ph.D. Postdoctoral Scholar Dept. Plant Biology, UC Davis Maloof Lab, Rm. 2220 Life Sciences Addition, One Shields Ave. Davis, CA 95616 510-253-7462 dfu...@ucdavis.edu mailto:dfu...@ucdavis.edu -- Daniel Fulop, Ph.D. Postdoctoral Scholar Dept. Plant Biology, UC Davis Maloof Lab, Rm. 2220 Life Sciences Addition, One Shields Ave. Davis, CA 95616 510-253-7462 dfu...@ucdavis.edu [[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] clade-specific release and radiate model?
Hi All, Do you know if there are any methods out there for fitting ecological release and release and radiate models that are clade-specific? That is, in which the change in mode (OU to BM) happens at the root of a clade instead of at specific time for the whole phylogeny (as in Slater 2013). As far as I know the closest out there are models in OUwie, say with a clade-specific second OU process with a very low alpha. However, I don't think that biologically OU is a good model for the trait and clade in question (though it is for the rest of the tree). I know that at the limit as alpha - 0 OU converts to BM, but I would ideally still like compare standard models' fits (including OUwie models) to the fits of clade-specific release models. Any leads or suggestions would be much appreciated, especially about how to implement these clade-specific models with current tools or about how to roll my own. Thanks! Dan. -- Daniel Fulop, Ph.D. Postdoctoral Scholar Dept. Plant Biology, UC Davis Maloof Lab, Rm. 2220 Life Sciences Addition, One Shields Ave. Davis, CA 95616 ___ 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] clade-specific release and radiate model?
Hi Brian, Thanks for your thoughtful response! Those are very good points about identifiability and penalization of the OU mean for the released clade. The censored model is an appealing approach, especially since the timing of the release along the (stem) branch leading to the released clade is unknown, and somewhat beside the point. In the case in question several novel morphological-mechanical structures had to evolve to enable the release, and whether those evolved gradually or not along the stem branch is an open question -- perhaps unknowable from analyzing extant taxa. In thinking about this a bit more, though, I think methods for an epoch release may be able to accommodate a clade-specific scenario, at least if the timing of the mode shift is specified using SIMMAP trees and not a shift-time parameter. Slater 2013 has R code associated with it that implements release models, and there's a multivariate implementation of release (and other mode shift) models in the new mvMORPH package (which is on CRAN, but not yet published as a manuscript as far as I can tell). In skimming Slater's code it doesn't seem to use SIMMAP trees. However, mvMORPH's shift specification can be done with SIMMAP trees, and I see no reason why its mvSHIFT function would care whether the shift is clade-specific or not. I'm cc'ing Graham and Julien to see if they have something to add. Regarding the use of mvSHIFT, I don't have multivariate data; hopefully that won't be a problem. Cheers, Dan. Brian O'Meara wrote: Hi, Daniel. It's a bit arguable whether as alpha - 0, OU - BM: I think it should, but IIRC in OUCH this doesn't happen, and that's a deliberate choice. That said, I think that an OU with alpha near zero would be ok for your question, though you might want to think about how to penalize parameters (that is, for that clade there'd be an OU mean parameter that is unidentifiable (alpha of zero, so no pull, so no evidence for it): should you count this as a parameter when doing model comparison? I'd argue no: you're doing OU with alpha of zero as a kludgy hack to treat it as BM). Another approach would be to resuscitate the censored model of O'Meara et al. 2006. Slice your tree on the edge leading to the released clade (I guess this truly releases the clade to roam free of its relatives) so you have the paraphyletic non-released set and the released clade as separate trees. Then you can try fitting the same or different models to the two trees. The downside of this is that you must use an additional ancestral state (at the MRCA of the released clade); the upside is that any weird changes happening on the edge leading to the released clade aren't in the model and so don't affect the fit (you could imagine that whatever led the clade to be ecologically released happened somewhere on the stem edge, but you don't know where, and it could be associated with a major single shift in your continuous trait, too). You could try an OU on the non-released tree (let's call this A) and an OU on the released clade (B), OU on A and BM on B, etc. The only practical difficulty with this is constraining the cases where A and B are supposed to have the same model: by default, optimization will happen separately in different trees, but you can create a wrapper function that calls OUwie.fixed() separately on A and B but with the same parameters and adds the likelihood and then optimize the parameters in this wrapper function. Hope this helps, Brian On Fri, May 29, 2015 at 2:02 AM, Daniel Fulop dfulop@gmail.com mailto:dfulop@gmail.com wrote: Hi All, Do you know if there are any methods out there for fitting ecological release and release and radiate models that are clade-specific? That is, in which the change in mode (OU to BM) happens at the root of a clade instead of at specific time for the whole phylogeny (as in Slater 2013). As far as I know the closest out there are models in OUwie, say with a clade-specific second OU process with a very low alpha. However, I don't think that biologically OU is a good model for the trait and clade in question (though it is for the rest of the tree). I know that at the limit as alpha - 0 OU converts to BM, but I would ideally still like compare standard models' fits (including OUwie models) to the fits of clade-specific release models. Any leads or suggestions would be much appreciated, especially about how to implement these clade-specific models with current tools or about how to roll my own. Thanks! Dan. -- Daniel Fulop, Ph.D. Postdoctoral Scholar Dept. Plant Biology, UC Davis Maloof Lab, Rm. 2220 Life Sciences Addition, One Shields Ave. Davis, CA 95616 ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org
Re: [R-sig-phylo] clade-specific release and radiate model?
Great! Thanks, Julien! Yeah, I was aware of make.simmap()... Cheers, Dan. Julien Clavel wrote: Hi Dan, Fitting models with two distinct modes of trait evolution is possible with the mvSHIFT function in mvMORPH. You just need to map on the tree the two clades (or selective regimes, groups... otherwise) of interest rather than two times periods. The mapping can easily be done using the make.simmap or the paintSupTree functions in phytools. The package handle both univariate and multivariate data. Best, Julien Date: Fri, 29 May 2015 08:27:31 -0700 From: dfulop@gmail.com To: omeara.br...@gmail.com CC: r-sig-phylo@r-project.org; julien.cla...@hotmail.fr; slat...@si.edu Subject: Re: [R-sig-phylo] clade-specific release and radiate model? Hi Brian, Thanks for your thoughtful response! Those are very good points about identifiability and penalization of the OU mean for the released clade. The censored model is an appealing approach, especially since the timing of the release along the (stem) branch leading to the released clade is unknown, and somewhat beside the point. In the case in question several novel morphological-mechanical structures had to evolve to enable the release, and whether those evolved gradually or not along the stem branch is an open question -- perhaps unknowable from analyzing extant taxa. In thinking about this a bit more, though, I think methods for an epoch release may be able to accommodate a clade-specific scenario, at least if the timing of the mode shift is specified using SIMMAP trees and not a shift-time parameter. Slater 2013 has R code associated with it that implements release models, and there's a multivariate implementation of release (and other mode shift) models in the new mvMORPH package (which is on CRAN, but not yet published as a manuscript as far as I can tell). In skimming Slater's code it doesn't seem to use SIMMAP trees. However, mvMORPH's shift specification can be done with SIMMAP trees, and I see no reason why its mvSHIFT function would care whether the shift is clade-specific or not. I'm cc'ing Graham and Julien to see if they have something to add. Regarding the use of mvSHIFT, I don't have multivariate data; hopefully that won't be a problem. Cheers, Dan. Brian O'Meara wrote: Hi, Daniel. It's a bit arguable whether as alpha - 0, OU - BM: I think it should, but IIRC in OUCH this doesn't happen, and that's a deliberate choice. That said, I think that an OU with alpha near zero would be ok for your question, though you might want to think about how to penalize parameters (that is, for that clade there'd be an OU mean parameter that is unidentifiable (alpha of zero, so no pull, so no evidence for it): should you count this as a parameter when doing model comparison? I'd argue no: you're doing OU with alpha of zero as a kludgy hack to treat it as BM). Another approach would be to resuscitate the censored model of O'Meara et al. 2006. Slice your tree on the edge leading to the released clade (I guess this truly releases the clade to roam free of its relatives) so you have the paraphyletic non-released set and the released clade as separate trees. Then you can try fitting the same or different models to the two trees. The downside of this is that you must use an additional ancestral state (at the MRCA of the released clade); the upside is that any weird changes happening on the edge leading to the released clade aren't in the model and so don't affect the fit (you could imagine that whatever led the clade to be ecologically released happened somewhere on the stem edge, but you don't know where, and it could be associated with a major single shift in your continuous trait, too). You could try an OU on the non-released tree (let's call this A) and an OU on the released clade (B), OU on A and BM on B, etc. The only practical difficulty with this is constraining the cases where A and B are supposed to have the same model: by default, optimization will happen separately in different trees, but you can create a wrapper function that calls OUwie.fixed() separately on A and B but with the same parameters and adds the likelihood and then optimize the parameters in this wrapper function. Hope this helps, Brian On Fri, May 29, 2015 at 2:02 AM, Daniel Fulop dfulop@gmail.com mailto:dfulop@gmail.com wrote: Hi All, Do you know if there are any methods out there for fitting ecological release and release and radiate models that are clade-specific? That is, in which the change in mode (OU to BM) happens at the root of a clade instead of at specific time for the whole phylogeny
[R-sig-phylo] Is it okay to model species as a fixed effect in an LMM while also accounting for phylogenetic covariance?
Hi All, I have a question about the appropriateness of modeling species as a fixed effect in a mixed effect model while also accounting for phylogeny with a phylogenetic covariance random effect. My aim is to compare the growth rates of 10 species in 2 temperatures. I am using MCMCglmm and have fit the following model: stemLen ~ poly(day,2,raw=TRUE)*trt*spp , random=~ us(1+poly(day,2,raw=TRUE)):ID + phylo, rcov=~units ...where day is a numeric var. of days 1 - 12, trt is the temperature treatment, and spp is the species factor. I am comparing average slopes in days 1 - 10. I've got good inferences from the above model and used both the gelman.prior() function for fixed effects and parameter expanded priors for the random effects to improve mixing. My question is whether it's acceptable to model species as a fixed effect, as above, in a phylogenetic mixed effect regression. I think species is usually modeled as a random effect in such models. However, since my aim is to compare species growth rates it made more sense to me to model species as a fixed effect. Moreover, I found that models with species as a fixed effect are better fit by a long shot according to both DIC (from MCMCglmm) and AIC (from an lmer model w/o phylogeny). Thanks in advance for your feedback!! Dan. -- Daniel Fulop, Ph.D. Postdoctoral Scholar Dept. Plant Biology, UC Davis Maloof Lab, Rm. 2220 Life Sciences Addition, One Shields Ave. Davis, CA 95616 [[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] fit Discrecte function of Geiger package
Hi Beatriz, These are messages related to optimization, as you likely surmised. It might be okay. What's the convergence flag in the output of fitDiscrete? If it's zero (i.e. it successfully converged) then it's okay. Others with more expertise will probably chime in... HTH, Dan. Beatriz Guzm�n wrote: Hi all: I am using the geiger package to estimate the phylogenetic signal of one discrete trait. I would like to compare the negative log likelihood when there is no signal (using a tree transformed lambda=0)to that when lambda was estimated using the original tree topology using a likelihood ratio test. However, I have a problem when estimating lambda using the original tree topology. *What I am doing is this:* mytree-read.nexus(MCC.nex) mydata-read.csv(DataPhySig.csv) col-mydata$Colour names(col)-mydata$SP col_lambda- fitDiscrete(mytree, col, transform=lambda) *And this is the error I get:* DLSODA- Warning..Internal T (=R1) and H (=R2) are such that in the machine, T + H = T on the next step (H = step size). Solver will continue anyway. In above message, R1 = 0, R2 = 0 DINTDY- T (=R1) illegal In above message, R1 = 7.42108e-219 T not in interval TCUR - HU (= R1) to TCUR (=R2) In above message, R1 = 0, R2 = 0 DINTDY- T (=R1) illegal In above message, R1 = 8.94663e-219 . The analysis estimates a negative logLikelihood but I'm not sure whether I could trust the value. Has anyone experienced this problem before? I would be very pleased whether someone could help me to solve it. Thanks Teresa [[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/ -- Daniel Fulop, Ph.D. Postdoctoral Scholar Dept. Plant Biology, UC Davis Maloof Lab, Rm. 2220 Life Sciences Addition, One Shields Ave. Davis, CA 95616 510-253-7462 dfu...@ucdavis.edu [[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] Replacement of Phybase - species tree from gene trees
Hi, Just a quick suggestion. You could install the archived version of phybase in order to look at the R code for your function(s) of interest and then reuse that code directly in your own R scripts (or put them in separate scripts and source them). You can also then further taylor those functions to suit your needs. This gets around the issue of using an old package version, but the minor downside that maintaining the functions' code is then up to you. HTH, Dan. [[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] Phylogenetic signal in MCMCglmm
Dear R-sig-phylo list, I'm following up on a, seemingly unaddressed question from August 2013 about whether or not MCMCglmm co-estimates Pagel's lambda within a phylogenetic regression. Seraina's original message is copied at bottom. From what I can tell MCMCglmm doesn't co-estimate lambda, but perhaps I'm missing something. If it does, then I would like to know how to specify that lambda be co-estimated. I have a complicated model with random effects apart from accounting for phylogeny that is unable to be fit by lme(); I get an optimization error when trying to include corPagel(fixed=FALSE) within the lme() call, whether I specify the non-phylogenetic random effects by formula or with pdMat constructors. I'm analyzing plant growth of 10 species in 2 temperatures (control and cold) over a timeline, where I have several plants per species and daily measurements over 12 days; my model is (following lme4 formula syntax): plant_height ~ day * temp * species + (day | ID) My goal is to estimate/predict a growth rate for each species (while accounting for daily variation/noise in growth rate at the individual plant level = hence the day | ID random effect term) to then compare the growth rates in cold versus control temperatures for each species ...to then assess which species seems most cold tolerant as measured by growth rate difference (cold - control) and relative growth rate (cold / control). As an aside, I've fit the model without random effects but with corPagel(fixed=FALSE)in gls() and lambda is estimated as equal to zero or effectively so, depending on whether the starting value is 0 or not. Likewise, I've fit the full mixed model without the phylogeny with lme() and lmer() and then analyzed the phylogenetic signal of the residuals with phylosig() in phytools and again lambda is estimated as equal to 0. So, perhaps I shouldn't worry about fitting a phylogenetic regression in this particular case. However, I have similar data from this and other experiments and so it would be ideal to find a robust way of running a phylogenetic mixed model regression with co-estimation of lambda, i.e. a way that doesn't lead to an optimization error. Perhaps MCMCglmm offers that? Thanks in advance for any input you could provide as to MCMCglmm and phylogenetic signal! Cheers, Dan. -- Daniel Fulop, Ph.D. Postdoctoral Scholar Dept. Plant Biology, UC Davis Maloof Lab, Rm. 2220 Life Sciences Addition, One Shields Ave. Davis, CA 95616 Original message from Seraina Graber: Dear MCMCglmm users, I am running a simple model corrrecting for phylogenetic relationships using MCMCglmm. Now I am interested in the phylogenetic signal, the analogue to Pagels lambda. Now I have two questions: 1.) According to Hadfield and Nakagawa (2010) the analogue to lambda (Pagel) in the mixed model approach is var(phylo)/var(phylo)+var(residuals), however, in another conversation about pyhlogenetic signal in MCMCglmm I found that actually var(phylo)/var(phylo)+var(residuals)+var(random effects) is the right measurement for the phylogenetic signal. But isnt the var(phylo) and var(random effects) basically the same, cos actually the pyhlogeny is the random effect in such a model? so for me rather var(phylo)/var(phylo) + var(residuals) makes more sense. My model: MCMCglmm(Y ~ X random=~animal, data= pedigree=phylotree, pr=F, saveX=F, pl=T), X and Y are two continuous variables. 2.) Comparing to the PGLS function in caper, there the variance-covariance matrix is adjusted for the strength of the phylogenetic signal (estimated lambda scales the off-diagonals of the phylogenetic vcv matrix). Is that somehow done in the MCMCglmm approach? if yes, how? For any help I am very grateful. Cheers, Sereina ___ 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] Phylogenetic signal in MCMCglmm
Hi Shinichi, Thanks so much for the prompt and detailed response. I should've reread some of that literature before writing to the list-serv. So, what I am gathering from your answer is that it is unnecessary to co-estimate lambda and transform the tree's branch lengths by it, since lambda is implicitly always co-estimated. Hence if var(phylo) is inferred to be very small in absolute value and/or very small in proportion to the total random effect + residual variance, then lambda would be very close to zero. In any case, I'll have to do some reading to understand why the branch length transformation using lambda (or kappa or delta for that matter) that is done in the ML context isn't necessary in the Bayesian context in MCMCglmm. Perhaps it's something related to a different parameterization that makes it more computationally tractable in ML, i.e. that optimizing lambda (to infer how much variance is accounted for by the phylogeny) is easier than optimizing var(phylo) while also optimizing var(residuals) and the other random effects. Maybe optimizing lambda isn't computationally easier, but simply a different way to achieve the same goal? Thanks again, Dan. Shinichi Nakagawa wrote: Hi, Daniel lamda and H^2 are equivalent as we say in Hadfield and Nakagawa (2010) or said also in Housworth et al (2004) Housworth E, Martins E, Lynch M (2004) The phylogenetic mixed model. Am Nat 163(1):8496. lamda = var(phylo)/(var(phylo)+var(residuals)) A mathematical proof of this is in Hansen and Orzack 2005 Hansen TF, Orzack SH (2005) Assessing current adaptation and phylogenetic inertia as explanations of trait evolution: the need for controlled comparisons. Evolution 59(10):20632072 More general verison of H^2 or lamda is lamda = var(phylo)/(var(phylo)+var(all other random effects + residuals)) (probably not including measurment errors) Best wishes, Shinichi On 24/07/2014, at 10:51 am, Daniel Fulop dfulop@gmail.com mailto:dfulop@gmail.com wrote: Dear R-sig-phylo list, I'm following up on a, seemingly unaddressed question from August 2013 about whether or not MCMCglmm co-estimates Pagel's lambda within a phylogenetic regression. Seraina's original message is copied at bottom. From what I can tell MCMCglmm doesn't co-estimate lambda, but perhaps I'm missing something. If it does, then I would like to know how to specify that lambda be co-estimated. I have a complicated model with random effects apart from accounting for phylogeny that is unable to be fit by lme(); I get an optimization error when trying to include corPagel(fixed=FALSE) within the lme() call, whether I specify the non-phylogenetic random effects by formula or with pdMat constructors. I'm analyzing plant growth of 10 species in 2 temperatures (control and cold) over a timeline, where I have several plants per species and daily measurements over 12 days; my model is (following lme4 formula syntax): plant_height ~ day * temp * species + (day | ID) My goal is to estimate/predict a growth rate for each species (while accounting for daily variation/noise in growth rate at the individual plant level = hence the day | ID random effect term) to then compare the growth rates in cold versus control temperatures for each species ...to then assess which species seems most cold tolerant as measured by growth rate difference (cold - control) and relative growth rate (cold / control). As an aside, I've fit the model without random effects but with corPagel(fixed=FALSE)in gls() and lambda is estimated as equal to zero or effectively so, depending on whether the starting value is 0 or not. Likewise, I've fit the full mixed model without the phylogeny with lme() and lmer() and then analyzed the phylogenetic signal of the residuals with phylosig() in phytools and again lambda is estimated as equal to 0. So, perhaps I shouldn't worry about fitting a phylogenetic regression in this particular case. However, I have similar data from this and other experiments and so it would be ideal to find a robust way of running a phylogenetic mixed model regression with co-estimation of lambda, i.e. a way that doesn't lead to an optimization error. Perhaps MCMCglmm offers that? Thanks in advance for any input you could provide as to MCMCglmm and phylogenetic signal! Cheers, Dan. -- Daniel Fulop, Ph.D. Postdoctoral Scholar Dept. Plant Biology, UC Davis Maloof Lab, Rm. 2220 Life Sciences Addition, One Shields Ave. Davis, CA 95616 Original message from Seraina Graber: Dear MCMCglmm users, I am running a simple model corrrecting for phylogenetic relationships using MCMCglmm. Now I am interested in the phylogenetic signal, the analogue to Pagels lambda. Now I have two questions: 1.) According to Hadfield and Nakagawa (2010) the analogue to lambda (Pagel) in the mixed model approach is var(phylo)/var(phylo)+var(residuals
[R-sig-phylo] phylogenetic multiple regression of plant growth
Dear All, I am considering how best to account for phylogeny in plant growth regressions with one numeric and two categorical predictors. I am initially trying to use nlme functions lme() or gls(), but I am open to other software solutions; I do have one non-phylogenetic random effect to deal with possible spatial variance within the plant growth chamber, but it accounts for very little variance. I have daily growth measurements (stem, root, and number of leaves) for a set of species under control and cold conditions. I will be modeling the three response variables (i.e. stem and root lengths, and number of leaves) separately. The fixed effect part of my linear model is, e.g.: stemLength ~ day * treatment * species. I am then using the regression-predicted means to compare the absolute and relative growth rates of each species under control and cold temperatures. In case it's not clear, day is the numeric predictor and treatment and species the categorical (i.e. factor) ones. In order to incorporate within species variation, I was going to use zero branch length polytomies as in this post from Simon Blomberg: https://stat.ethz.ch/pipermail/r-sig-phylo/2008-November/000206.html. However, since I not only have multiple individuals per species but also multiple (i.e. daily) measurements per individual I am not sure if it is appropriate to deal with the multiplicity of measurements this way. Say I have a species for which 8 individuals in each of 2 conditions were measured for 10 days, that makes for 160 measurements. Thus, I would have to graft onto this species' tree branch a 160 branch polytomy with zero branch lengths. However, I am not sure that this would be an appropriate way of implicitly modelingresidual variance in growth rate *between days* (within and among individuals) or between control and cold treatments. Any suggestions are most welcome, whether it's reassurance that the polytomy method is okay to use in this case or advice about how to better deal with between day and between treatment residual variance. ...or an entirely different way of running these regressions. Thanks! Dan. -- Daniel Fulop, Ph.D. Postdoctoral Scholar Dept. Plant Biology, UC Davis Maloof Lab, Rm. 2220 Life Sciences Addition, One Shields Ave. Davis, CA 95616 ___ 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] Pairwise tree distance matrix
Hi Ross, What about Dendropy? It has several tree distances measures implemented, and can be easily scripted in Python (easy to use even without much knowledge of the language). See http://pythonhosted.org/DendroPy/tutorial/treestats.html, section 3.3.10 at the bottom. HTH, Dan. Daniel Fulop, Ph.D. Postdoctoral Scholar Dept. Plant Biology, UC Davis Maloof Lab, Rm. 2119 Life Sciences Addition, One Shields Ave. Davis, CA 95616 530-752-8086 dfu...@ucdavis.edu On Sep 21, 2013, at 3:00 AM, r-sig-phylo-requ...@r-project.org 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. Re: Pairwise tree distance matrix (Ross Mounce) -- Message: 1 Date: Fri, 20 Sep 2013 11:25:47 +0100 From: Ross Mounce rcp...@bath.ac.uk To: r-sig-phylo@r-project.org Subject: Re: [R-sig-phylo] Pairwise tree distance matrix Message-ID: 20130920112547.688b9dda2fb3288faaa34...@bath.ac.uk Content-Type: text/plain; charset=UTF-8 Hi Rob, Dave Bapst kindly brought this to my attention. I have a few suggestions for calculating pairwise RF distances between trees. (Apologies if I don't exactly answer the original question) 1.) Firstly, I have to say, the very fastest solutions lie in implementations currently outside of R e.g. MrsRF. So if speed is vital I'd build a workflow around this, it's extremely quick at all the all-to-all tree-to-tree calculations I've tried it with: * Matthews, S. and Williams, T. 2010. MrsRF: an efficient MapReduce algorithm for analyzing large collections of evolutionary trees. BMC Bioinformatics 11:S15-9. 2.) If you're looking for broad solutions (measuring tree distance with a variety of measures, not just Robinson-Foulds) I'd recommend TreeCmp as that does a wide variety of them: * Bogdanowicz, D., Giaro, K., and Wrobel, B. 2012. TreeCmp: Comparison of trees in polynomial time. Evolutionary Bioinformatics pp. 475+. Sidenote: whilst being the computationally quickest and most commonly-used, I'm sure both 'biologically' and in terms of discriminatory power Robinson-Foulds is NOT the most optimal measure of tree-tree distance (but hey, that won't stop people using it exclusively...). 3.) I built a kludgy workflow myself from TNT - R to better automate the taxon-jackknifing tests first performed in: Cobbett, A., Wilkinson, M., and Wills, M. 2007. Fossils impact as hard as living taxa in parsimony analyses of morphology. Systematic biology 56:753-766. So if by chance you're doing these all-to-all tree distance calculations to get at the mean-minimum tree distances between 2 different sets of trees you might want to peruse my code which is here on github: https://github.com/rossmounce/extinct_extant_chapter (see the diagram for a visual explanation) It's not the fastest or most elegant implementation possible... but it works. (Apologies if this last option is not relevant to your use-case) Best, Ross -- Forwarded message -- From: Rob Lanfear rob.lanf...@gmail.com Date: Thu, Sep 19, 2013 at 4:41 PM Subject: [R-sig-phylo] Pairwise tree distance matrix To: r-sig-phylo r-sig-phylo@r-project.org Hi All, I'm looking for a method to calculate a pairwise distance matrix of RF distances between a set of trees. Specifically, I know it's possible to do this in linear time (relative to the number of taxa), using an algorithm proposed in 1985[1]. This algorithm is implemented in various places (e.g. TreeSetVis in Mesquite), but I couldn't find an implementation in R. If anyone knows of an implementation, or has ideas on where best to start building one, please let me know. Cheers, Rob [1] Day,W. H. E. 1985. Optimal algorithms for comparing trees with labeled leaves. J. Classi?cation 2:7?28. -- Rob Lanfear Research Fellow, Ecology, Evolution, and Genetics, Research School of Biology, Australian National University -- -/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/- Ross Mounce PhD Student (writing-up now!) Fossils, Phylogeny and Macroevolution Research Group University of Bath, 4 South Building, Lab 1.07 Systematics Association Council Member http://about.me/rossmounce -- ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig