@@ -147,9 +147,9 @@ def test_parse_json_in():
147
147
assert len ([v for v in variant_list if v ["type" ] == "del" ]) == 3
148
148
assert len ([v for v in variant_list if v ["type" ] == "aa" ]) == 15
149
149
assert name == "Lineage_X"
150
- assert rules ["min_alt" ] == 4
151
- assert rules ["max_ref" ] == 6
152
- assert rules ["s:E484K" ] == "alt"
150
+ assert rules ["default" ][ " min_alt" ] == 4
151
+ assert rules ["default" ][ " max_ref" ] == 6
152
+ assert rules ["default" ][ " s:E484K" ] == "alt"
153
153
assert mrca_lineage == "B.1.1.7"
154
154
assert incompatible_lineages == "A|B.1.351"
155
155
@@ -162,7 +162,7 @@ def test_parse_csv_in():
162
162
assert len ([v for v in variant_list if v ["type" ] == "del" ]) == 3
163
163
assert len ([v for v in variant_list if v ["type" ] == "aa" ]) == 15
164
164
assert name == "lineage_X"
165
- assert rules ["s:E484K" ] == "alt"
165
+ assert rules ["default" ][ " s:E484K" ] == "alt"
166
166
167
167
168
168
def test_parse_textfile_in ():
@@ -178,8 +178,8 @@ def test_parse_textfile_in():
178
178
def test_parse_variants_in ():
179
179
in_files = ["%s/lineage_X.json" % data_dir , "%s/lineage_X.csv" % data_dir , "%s/lineage_X.txt" % data_dir ]
180
180
expect_names = ["Lineage_X" , "lineage_X" , "lineage_X" ]
181
- rule_dict_json = {"min_alt" : 4 , "max_ref" : 6 , "s:E484K" : "alt" }
182
- rule_dict_csv = {"s:E484K" : "alt" }
181
+ rule_dict_json = {"default" : { " min_alt" : 4 , "max_ref" : 6 , "s:E484K" : "alt" } }
182
+ rule_dict_csv = {"default" : { " s:E484K" : "alt" } }
183
183
rule_dict_txt = None
184
184
expect_rules = [rule_dict_json , rule_dict_csv , rule_dict_txt ]
185
185
@@ -248,8 +248,8 @@ def test_count_and_classify():
248
248
oth_string = "gaaattcgcccgta-gctcgcaatag"
249
249
seqs = [Seq (ref_string ), Seq (alt_string ), Seq (alt_plus_string ), Seq (oth_string )]
250
250
251
- rules = {"min_alt" : 1 , "max_ref" : 1 , "snp2" : "alt" }
252
- expect_classify = [False , False , True , False ]
251
+ rules = {"default" : { " min_alt" : 1 , "max_ref" : 1 , "snp2" : "alt" } }
252
+ expect_classify = [False , False , "default" , False ]
253
253
expect_counts = [{"ref" : 5 , "alt" : 0 , "ambig" : 0 , "oth" : 1 , "rules" : 0 , 'substitution' : {'ref' : 4 , 'alt' : 0 , 'ambig' : 0 , 'oth' : 0 }, 'indel' : {'ref' : 1 , 'alt' : 0 , 'ambig' : 0 , 'oth' : 1 }, "support" : 0.0 , "conflict" : 0.8333 },
254
254
{"ref" : 1 , "alt" : 4 , "ambig" : 0 , "oth" : 1 , "rules" : 0 , 'substitution' : {'ref' : 1 , 'alt' : 3 , 'ambig' : 0 , 'oth' : 0 }, 'indel' : {'ref' : 0 , 'alt' : 1 , 'ambig' : 0 , 'oth' : 1 }, "support" : 0.6667 , "conflict" : 0.1667 },
255
255
{"ref" : 0 , "alt" : 5 , "ambig" : 0 , "oth" : 1 , "rules" : 3 , 'substitution' : {'ref' : 0 , 'alt' : 4 , 'ambig' : 0 , 'oth' : 0 }, 'indel' : {'ref' : 0 , 'alt' : 1 , 'ambig' : 0 , 'oth' : 1 }, "support" : 0.8333 , "conflict" : 0.0 },
0 commit comments