Two different people (Marcio Pie and a student whose name has somehow slipped my mind - please identify yourself!) independently suggested to me recently that I could use a similar approach to that employed when overlaying a posterior density map from stochastic mapping on a phylomorphospace to project time since the root of the tree onto a phylomorphospace. In theory, this would help overcome the difficulty that all temporal information about the phylogeny is lost when it is projected into morphospace.
Well, this is quite easy** (**that is, easy only because I've already programmed all the pieces in phytools) to do. Here's a hack using simulated data.
First let's load phytools & simulate tree & data:
Loading required package: phytools
> # simulate tree & data
> for(i in 1:nrow(H)) names(AA$tree$maps[[i]])<- round((H[i,1]+cumsum(AA$tree$maps[[i]]))/h*1000)
> # check to verify that temporal information is correct
> add.color.bar(2,AA$cols,title="time from the root", lims=c(0,h),digits=1)
Click where you want to draw the bar
The final step (add.color.bar(...)) is the biggest hack of all as it only works because I artfully positioned it close enough to the x axis so that the bottom legend text is hidden!
Try it out!
Very useful, thank you Liam! A nice addition could be to change the color vector to reflect the official geologic timescale RGB codes (https://engineering.purdue.edu/Stratigraphy/charts/rgb.html).ReplyDelete
Lars. The best way to do this in phytools would be to combine make.era.map and phylomorphospace a mapped character. (Actually, this is also a better way to create the plot I just showed.) - LiamDelete
Also - Lars, do you happen to have the start & end points (say, in mybp) of each of the named geological time periods and the RGB code in a text or .csv file? I would be very interested in that. Thanks! LiamDelete
Have been watching this with interest (although I don't know why I'm interested. So I can have a tree that goes from Darker Green to Less Dark Green? Stupid lower Paleozoic color choices... grumble...). Anyway, I don't have a csv, Liam, but you should be able to grab what you want from the table here pretty easily:ReplyDelete
Wiki's stuff is all based on the newest 2013 timescale.
David. I need name,start,end,color. Normally, I would assemble that myself - but it is grant writing time right now, so it'll have to wait until after Aug. 2. - LiamDelete
I'm happy to help compiling the data (unless David has already done it?). Thanks for looking into this!ReplyDelete
No, I haven't compiled it. I forgot all about this, since I have also been busy working on a proposal, too.ReplyDelete