Skip to content

genetic_relatedness thinks it needs 2 samples sets but is valid with only one #3055

Closed

Description

@petrelharp

Self-comparisons are valid for this statistic, and so this should work:

>> ts.genetic_relatedness([[0]], indexes=[(0,0)])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/peter/projects/tskit-dev/tsvenv/lib/python3.12/site-packages/tskit/trees.py", line 8403, in genetic_relatedness
    out = self.__k_way_sample_set_stat(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/peter/projects/tskit-dev/tsvenv/lib/python3.12/site-packages/tskit/trees.py", line 7843, in __k_way_sample_set_stat
    stat = self.__run_windowed_stat(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/peter/projects/tskit-dev/tsvenv/lib/python3.12/site-packages/tskit/trees.py", line 7664, in __run_windowed_stat
    stat = method(*args, **kwargs, windows=windows)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tskit.LibraryError: Insufficient sample sets provided. (TSK_ERR_INSUFFICIENT_SAMPLE_SETS)

Activity

  1. added
    bug
    on Jun 15, 2025
  2. added a commit that references this issue on Jun 26, 2025
    c91169a
  3. andrewkern commented on Jun 26, 2025

    @andrewkern
    Member

    I've tried to fix this over in #3235

  4. added 3 commits that reference this issue on Sep 12, 2025
    41628cf
    34d6826
    c173b32
  5. added a commit that references this issue on Sep 16, 2025
    6f6aa73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions