Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One sided RF distance #76

Closed
wants to merge 17 commits into from
Closed

One sided RF distance #76

wants to merge 17 commits into from

Conversation

clarisw
Copy link
Contributor

@clarisw clarisw commented Apr 22, 2023

No description provided.

@@ -682,6 +682,58 @@ def edge_func(n1, n2):
return kwargs


def one_sided_rfdistance_funcs(reference_dag: "HistoryDag"):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks great! I think the argument reference_dag should be called reference_history, since even though it's a history DAG object, it's expected to be tree-shaped (hence an history).

Also, we should make it very clear in the docstring whether the reference_history is expected to be multifurcating or not, when we're trying to detect resolutions of multifurcating trees.

ref_history = dag_copy.sample()
return 2 * self.optimal_rf_distance(ref_history, optimal_func=max)

def optimal_one_sided_sum_rf_distance(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be called just optimal_one_sided_rf_distance since we're not taking a sum over anything... unless I'm misunderstanding!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the method returns something like the sum of one-sided RF distances rather than a single distance. I tried running it one some examples, and it returns a number that is bigger than the one returned by optimal_rf_distance.

Also, from skimming the code in utils.one_side_rfdistance_funcs it looks pretty close to utils.sum_rfdistance_fucs

@willdumm
Copy link
Collaborator

This great work was incorporated into #80 so I'm closing this PR

@willdumm willdumm closed this Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants