more efficient TMRCA computation? #1306
Closed
feilchenfeldt
started this conversation in
Ideas
Replies: 1 comment 9 replies
-
Hm, interesting. That's a very nice and clear function! The
This isn't a very careful timing test, of course. In your case, was the built-in method actually taking a long time? |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I recently started to use tskit in python to iterate over tree sequences and interrogate the trees.
I wrote a function for getting the distance in the tree between two samples. Now I realised that tree.tmrca() is implemented, which basically gives the same thing.
However, I see that my function for getting the tmrca is consistently about 10 times faster than tree.tmrca() on my trees of 486 samples, while giving identical output.
I was trying to understand the implemented method, but the actuall code is burried in
_ll
objects which are obscure to me.I post my code below and wanted to ask whether there is anything that speaks against implementing .tmrca that way, given that it seems to be much faster.
Analogously to TMRCA, one could also retrieve the id of the MRCA analogously (just returning i).
Thanks,
Hannes
Beta Was this translation helpful? Give feedback.
All reactions