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

allow genetic_relatedness_vector to do windows that don't span the whole genome #3003

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

petrelharp
Copy link
Contributor

@petrelharp petrelharp commented Sep 26, 2024

Pretty straightforward; and this allows parallelization across windows.

Edit: I've added into this the ability to pass in a different set of nodes (added here since it's on top of these changes).

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 89.81%. Comparing base (170cae3) to head (39e8145).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
c/tskit/trees.c 94.59% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3003   +/-   ##
=======================================
  Coverage   89.80%   89.81%           
=======================================
  Files          29       29           
  Lines       31931    31979   +48     
  Branches     6179     6190   +11     
=======================================
+ Hits        28675    28721   +46     
- Misses       1860     1861    +1     
- Partials     1396     1397    +1     
Flag Coverage Δ
c-tests 86.69% <94.59%> (+0.01%) ⬆️
lwt-tests 80.78% <ø> (ø)
python-c-tests 89.05% <100.00%> (+0.01%) ⬆️
python-tests 99.01% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
python/_tskitmodule.c 89.05% <100.00%> (+0.01%) ⬆️
python/tskit/trees.py 98.80% <100.00%> (+<0.01%) ⬆️
c/tskit/trees.c 90.68% <94.59%> (+0.01%) ⬆️

@petrelharp petrelharp marked this pull request as ready for review September 26, 2024 13:42
@@ -9977,6 +9984,20 @@ tsk_matvec_calculator_init(tsk_matvec_calculator_t *self, const tsk_treeseq_t *t
tsk_memset(result, 0, num_windows * num_samples * num_weights * sizeof(*result));
tsk_memset(self->parent, TSK_NULL, num_nodes * sizeof(*self->parent));

ret = tsk_tree_position_init(&self->tree_pos, ts, 0);
if (ret != 0) {
goto out;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this function always returns 0 currently

}
ret = tsk_tree_position_seek_forward(&self->tree_pos, index);
if (ret != 0) {
goto out;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same here

@petrelharp
Copy link
Contributor Author

I think this is ready to go - the only uncovered lines are not cover-able.

@petrelharp
Copy link
Contributor Author

I've also put in the code here to let this work with arbitrary nodes. To see those changes separately look at the commits.

@petrelharp
Copy link
Contributor Author

This looks good to go! (One test will need to be re-run but it failed for other reasons.)

Copy link
Member

@jeromekelleher jeromekelleher left a comment

Choose a reason for hiding this comment

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

LGTM! I haven't gone through the fine details, but generally look good.

@jeromekelleher jeromekelleher added the AUTOMERGE-REQUESTED Ask Mergify to merge this PR label Sep 27, 2024
@mergify mergify bot merged commit bc5a73c into tskit-dev:main Sep 27, 2024
21 checks passed
@mergify mergify bot removed the AUTOMERGE-REQUESTED Ask Mergify to merge this PR label Sep 27, 2024
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.

2 participants