@@ -455,10 +455,22 @@ def test_call_LAA(self, ds):
455
455
class TestTriploidExample :
456
456
data_path = "tests/data/vcf/triploid.vcf.gz"
457
457
458
- def test_value_error (self , tmp_path_factory ):
458
+ @pytest .fixture (scope = "class" )
459
+ def ds (self , tmp_path_factory ):
460
+ out = tmp_path_factory .mktemp ("data" ) / "example.vcf.zarr"
461
+ vcf2zarr .convert ([self .data_path ], out , local_alleles = False )
462
+ return sg .load_dataset (out )
463
+
464
+ def test_error_with_local_alleles (self , tmp_path_factory ):
459
465
icf_path = tmp_path_factory .mktemp ("data" ) / "triploid.icf"
460
466
with pytest .raises (ValueError , match = re .escape ("Cannot handle ploidy = 3" )):
461
- vcf2zarr .explode (icf_path , [self .data_path ], worker_processes = 0 )
467
+ vcf2zarr .explode (
468
+ icf_path , [self .data_path ], worker_processes = 0 , local_alleles = True
469
+ )
470
+
471
+ def test_ok_without_local_alleles (self , ds ):
472
+ nt .assert_array_equal (ds .call_genotype .values , [[[0 , 0 , 0 ]]])
473
+ nt .assert_array_equal (ds .call_PL .values , [[[0 , 0 , 0 , 0 ]]])
462
474
463
475
464
476
class Test1000G2020Example :
0 commit comments