Skip to content

wrong output for genetic_relatedness(... indexes=None, proportion=True) #2984

Closed

Description

@petrelharp

These should be the same, except with one less dimension. They are not.

> ts.genetic_relatedness(sample_sets=[[0, 1, 2], [3]], indexes=[(0, 1)], windows=[0, 5, 10])
array([[-0.11970621],
       [-0.122826  ]])
> ts.genetic_relatedness(sample_sets=[[0, 1, 2], [3]], indexes=None, windows=[0, 5, 10])
array([[-0.11970621, -0.13156656],
       [-0.11175358, -0.122826  ]])

The issue here was our naive normalization code was dividing (in this case) a shape (2, 1) array by a shape (2,) array, which is a shape (2,2) array, not (2,1) as desired.

Activity

  1. added 2 commits that reference this issue on Sep 10, 2024
    b9d065d
    0381eb6
  2. added a commit that references this issue on Sep 18, 2024
    4170933
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions