Closed willdumm closed 11 months ago
For reference, the computations that are used to implement this are here (starting page 5 I think) https://github.com/matsengrp/hdag-benchmark-tex/blob/2ed26a8ae7130af867738fdda55bb3ee5d811357/node-support.pdf
The constants a
and b
in the writeup correspond to the constants s
and t
in the code.
This PR includes @clarisw's contributions of computation of one-sided RF distances in the history DAG. I rearranged the implementation so that all of the new code is contained in
utils.make_rfdistance_countfuncs
. Left and right one-sided RF distances are available through the new keyword argumentone_sided
, which takes eitherleft
,right
, orNone
. The docstring explains what these options mean, hopefully in enough detail to figure out which one is needed.I also extended these additions to the sum RF distance countfuncs function in utils, as well as the sum and average RF distance methods on the whole DAG.
In addition, all dag methods for RF distance and now accept and forward these new keyword arguments to the appropriate countfunc function. All methods are tested as before, first using a ground-truth method (counting clades or ete's RF distance implementation) and building up transitively to the whole-dag sums, but now each step includes checks for left, right, and standard rooted-and-unrooted-RF distances