Skip to content

Commit 3b1ea7a

Browse files
committed
1 parent f8e1176 commit 3b1ea7a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

sgkit/io/vcfzarr_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def max_str_len(arr: ArrayLike) -> Any:
7575
)
7676

7777
# Add a mask for variant ID
78-
ds["variant/id_mask"] = (
78+
ds["variant_id_mask"] = (
7979
[DIM_VARIANT],
8080
variants_id == ".",
8181
)

sgkit/tests/test_vcfzarr_reader.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ def test_read_vcfzarr(shared_datadir):
1616
ds = read_vcfzarr(path)
1717

1818
assert ds.attrs["contigs"] == ["19", "20", "X"]
19-
assert_array_equal(ds["variant/contig"], [0, 0, 1, 1, 1, 1, 1, 1, 2])
19+
assert_array_equal(ds["variant_contig"], [0, 0, 1, 1, 1, 1, 1, 1, 2])
2020
assert_array_equal(
21-
ds["variant/position"],
21+
ds["variant_position"],
2222
[111, 112, 14370, 17330, 1110696, 1230237, 1234567, 1235237, 10],
2323
)
2424
assert_array_equal(
25-
ds["variant/alleles"],
25+
ds["variant_allele"],
2626
[
2727
[b"A", b"C", b"", b""],
2828
[b"A", b"G", b"", b""],
@@ -36,15 +36,15 @@ def test_read_vcfzarr(shared_datadir):
3636
],
3737
)
3838
assert_array_equal(
39-
ds["variant/id"],
39+
ds["variant_id"],
4040
[".", ".", "rs6054257", ".", "rs6040355", ".", "microsat1", ".", "rsTest"],
4141
)
4242
assert_array_equal(
43-
ds["variant/id_mask"],
43+
ds["variant_id_mask"],
4444
[True, True, False, True, False, True, False, True, False],
4545
)
4646

47-
assert_array_equal(ds["sample/id"], ["NA00001", "NA00002", "NA00003"])
47+
assert_array_equal(ds["sample_id"], ["NA00001", "NA00002", "NA00003"])
4848

4949
call_genotype = np.array(
5050
[
@@ -60,9 +60,9 @@ def test_read_vcfzarr(shared_datadir):
6060
],
6161
dtype="i1",
6262
)
63-
assert_array_equal(ds["call/genotype"], call_genotype)
64-
assert_array_equal(ds["call/genotype_mask"], call_genotype < 0)
65-
assert "call/genotype_phased" not in ds
63+
assert_array_equal(ds["call_genotype"], call_genotype)
64+
assert_array_equal(ds["call_genotype_mask"], call_genotype < 0)
65+
assert "call_genotype_phased" not in ds
6666

6767

6868
def test_ensure_2d():

0 commit comments

Comments
 (0)