Skip to content

Ibd avl tree - #1659

Merged
mergify[bot] merged 1 commit into
tskit-dev:mainfrom
jeromekelleher:ibd_avl_tree
Sep 7, 2021
Merged

mergify[bot] merged 1 commit into
tskit-dev:mainfrom
jeromekelleher:ibd_avl_tree

Conversation

@jeromekelleher

Copy link
Copy Markdown
Member

This converts the IBD result object to use an AVL tree internally for storage instead of a lookup matrix. We're not changing the semantics of the object yet so that we can store segments for arbitrary sample pairs, this is just the minimal changes required to change the backend.

I'll follow up with more PRs for how we can change the semantics later, probably good to get this squared away first so that we can keep the diffs smaller.

Stacked on #1655 and #1637

@molpopgen

Copy link
Copy Markdown
Member

This is awesome!

@jeromekelleher

Copy link
Copy Markdown
Member Author

This is ready to go - @gtsambos, basically this just swaps out the array-based indexing code you were using with its direct equivalent using the AVL trees. There's no semantic updates here, that's happening in #1660.

@codecov

codecov Bot commented Sep 6, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #1659 (8e5db0f) into main (fc2b564) will increase coverage by 0.01%.
The diff coverage is 94.02%.

❗ Current head 8e5db0f differs from pull request most recent head 834772f. Consider uploading reports for the commit 834772f to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1659      +/-   ##
==========================================
+ Coverage   93.66%   93.68%   +0.01%     
==========================================
  Files          27       27              
  Lines       23511    23482      -29     
  Branches     1084     1084              
==========================================
- Hits        22022    21999      -23     
+ Misses       1455     1449       -6     
  Partials       34       34              
Flag Coverage Δ
c-tests 91.80% <94.02%> (+0.03%) ⬆️
lwt-tests 93.49% <ø> (ø)
python-c-tests 95.49% <ø> (ø)
python-tests 98.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
c/tskit/core.h 100.00% <ø> (ø)
c/tskit/tables.c 89.66% <93.93%> (+0.04%) ⬆️
c/tskit/core.c 97.73% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc2b564...834772f. Read the comment docs.

@gtsambos gtsambos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is fantastic, Jerome!

@benjeffery benjeffery left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, one question about future proofing.

Comment thread c/tskit/tables.c Resolved
This preserves the current semantics where we compute for a specific set
of sample pairs.
@mergify
mergify Bot merged commit a8b42a1 into tskit-dev:main Sep 7, 2021
@jeromekelleher
jeromekelleher deleted the ibd_avl_tree branch September 8, 2021 12:25
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.

4 participants