shawnlaffan / biodiverse

A tool for the spatial analysis of diversity
http://shawnlaffan.github.io/biodiverse/
GNU General Public License v3.0
72 stars 19 forks source link

average relative phylogenetic endemism across 1000 trees #792

Open mariaguerrina opened 3 years ago

mariaguerrina commented 3 years ago

Hi all, I have a question (probably a silly one!): I would like to estimate the relative phylogenetic endemism on 1000 trees (they are random trees with the same species in) and as result I would like to have the average of the results of each tree. Is there a way to estimate it without selecting every time a different tree, downloading the single result and then calculating the average?

I hope my question is clear (not so sure about it!)

Cheers Maria

shawnlaffan commented 3 years ago

Hello Maria,

This is possible, but is not practical with the GUI if you are using your own trees.

If the random trees have the same topology as the original, but the names are simply shuffled across the tips then you can use a randomisation analysis that uses the rand_no_change model, but which shuffles the tree tips. In version 4 and above you can extract the mean of the trees using the SUMX_PHYLO_RPE2 and Q_PHYLO_RPE2 indices from the rand>>SPATIAL_RESULTS list (where rand is the name you specify for the randomisation output). See also the blog post about this and the documentation. Version 4 is yet to be released, but I can do a development release if you need to use this approach.

If the topologies differ then it can be done with a script. I can work one up if you need this approach.

Regards, Shawn.

mariaguerrina commented 3 years ago

Hi Shawn, thanks a lot for your reply! I would like to estimate RPE on endemic species of a small area of the European Alps. Not for all the studied species a phylogeny was present. For this reason, I started from the species-level time-calibrated global phylogeny (Smith and Brown 2018) and added random (to a pre-specified clade) the lacking species and pruning at the end the trees in order to retain only the studied species. In this way, I generated 1000 random trees, which mainly differ for the branches length. Now, on these 1000 random trees, I would like to estimate the RPE, having as final result an average and standard deviation of the results of each tree. I tried the randomisation analysis you proposed, but I'm not sure this lead to the result I would like to have.

Best Maria