Commit 6f6aa73
Fix: genetic_relatedness to allow single sample set with self-comparisons
Previously, genetic_relatedness would fail with TSK_ERR_INSUFFICIENT_SAMPLE_SETS
when given a single sample set and indexes referring to that set, e.g.:
ts.genetic_relatedness([[0]], indexes=[(0,0)])
This was because the C API requires at least k=2 sample sets for k-way statistics,
even when indexes only reference a single set for self-comparison.
The fix is more general: it removes the restriction that there be at
least k sample sets for k-way stats, because this wasn't a useful or
consistently applied restriction.
Closes tskit-dev#30551 parent 1d8f453 commit 6f6aa73
File tree
5 files changed
+50
-26
lines changed- c
- tests
- tskit
- python
- tests
5 files changed
+50
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
881 | 881 | | |
882 | 882 | | |
883 | 883 | | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | 884 | | |
888 | 885 | | |
889 | 886 | | |
| |||
938 | 935 | | |
939 | 936 | | |
940 | 937 | | |
941 | | - | |
942 | | - | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | 938 | | |
948 | 939 | | |
949 | 940 | | |
| |||
972 | 963 | | |
973 | 964 | | |
974 | 965 | | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | 966 | | |
985 | 967 | | |
986 | 968 | | |
| |||
3684 | 3666 | | |
3685 | 3667 | | |
3686 | 3668 | | |
3687 | | - | |
| 3669 | + | |
3688 | 3670 | | |
3689 | 3671 | | |
3690 | 3672 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4515 | 4515 | | |
4516 | 4516 | | |
4517 | 4517 | | |
4518 | | - | |
| 4518 | + | |
4519 | 4519 | | |
4520 | 4520 | | |
4521 | 4521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
50 | 56 | | |
51 | 57 | | |
52 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1871 | 1871 | | |
1872 | 1872 | | |
1873 | 1873 | | |
1874 | | - | |
1875 | | - | |
1876 | | - | |
| 1874 | + | |
1877 | 1875 | | |
1878 | 1876 | | |
1879 | 1877 | | |
1880 | 1878 | | |
1881 | 1879 | | |
1882 | | - | |
1883 | | - | |
1884 | | - | |
| 1880 | + | |
1885 | 1881 | | |
1886 | 1882 | | |
1887 | 1883 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2307 | 2307 | | |
2308 | 2308 | | |
2309 | 2309 | | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
2310 | 2350 | | |
2311 | 2351 | | |
2312 | 2352 | | |
| |||
0 commit comments