Skip to content

Commit a96a494

Browse files
committed
.
1 parent b63462f commit a96a494

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

python/tests/test_relatedness_vector.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ def check_relatedness_vector(
481481
verbosity=verbosity,
482482
centre=centre,
483483
nodes=nodes,
484+
span_normalise=span_normalise,
484485
)
485486
return R
486487

@@ -815,21 +816,21 @@ def pca(ts, windows, centre, samples=None, individuals=None, time_windows=None):
815816
if drop_dimension:
816817
windows = [0, ts.sequence_length]
817818
if time_windows is None:
818-
Sigma = relatedness_matrix(ts=ts, windows=windows, centre=False)[:, ii, :][
819-
:, :, ii
820-
]
819+
Sigma = relatedness_matrix(
820+
ts=ts, windows=windows, centre=False, span_normalise=False
821+
)[:, ii, :][:, :, ii]
821822
else:
822823
assert time_windows[0] < time_windows[1]
823824
ts_low, ts_high = (
824825
ts.decapitate(time_windows[0]),
825826
ts.decapitate(time_windows[1]),
826827
)
827-
Sigma_low = relatedness_matrix(ts=ts_low, windows=windows, centre=False)[
828-
:, ii, :
829-
][:, :, ii]
830-
Sigma_high = relatedness_matrix(ts=ts_high, windows=windows, centre=False)[
831-
:, ii, :
832-
][:, :, ii]
828+
Sigma_low = relatedness_matrix(
829+
ts=ts_low, windows=windows, centre=False, span_normalise=False
830+
)[:, ii, :][:, :, ii]
831+
Sigma_high = relatedness_matrix(
832+
ts=ts_high, windows=windows, centre=False, span_normalise=False
833+
)[:, ii, :][:, :, ii]
833834
Sigma = Sigma_high - Sigma_low
834835
if individuals is not None:
835836
ni = len(individuals)

python/tskit/trees.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9088,6 +9088,7 @@ def _genetic_relatedness_vector_node(
90889088
mode=mode,
90899089
centre=False,
90909090
nodes=indices,
9091+
span_normalise=False, # <- non-default!
90919092
)[0]
90929093
x = x - x.mean(axis=0) if centre else x
90939094

@@ -9118,6 +9119,7 @@ def _genetic_relatedness_vector_individual(
91189119
mode=mode,
91199120
centre=False,
91209121
nodes=samples,
9122+
span_normalise=False, # <- non-default!
91219123
)[0]
91229124

91239125
def bincount_fn(w):

0 commit comments

Comments
 (0)