Is the "height" attribute in metacomments of an annotated tree a height of a node in a target tree?

66 views
Skip to first unread message

Pavel Rinkman

unread,
Nov 30, 2022, 8:24:14 PM11/30/22
to beast-users

Hello, everyone

I would like to resolve the ambiguity I got with annotated trees. I have noted that edge lengths per se (after a colon in NEXUS format) and those in metacomments [...,length="123.456789",...] are different. The tree was generated with the mean common ancestor height option to evade artifactual negative edges, so there is a question: what are aggregated heights? “height” attributes in metacomments or specified as usual after a colon?

I have glimpsed at the source code and concluded that “height” & “length” attributes in metacomments describe a target tree, whereas usual branch lengths of the NEXUS format correspond to mean common ancestor heights.

Am I right? Please, could you help with this uncertainty?

Best wishes,
Pavel


Alexei Drummond

unread,
Dec 6, 2022, 6:45:28 PM12/6/22
to beast-users
Hi Pavel,

Common use of TreeAnnotator follows a two step process: (1) select a good representative tree from the sample (the target tree), (2) annotate the target tree with average statistics from the full sample.

One of the main statistics that we want to get a sample average of are the divergence times. The mean common ancestor age (height) for each clade in the target tree is calculated by finding the most recent common ancestor of the taxa in that clade in each of the sampled trees and then taking the arithmetic average of the MRCA divergence times. This will be the value from which the Newick branch lengths are derived in the annotated target tree. I believe that your observation of differences between the newick branch lengths and the attributes in metacomments does arise because the metacomments contain some information from the original target tree.

Cheers
Alexei


--
You received this message because you are subscribed to the Google Groups "beast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beast-users/4b616739-0a4b-4c98-a09e-9da1eb2f3199n%40googlegroups.com.

Pavel Rinkman

unread,
Dec 8, 2022, 5:12:42 PM12/8/22
to beast-users

Hello, Alexei!

Thank you for the answer!

I got what CA height means. I just needed clarification on metacomments and whence they take their values. By now, I have compared the results of the treeannotator from the first BEAST amongst all height parameter values and with the second BEAST version ones. Values after the colon depend on the height parameter, so it is a CA height in my case. Howbeit, they all have the same values in height & length, and those values have nothing to do with the target tree. What do those values mean?

BEAST 1, ca height:

463[&
    length_range={2.273739479025,45.77298053424},
    rate_95%_HPD={4.374477857461107E-4,5.765733495926006E-4},
    length_95%_HPD={8.234319310683,31.17533722059},
    length=18.861277927870717,
    height_median=20.505022467077183,
    rate_range={3.7993398897165153E-4,6.504949716489248E-4},
    height_range={20.001848149893718,20.999582965165416},
    height_95%_HPD={20.04963315009502,20.992145711724405},
    rate=5.06227861038862E-4,
    location1=37.014968930887676,
    location2=127.32282737910796,
    rate_median=5.054122737707999E-4,
    length_median=18.57732943111,
    height=20.513703215883567
]:19.529153733601866

BEAST 1, mean height:

463[&
    length_range={2.273739479025,45.77298053424},
    rate_95%_HPD={4.374477857461107E-4,5.765733495926006E-4},
    length_95%_HPD={8.234319310683,31.17533722059},
    length=18.861277927870717,
    height_median=20.505022467077183,
    rate_range={3.7993398897165153E-4,6.504949716489248E-4},
    height_range={20.001848149893718,20.999582965165416},
    height_95%_HPD={20.04963315009502,20.992145711724405},
    rate=5.06227861038862E-4,
    location1=37.014968930887676,
    location2=127.32282737910796,
    rate_median=5.054122737707999E-4,
    length_median=18.57732943111,
    height=20.513703215883567
]:15.321963545288028

BEAST 2, ca height (this is the same node, treeannotator from the second BEAST change the order of taxa in the Translate block):

462[&
    CAheight_95%_HPD={20.04963315009502,20.992145711724405},
    CAheight_mean=20.513703215883567,
    CAheight_median=20.505022467077183,
    CAheight_range={20.001848149893718,20.999582965165416},
    height=20.513703215883567,
    height_95%_HPD={20.04963315009502,20.992145711724405},
    height_median=20.505022467077183,
    height_range={20.001848149893718,20.999582965165416},
    length=18.861277927870713,
    length_95%_HPD={8.234319310683006,31.175337220590002},
    length_median=18.57732943111,
    length_range={2.2737394790249965,45.77298053423999},
    location={37.01496893090549,127.32282737904512},
    location1=37.014968930887676,
    location2=127.32282737910796,
    rate=5.06227861038862E-4,
    rate_95%_HPD={4.374477857461107E-4,5.765733495926006E-4},
    rate_median=5.054122737707999E-4,
    rate_range={3.7993398897165153E-4,6.504949716489248E-4}
]:19.529153733601866

A part of the tree both treeannotators chose:


= [&R] ((((((463[&rate=4.548446262540928E-4,location={37.01496893090549,127.32282737904512}]:2.352239882903E1,

As seen obviously, a length from the target tree does not coincide with values in metacomments.

Best regards,
Pavel

среда, 7 декабря 2022 г. в 02:45:28 UTC+3, alexei....@gmail.com:

Alexei Drummond

unread,
Dec 8, 2022, 5:22:44 PM12/8/22
to beast-users
It seems like height == CAheight_mean in your BEAST 2 example. Isn’t that what you would expect if you choose common ancestor heights in TreeAnnotator? 

Pavel Rinkman

unread,
Dec 8, 2022, 7:38:35 PM12/8/22
to beast-users

I am sorry for my inattention; I did not notice this. But this confuses me more.

Since, firstly, there are neither prefixes nor postfixes specifying which height or length is meant, so this is unexpected behaviour, in my honest opinion. But, as a common user, I have thought about the target tree before. Moreover, we get this height not only in the case with the ca parameter but in all other cases.

Secondly, if the “just” height is CA height mean, length should be either an appropriate length corresponding to the given height (in this case, the length after the colon should be the same, provided that the treeannotator height parameter is ca; however, they differ: 18.861… versus 19.529…) or mean length subtending CA node in the posterior tree sample. Is it the latter?

Really thank you very much for trying to clarify the situation! I would like to use correct values in my further reconstruction.


пятница, 9 декабря 2022 г. в 01:22:44 UTC+3, alexei....@gmail.com:
Reply all
Reply to author
Forward
0 new messages