Skip to content

Commit f409b7c

Browse files
committed
fix: update tests to reflect new biallelic diplotypes behaviour
1 parent be2b25d commit f409b7c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/anoph/test_snp_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,10 +1388,10 @@ def check_biallelic_snp_calls_and_diplotypes(
13881388
assert gn.ndim == 2
13891389
assert gn.shape[0] == ds.sizes["variants"]
13901390
assert gn.shape[1] == ds.sizes["samples"]
1391-
assert np.all(gn >= 0)
1392-
assert np.all(gn <= 2)
1391+
assert np.all((gn >= 0) | (gn == -127))
1392+
assert np.all((gn <= 2) | (gn == -127))
13931393
ac = ds["variant_allele_count"].values
1394-
assert np.all(np.sum(gn, axis=1) == ac[:, 1])
1394+
assert np.all(np.sum(np.where(gn == -127, 0, gn), axis=1) == ac[:, 0])
13951395
assert samples.ndim == 1
13961396
assert samples.shape[0] == gn.shape[1]
13971397
assert samples.tolist() == expected_samples

0 commit comments

Comments
 (0)