Skip to content

Commit 1e73968

Browse files
hyanwongpetrelharp
authored andcommitted
Add note about using divergence/diversity for mrcas
1 parent 141eef0 commit 1e73968

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

python/tskit/trees.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,15 @@ def tmrca(self, u, v):
10381038
10391039
>>> tree.time(tree.mrca(u, v))
10401040
1041+
.. note::
1042+
If you are using this method to calculate average tmrca values along the
1043+
genome between pairs of sample nodes, for efficiency reasons you should
1044+
instead consider the ``mode="branch"`` option of the
1045+
:meth:`TreeSequence.divergence` or :meth:`TreeSequence.diversity` methods.
1046+
Since these calculate the average branch length between pairs of sample
1047+
nodes, for samples at time 0 the resulting statistics will be exactly
1048+
twice the tmrca value.
1049+
10411050
:param int u: The first node.
10421051
:param int v: The second node.
10431052
:return: The time of the most recent common ancestor of u and v.

0 commit comments

Comments
 (0)