@@ -210,12 +210,6 @@ def test_generated_no_fields(self, icf_path):
210
210
schema .fields .clear ()
211
211
self .assert_json_round_trip (schema )
212
212
213
- def test_generated_no_samples (self , icf_path ):
214
- icf = vcf2zarr .IntermediateColumnarFormat (icf_path )
215
- schema = vcz_mod .generate_schema (icf )
216
- schema .samples .clear ()
217
- self .assert_json_round_trip (schema )
218
-
219
213
def test_generated_change_dtype (self , icf_path ):
220
214
icf = vcf2zarr .IntermediateColumnarFormat (icf_path )
221
215
schema = vcz_mod .generate_schema (icf )
@@ -344,23 +338,6 @@ def test_chunk_size(self, schema):
344
338
assert schema .samples_chunk_size == 10000
345
339
assert schema .variants_chunk_size == 1000
346
340
347
- def test_samples (self , schema ):
348
- assert schema .asdict ()["samples" ] == [
349
- {"id" : s } for s in ["NA00001" , "NA00002" , "NA00003" ]
350
- ]
351
-
352
- def test_contigs (self , schema ):
353
- assert schema .asdict ()["contigs" ] == [
354
- {"id" : s , "length" : None } for s in ["19" , "20" , "X" ]
355
- ]
356
-
357
- def test_filters (self , schema ):
358
- assert schema .asdict ()["filters" ] == [
359
- {"id" : "PASS" , "description" : "All filters passed" },
360
- {"id" : "s50" , "description" : "Less than 50% of samples have data" },
361
- {"id" : "q10" , "description" : "Quality below 10" },
362
- ]
363
-
364
341
def test_variant_contig (self , schema ):
365
342
assert get_field_dict (schema , "variant_contig" ) == {
366
343
"name" : "variant_contig" ,
@@ -512,18 +489,6 @@ class TestVcfDescriptions:
512
489
def test_fields (self , schema , field , description ):
513
490
assert schema .field_map ()[field ].description == description
514
491
515
- @pytest .mark .parametrize (
516
- ("filt" , "description" ),
517
- [
518
- ("PASS" , "All filters passed" ),
519
- ("s50" , "Less than 50% of samples have data" ),
520
- ("q10" , "Quality below 10" ),
521
- ],
522
- )
523
- def test_filters (self , schema , filt , description ):
524
- d = {f .id : f .description for f in schema .filters }
525
- assert d [filt ] == description
526
-
527
492
528
493
class TestVcfZarrWriterExample :
529
494
arrays = (
@@ -696,33 +661,6 @@ def test_call_fields(self, tmp_path, field):
696
661
vcf2zarr .explode (tmp_path / "x.icf" , [tmp_path / "test.vcf.gz" ])
697
662
698
663
699
- class TestBadSchemaChanges :
700
- # [{'id': 'NA00001'}, {'id': 'NA00002'}, {'id': 'NA00003'}],
701
- @pytest .mark .parametrize (
702
- "samples" ,
703
- [
704
- [],
705
- [{"id" : "NA00001" }, {"id" : "NA00003" }],
706
- [{"id" : "NA00001" }, {"id" : "NA00002" }, {"id" : "NA00004" }],
707
- [
708
- {"id" : "NA00001" },
709
- {"id" : "NA00002" },
710
- {"id" : "NA00003" },
711
- {"id" : "NA00004" },
712
- ],
713
- [{"id" : "NA00001" }, {"id" : "NA00003" }, {"id" : "NA00002" }],
714
- ],
715
- )
716
- def test_removed_samples (self , tmp_path , schema , icf_path , samples ):
717
- d = schema .asdict ()
718
- d ["samples" ] = samples
719
- schema_path = tmp_path / "schema.json"
720
- with open (schema_path , "w" ) as f :
721
- json .dump (d , f )
722
- with pytest .raises (ValueError , match = "Subsetting or reordering samples" ):
723
- vcf2zarr .encode (icf_path , tmp_path / "z" , schema_path = schema_path )
724
-
725
-
726
664
class TestInspect :
727
665
def test_icf (self , icf_path ):
728
666
df = pd .DataFrame (vcz_mod .inspect (icf_path ))
0 commit comments