lamho86 / phylolm

GNU General Public License v2.0
30 stars 12 forks source link

Best practices for phyloglm input phylogeny - ultrametric or not? #53

Open marybelsoto opened 2 years ago

marybelsoto commented 2 years ago

Hi there,

First time phyloglm user here, so apologies for my newbie questions!

  1. Following a previous question here about interpretation of alpha, I have rescaled my input phylogeny so that the total tree height = 1. I ran phyloglm and got alpha: 1.074347. I plugged alpha into the phylogenetic half-life equation and got t1/2 = 0.64518, which I interpret as there being phylogenetic signal in my trait of interest.

I repeated the analysis, but this time making the phylogeny ultrametric (chronos(tree, lambda = 0)). I got an alpha: 35.27635 and t1/2 = 0.01964906, which I think means the phylogenetic signal of my trait is much weaker?

Any advise on whether the input tree should be ultrametric or if non-ultrametric is OK?

  1. The default btol of 10 produced a warning. I followed advise from a previously posted question here and checked the minimum and maximum fitted values for the model (min(fitted.values(model1) and max(fitted.values(model1)), which were respectively 0.218906 and 0.7872614. Am I correct in thinking that it's OK to continue using btol = 10 as these values are between 0 and 1?

Many thanks in advance for any recommendations you might have!

cecileane commented 2 years ago
  1. The total tree height is well defined for an ultrametric tree. For an non-ultrametric tree, there could be multiple ways to assign a height to the tree, like the maximum distance from the root to a tip (maximum taken over all the tips), or the average, or something else. If some tips in your first tree (whose height is 1) are in fact at distance 0.3 from the root, then a half-life of 0.64518 is quite large, meaning that this tip hasn't had time to be pulled towards the optimum since the time at the root.

    For the analysis on your ultrametric tree, you need to re-calculate the height of this ultrametric tree, to compare it with a half-life t1/2 = 0.01964906. If the ultrametric tree height is still 1, then the phylogenetic signal seems to be much weaker on the ultrametric tree, indeed.

    Usually, we want branch lengths to be proportional to calendar time, so if your tips are contemporary species (as opposed to fossils for example) then it makes sense to calibrate your tree to make it ultrametric.

  2. Yes, I guess so. You can always try to increase the btol parameter and see if it makes a difference in your conclusions.

marybelsoto commented 1 year ago

Hi Cécile,

Many thanks for your helpful advise. I've now rescaled my ultrametric phylogenies to a total height of 1, and get alpha values ranging from 9.16 to 13.06, which I think warrants the use of phyloglm as opposed to glm. I also estimated Pagel's lambda using phylosig(method = "lambda", test = TRUE) which gave lambda = 0.93 and p-value < 0.001.

However, I am now puzzled by my results from phyloglm for a continuous predictor and a binary response. For context, there is uncertainty in the phylogenetic placement of 30% (~900 of 3270) of the species in my dataset, and so I'm running phyloglm using 100 different phylogenies (each with different placements for these 900 species) as an attempt to capture the effects of this uncertainty on model estimates. The issue is that the phylogenies produce a bimodal distribution of slopes (image attached) and intercepts slope

I haven't been able to pinpoint anything inherent to the phylogenies that would make them go into these two distinct groups, so I wonder if (a) there are in fact two model optima, or (b) the bimodality is an artifact. I re-ran analyses using pglmm_compare and did not see this bimodality in estimates, which only added to my confusion.

I also ran phyloglm adding a second (categorial) predictor, which produced a normal distribution of estimates. However, I remain concerned about the results from the simpler model with a single predictor.

Any thoughts or advise on this would be very much appreciated! Thanks in advance!