@@ -1101,14 +1101,16 @@ def test_missing_filter(tmp_path):
11011101 with pytest .raises (ValueError , match = "Filter 'q10' was not defined in the header" ):
11021102 vcf2zarr .convert ([path ], zarr_path )
11031103
1104+
11041105class TestOutOfOrderFields :
1105- data_paths = ["tests/data/vcf/out_of_order_fields/input1.bcf" ,
1106- "tests/data/vcf/out_of_order_fields/input2.bcf" ]
1106+ # Mixing on purpose
1107+ data_path1 = "tests/data/vcf/out_of_order_fields/input2.bcf"
1108+ data_path2 = "tests/data/vcf/out_of_order_fields/input1.bcf"
11071109
11081110 @pytest .fixture (scope = "class" )
11091111 def ds (self , tmp_path_factory ):
11101112 out = tmp_path_factory .mktemp ("data" ) / "ooo_example.vcf.zarr"
1111- vcf2zarr .convert (self .data_paths , out )
1113+ vcf2zarr .convert ([ self .data_path1 , self . data_path2 ] , out )
11121114 return sg .load_dataset (out )
11131115
11141116 def test_filters (self , ds ):
@@ -1127,7 +1129,7 @@ def test_source(self, ds):
11271129
11281130 def test_contigs (self , ds ):
11291131 nt .assert_array_equal (ds ["contig_id" ], ["chr20" , "chr21" ])
1130- nt .assert_array_equal (ds [' contig_length' ], [64444167. , 46709983. ])
1132+ nt .assert_array_equal (ds [" contig_length" ], [64444167.0 , 46709983.0 ])
11311133 nt .assert_array_equal (ds ["variant_contig" ], [0 , 1 , 1 ])
11321134
11331135 def test_position (self , ds ):
@@ -1139,19 +1141,14 @@ def test_length(self, ds):
11391141 def test_info_fields (self , ds ):
11401142 nt .assert_array_equal (
11411143 ds ["variant_QNAME" ],
1142- [' cluster19_000000F' , '.' , ' cluster19_000000F' ],
1144+ [" cluster19_000000F" , "." , " cluster19_000000F" ],
11431145 )
11441146 nt .assert_array_equal (ds ["variant_QSTART" ], [25698928 , 25698928 , - 1 ])
11451147
11461148 def test_allele (self , ds ):
1147- fill = constants .STR_FILL
11481149 nt .assert_array_equal (
11491150 ds ["variant_allele" ].values .tolist (),
1150- [
1151- ['TTCCATTCCAC' , 'T' ],
1152- ['C' , 'CTCCAT' ],
1153- ['G' , 'A' ]
1154- ]
1151+ [["TTCCATTCCAC" , "T" ], ["C" , "CTCCAT" ], ["G" , "A" ]],
11551152 )
11561153 assert ds ["variant_allele" ].dtype == "O"
11571154
0 commit comments