diff --git a/VERSION b/VERSION index ac39a10..f374f66 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.0 +0.9.1 diff --git a/piezo/grammar_GARC1.py b/piezo/grammar_GARC1.py index 9698829..a5c7710 100644 --- a/piezo/grammar_GARC1.py +++ b/piezo/grammar_GARC1.py @@ -1027,13 +1027,14 @@ def process_snp_variants( # PRIORITY=8: any nonsynoymous mutation at this specific position in the CDS or # PROM (e.g. rpoB@S450? or rpoB@c-15?) - row = rules.loc[ - rules_mutation_type_vector - & rules_position_vector - & (rules.MUTATION.str[-1] == "?") - ] - # nonsyn SNP at specified position in the CDS - row_prediction(row, predictions, 8, minor) + if mutation[-1] not in ["X", "x"]: + row = rules.loc[ + rules_mutation_type_vector + & rules_position_vector + & (rules.MUTATION.str[-1] == "?") + ] + # nonsyn SNP at specified position in the CDS + row_prediction(row, predictions, 8, minor) # PRIORITY=9: an exact match row = rules.loc[(rules_mutation_type_vector) & (rules.MUTATION == mutation)] diff --git a/tests/test-catalogue/NC_004148.2_TEST_v1.0_GARC1_RFUS-FRS.csv b/tests/test-catalogue/NC_004148.2_TEST_v1.0_GARC1_RFUS-FRS.csv index 2c4ef5e..36e8221 100644 --- a/tests/test-catalogue/NC_004148.2_TEST_v1.0_GARC1_RFUS-FRS.csv +++ b/tests/test-catalogue/NC_004148.2_TEST_v1.0_GARC1_RFUS-FRS.csv @@ -40,3 +40,5 @@ NC_004148.2,TEST,v1.0,GARC1,RFUS,DRUG_A,M2@G74!&M2@G74X,U,{},"{""row"": 37}",{} NC_004148.2,TEST,v1.0,GARC1,RFUS,DRUG_A,M2@F75V:0.03,R,{},"{""row"": 38}",{} NC_004148.2,TEST,v1.0,GARC1,RFUS,DRUG_B,M2@G74!:0.04&M2@G74X:0.02,U,{},"{""row"": 39}",{} NC_004148.2,TEST,v1.0,GARC1,RFUS,DRUG_B,M3@*_ins,R,{},"{""row"": 40}",{} +NC_004148.2,TEST,v1.0,GARC1,RFUS,DRUG_B,M3@S450?,R,{},"{""row"": 41}",{} +NC_004148.2,TEST,v1.0,GARC1,RFUS,DRUG_B,M3@*?,U,{},"{""row"": 42}",{} diff --git a/tests/test_catalogue.py b/tests/test_catalogue.py index e26b0a5..4b03ba4 100644 --- a/tests/test_catalogue.py +++ b/tests/test_catalogue.py @@ -582,3 +582,7 @@ def test_misc(): # Double checking that a minor allele doesn't hit a general rule anymore assert test_catalogue.predict("M2@37_del_c:0.2") == {"DRUG_A": "S", "DRUG_B": "S"} + + # Checking that a null call can't hit a wildcard rule + # This catalogue has M3@S450?, this shouldn't hit that and so should get a default "S" + assert test_catalogue.predict("M3@S450X") == "S"