Extracting the mean phylorate plot number (PP) for a branch

43 views
Skip to first unread message

JET

unread,
Jul 29, 2022, 4:29:06 PM7/29/22
to bamm-project
Hi All,

I assume this is pretty simple; however, from the BAMMTools website, the RDocumentation, and here... I cannot find the answer I am looking for.

If we see the attached mean phylorate plot from <plot.bammdata(my_edata)> function I have some clades and branches along the phylogeny I want the rate shift number for certain taxa. **As a note, I believe these numbers are posterior probabilities (numbers transformed to a heat map color)**. 

In the plot, I want the numbers for several taxa to report, for example - Branchiostoma_floridae (mcra node 141). 

Is there a set of functions I can write up to get that rate shift number in the mean phylorate? The closest I found would be the <ratesHistogram()> function, but I cannot extract the exact taxon and/or clade I want nor the number specifically.

Thank you for your time.

Best,
James

Mean Phylorate Rplot.pdf

pasca...@gmail.com

unread,
Aug 4, 2022, 12:52:40 PM8/4/22
to bamm-project
Hi James,

As you are referring to the mean phylorate plot, are you trying to get the mean rate for particular branches? Or the mean rate at the present for a particular taxon? Or is it something else?

-Pascal

JET

unread,
Aug 5, 2022, 4:17:27 PM8/5/22
to bamm-project
Hi Pascal,

All would be good to have in my toolkit, to be honest. Specifically, my questions would be for both the mean rate for particular branches and the mean rate at the present for a particular taxon. Or even the mean rate for a set of particular branches at the present.

An example would be Branchiostoma floridae (mean rate at the present for a particular taxon). Also, the clade from Galeopterus variegatus to the chimpanzee [Primatomorpha] (mean rate for particular branches at that basal node or mean rate for particular branches at the present). I would like those numbers either at the tip(s) or, in the case of the groups, at the node for all those branches where the shift occurs. You would know the best practices for what I should do to report the mean rate numbers. Either at the tips, the node for specific groups, or a taxon where rates shift for the trait. My thought would be to report the mean rate at the present for a particular taxon. If it were a group, I would grab the mean rate probability at the node.

I hope that clarifies and doesn't muddy it more. Basically, from the heat colors, I observe a rate shift. I like to extract that number for either a group (in the case of Primatomorpha) or a single taxon (in the case of the Branchiostoma floridae) given what the plot color shows.

Thank you!

Best,
James

pasca...@gmail.com

unread,
Aug 8, 2022, 11:13:30 AM8/8/22
to bamm-project
Hi James,

You can use the function getMarginalBranchRateMatrix() to get the mean rate for each branch in your phylogeny. The function getTipRates() will return the present-time rate for each taxon in your tree. If you would like a single overall rate for a monophyletic group, you can use the function getCladeRates().

To know which rate goes with which branch, since your tree is not too large, you can plot branch numbers on your tree. First plot your tree with the ape package, then plot branch numbers with edgelabels(). Those numbers should correspond to the row numbers in the matrix returned by the getMarginalBranchRateMatrix() function.

I hope that helps!

-Pascal

JET

unread,
Aug 8, 2022, 12:22:00 PM8/8/22
to bamm-project
Fantastic. That is quite easy and straightforward. I did getMarginalBranchRateMatrix(), but didn't engage my brain enough to see exactly what I was observing. I appreciate you taking the time to help me out.

Best,
James

Reply all
Reply to author
Forward
0 new messages