Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create C api for two-locus branch stats
Adds a C implementation of two-locus branch statistics. It mirrors the python implementation except where we iterate over edge differences and collect them for updating the stat. We use tree_seek_index to seek to arbitrary positions and tsk_tree_next to move from tree to tree. The tricky part was getting backwards iteration correct. All tests agree with the python prototype. In addition, I had to fix a bug in the python implementation where node ids were being added to our TreeState object instead of sample ids (encoded in the sample index map). The python tests have also been updated to remove the slow naive version (after validating that it agrees with the python and c implementation -- on test cases where the runtime was reasonable). Python tests have been trimmed for runtime. The CPython code has been updated to parse positions in addition to sites. I also found the need to clean up some of the bounds checking code to return reasonable error messages to the user (also updated in the two-locus site stats). Finally, I added a few unbiased statistics for use in validating this code.
- Loading branch information