Skip to content

Span normalise argument to 'TreeSequence.genetic_relatedness_vector` does nothing #3241

Closed

Description

@nspope
import msprime
import tskit
import numpy as np

print(tskit.__version__)  # 0.6.5.dev0

ts = msprime.sim_ancestry(10, recombination_rate=1e-8, sequence_length=1e6, population_size=1e4)
for centre in [True, False]:
    grm0 = ts.genetic_relatedness_vector(np.eye(ts.num_samples), mode='branch', span_normalise=True, centre=centre)
    grm1 = ts.genetic_relatedness_vector(np.eye(ts.num_samples), mode='branch', span_normalise=False, centre=centre)
    np.testing.assert_allclose(grm0, grm1)

and based on the scaling, what comes out is not span normalised

Activity

  1. petrelharp commented on Jul 17, 2025

    @petrelharp
    Contributor

    Looks like a bug to me!

  2. added
    bug
    on Jul 22, 2025
  3. added a commit that references this issue on Oct 21, 2025
    9845d5a
  4. added a commit that references this issue on Oct 22, 2025
    cd129aa
  5. added a commit that references this issue on Oct 24, 2025
    d387952
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