@@ -1101,14 +1101,16 @@ def test_missing_filter(tmp_path):
1101
1101
with pytest .raises (ValueError , match = "Filter 'q10' was not defined in the header" ):
1102
1102
vcf2zarr .convert ([path ], zarr_path )
1103
1103
1104
+
1104
1105
class 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"
1107
1109
1108
1110
@pytest .fixture (scope = "class" )
1109
1111
def ds (self , tmp_path_factory ):
1110
1112
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 )
1112
1114
return sg .load_dataset (out )
1113
1115
1114
1116
def test_filters (self , ds ):
@@ -1127,7 +1129,7 @@ def test_source(self, ds):
1127
1129
1128
1130
def test_contigs (self , ds ):
1129
1131
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 ])
1131
1133
nt .assert_array_equal (ds ["variant_contig" ], [0 , 1 , 1 ])
1132
1134
1133
1135
def test_position (self , ds ):
@@ -1139,19 +1141,14 @@ def test_length(self, ds):
1139
1141
def test_info_fields (self , ds ):
1140
1142
nt .assert_array_equal (
1141
1143
ds ["variant_QNAME" ],
1142
- [' cluster19_000000F' , '.' , ' cluster19_000000F' ],
1144
+ [" cluster19_000000F" , "." , " cluster19_000000F" ],
1143
1145
)
1144
1146
nt .assert_array_equal (ds ["variant_QSTART" ], [25698928 , 25698928 , - 1 ])
1145
1147
1146
1148
def test_allele (self , ds ):
1147
- fill = constants .STR_FILL
1148
1149
nt .assert_array_equal (
1149
1150
ds ["variant_allele" ].values .tolist (),
1150
- [
1151
- ['TTCCATTCCAC' , 'T' ],
1152
- ['C' , 'CTCCAT' ],
1153
- ['G' , 'A' ]
1154
- ]
1151
+ [["TTCCATTCCAC" , "T" ], ["C" , "CTCCAT" ], ["G" , "A" ]],
1155
1152
)
1156
1153
assert ds ["variant_allele" ].dtype == "O"
1157
1154
0 commit comments