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

Changing the node building priority in NodeFactory.build() #48

Merged
merged 6 commits into from
Dec 1, 2022

Conversation

leoisl
Copy link
Collaborator

@leoisl leoisl commented Nov 30, 2022

This PR makes it explicit the priority of which node we build in NodeFactory.build(). This is important to prioritise which types of nodes we try to build first. This priority directly translates to how we partition the MSA in the recursive clustering and collapse algorithm, so it is at the core of the make_prg algorithm. In summary, we try to first build a leaf if we can, as if we can build a leaf, there is no need to recursively partition the MSA horizontally or vertically. If that does not work, we try to build a multi interval node, i.e. try to partition the MSA vertically. If that does not work, we try to build a multi cluster node, i.e. try to partition the MSA horizontally. If that does not work, then it means we can't partition the MSA anymore, then we force build a leaf. We have a corner case when building the root, which is slightly different. In more details this is the node building priority we apply:

Node building priority depends on the type of node we are building:
1. If type of node is root
    1.1. Try to build a leaf
    1.2. Force build a multi interval node (even if we have just a single mismatch interval)
2. If type of node is non-root
    2.1. Try to build a leaf
    2.2. Try to build a multi interval node
    2.3. Try to build a multi cluster node
    2.4. If all fails, force build a leaf

Several unit tests were added, and two integration tests validating the sample example were added.

Closes #43

@leoisl leoisl requested a review from mbhall88 November 30, 2022 14:29
@leoisl leoisl mentioned this pull request Nov 30, 2022
@iqbal-lab
Copy link
Contributor

does this explain that SNP thing @leoisl ?

@leoisl
Copy link
Collaborator Author

leoisl commented Dec 1, 2022

yep! although it would be interesting to check the impact of this change on the 20-way dataset... I think we should test new make_prg + new pandora releases on both 20-way and drprg...

@leoisl leoisl deleted the fix/43 branch December 2, 2022 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants