Skip to content

Commit 50a87b9

Browse files
Disable PL for now to get tests working
1 parent 872bb8e commit 50a87b9

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

bio2zarr/vcf2zarr/vcz.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ def convert_local_allele_field_types(fields):
199199
raise ValueError("Local alleles only supported on diploid data")
200200
# TODO check if LAA is already in here
201201

202-
shape = gt.shape[:-1]
203-
chunks = gt.chunks[:-1]
202+
# shape = gt.shape[:-1]
203+
# chunks = gt.chunks[:-1]
204204

205205
laa = ZarrArraySpec.new(
206206
vcf_field=None,
@@ -214,15 +214,15 @@ def convert_local_allele_field_types(fields):
214214
" are relevant (local) for the current sample"
215215
),
216216
)
217-
pl = fields_by_name.get("call_PL", None)
218-
if pl is not None:
219-
# TODO check if call_LPL is in the list already
220-
pl.name = "call_LPL"
221-
pl.vcf_field = None
222-
pl.shape = (*shape, 3)
223-
pl.chunks = (*chunks, 3)
224-
pl.description += " (local-alleles)"
225-
# TODO fix dimensions
217+
# pl = fields_by_name.get("call_PL", None)
218+
# if pl is not None:
219+
# # TODO check if call_LPL is in the list already
220+
# pl.name = "call_LPL"
221+
# pl.vcf_field = None
222+
# pl.shape = (*shape, 3)
223+
# pl.chunks = (*chunks, 3)
224+
# pl.description += " (local-alleles)"
225+
# # TODO fix dimensions
226226
return [*fields, laa]
227227

228228

@@ -1164,6 +1164,7 @@ def encode(
11641164
max_variant_chunks=None,
11651165
dimension_separator=None,
11661166
max_memory=None,
1167+
local_alleles=None,
11671168
worker_processes=1,
11681169
show_progress=False,
11691170
):
@@ -1176,6 +1177,7 @@ def encode(
11761177
schema_path=schema_path,
11771178
variants_chunk_size=variants_chunk_size,
11781179
samples_chunk_size=samples_chunk_size,
1180+
local_alleles=local_alleles,
11791181
max_variant_chunks=max_variant_chunks,
11801182
dimension_separator=dimension_separator,
11811183
)
@@ -1197,6 +1199,7 @@ def encode_init(
11971199
schema_path=None,
11981200
variants_chunk_size=None,
11991201
samples_chunk_size=None,
1202+
local_alleles=None,
12001203
max_variant_chunks=None,
12011204
dimension_separator=None,
12021205
max_memory=None,
@@ -1209,6 +1212,7 @@ def encode_init(
12091212
icf_store,
12101213
variants_chunk_size=variants_chunk_size,
12111214
samples_chunk_size=samples_chunk_size,
1215+
local_alleles=local_alleles,
12121216
)
12131217
else:
12141218
logger.info(f"Reading schema from {schema_path}")
@@ -1261,7 +1265,6 @@ def convert(
12611265
vcfs,
12621266
worker_processes=worker_processes,
12631267
show_progress=show_progress,
1264-
local_alleles=local_alleles,
12651268
)
12661269
encode(
12671270
icf_path,
@@ -1270,6 +1273,7 @@ def convert(
12701273
samples_chunk_size=samples_chunk_size,
12711274
worker_processes=worker_processes,
12721275
show_progress=show_progress,
1276+
local_alleles=local_alleles,
12731277
)
12741278

12751279

tests/test_vcf_examples.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -647,12 +647,12 @@ def test_call_AD(self, ds):
647647

648648
def test_call_LAA(self, ds):
649649
# All the genotypes are 0/0
650-
call_LAA = np.full((23, 3, 1), -2)
650+
call_LAA = np.full((23, 3, 2), -2)
651651
nt.assert_array_equal(ds.call_LAA.values, call_LAA)
652652

653-
def test_call_LPL(self, ds):
654-
call_LPL = np.tile([0, -2, -2], (23, 3, 1))
655-
nt.assert_array_equal(ds.call_LPL.values, call_LPL)
653+
# def test_call_LPL(self, ds):
654+
# call_LPL = np.tile([0, -2, -2], (23, 3, 1))
655+
# nt.assert_array_equal(ds.call_LPL.values, call_LPL)
656656

657657
def test_call_PID(self, ds):
658658
call_PGT = ds["call_PGT"].values

0 commit comments

Comments
 (0)