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

Add fwd_bck_parents_max_mut_dist to breakpoint table #141

Closed
wants to merge 1 commit into from

Conversation

hyanwong
Copy link
Contributor

This adds the max of (number of mutations that separate the left parents on the forward and backward passes, number of mutations that separate the right parents on the forward and backward passes), which we agreed could provide the most stringent measure of "HMM consistency".

However, it uses repeated rounds of simplification to calculate the number of mutations between parent nodes, so is slow: it takes export_recombinant_breakpoints from 1.5 secs to 12 secs. Personally I'm happy with that, and don't want to spend much time optimising it any more, but @jeromekelleher might have a better method?

@hyanwong
Copy link
Contributor Author

We could always add a pass to create this column after the export_recombinant_breakpoints function is run, but it seemed cleaner to calculate everything we need at once.

@hyanwong
Copy link
Contributor Author

Oh bugger, I forgot that simplify() doesn't remove mutations above the root. So simplified_ts.num_mutations() is not correct.

@hyanwong
Copy link
Contributor Author

hyanwong commented Mar 29, 2023

We can look at the mutations above the sample nodes in the simplified ts though, so easy to correct in this case, and I have done so in 309cbf7

@jeromekelleher
Copy link
Owner

jeromekelleher commented Apr 4, 2023

As discussed yesterday, would be simpler to consider sequence identity here via the variants function. Something like

H = ts.genotype_matrix(samples=[left_parent, right_parent]).T
sequence_diffs = np.sum(H[0] != H[1])

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.

None yet

2 participants