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

major re-write on snaq check root #136

Open
crsl4 opened this issue Aug 3, 2020 · 2 comments
Open

major re-write on snaq check root #136

crsl4 opened this issue Aug 3, 2020 · 2 comments
Assignees
Labels

Comments

@crsl4
Copy link
Member

crsl4 commented Aug 3, 2020

We have a mess in the order of:

  • check root
  • merge leaves
  • printing network

for the case of multiple alleles.
We need to really look into the order of things, and do not repeat steps.
Make sure that some things are done inside optTopRuns.

Problem: we need to print the network before merging leaves (which is currently done outside optTopRuns), so writeTopologyLevel1 needs to merge the leaves. But merging the leaves messes with the root.

Currently, we do:

  • In optTopRuns:
    1. check the root
    2. print maxNet (with writeTopologyLevel1 which merges leaves and checks root again inside)
  • In snaq:
    1. merge leaves for good before returning the network
    2. checks the root again
@crsl4 crsl4 added the to do label Aug 3, 2020
@crsl4 crsl4 self-assigned this Aug 3, 2020
@crsl4
Copy link
Member Author

crsl4 commented Aug 3, 2020

From @cecileane comment:
This is unrelated to the docstring, but it would be good to include a formal test for the changes to writeTopologyLevel1 and to the end of snaq!, in 1da3325).

By the way, the chunk of code repeated in writeTopologyLevel1 and in snaq! could possibly be moved to checkRootPlace!: There would be less room for bugs (e.g. bug fixed in one place but not in the other, when the chunk is repeated), and the code for both writeTopologyLevel1 and in snaq! would be cleaner. The formal test could also be made cleaner that way.

@cecileane
Copy link
Member

was this done via 1da3325 and #135?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants