Skip to content

Commit 46fffc9

Browse files
committed
Include wild type in score residues.
1 parent 20b15d3 commit 46fffc9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

pyvdrm/asi2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def __repr__(self):
220220

221221
def __call__(self, env):
222222
for mutation_set in env:
223-
intersection = mutation_set.mutations & self.mutations.mutations
223+
intersection = self.mutations.mutations & mutation_set.mutations
224224
if len(intersection) > 0:
225225
return Score(True, intersection)
226226
return None

pyvdrm/tests/test_asi2.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,18 @@ def test_asi2_compat(self):
4747

4848
# noinspection SqlNoDataSourceInspection,SqlDialectInspection
4949
class TestRuleSemantics(unittest.TestCase):
50-
5150
def test_score_from(self):
5251
rule = ASI2("SCORE FROM ( 100G => 10, 101D => 20 )")
5352
self.assertEqual(rule(VariantCalls("100G 102G")), 10)
5453

54+
def test_score_residues(self):
55+
rule = ASI2("SCORE FROM ( 100G => 10, 101D => 20 )")
56+
expected_residue = repr({Mutation('S100G')})
57+
58+
result = rule.dtree(VariantCalls("S100G R102G"))
59+
60+
self.assertEqual(expected_residue, repr(result.residues))
61+
5562
def test_score_from_max(self):
5663
rule = ASI2("SCORE FROM (MAX (100G => 10, 101D => 20, 102D => 30))")
5764
self.assertEqual(rule(VariantCalls("100G 101D")), 20)

0 commit comments

Comments
 (0)