Skip to content

Commit 7f1beaa

Browse files
committed
Fix #35
1 parent 4ed2f4a commit 7f1beaa

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

mutalyzer_hgvs_parser/hgvs_parser.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,61 @@
616616
),
617617
"selected": 0,
618618
},
619+
{
620+
"type": "insert description_dna repeat_number | insert description_dna - 0 ",
621+
# inserted
622+
# NG_000001.1(NM_000002.3):c.(170_?)_420+60[19]
623+
"conditions": lambda children: (
624+
len(children) == 2
625+
and children[0].data == children[1].data == "insert"
626+
and len(get_child(children, [0]).children) == 2
627+
and data_equals(children, [0, 0], "description_dna")
628+
and data_equals(children, [0, 1], "repeat_number")
629+
and len(get_child(children, [1]).children) == 1
630+
and data_equals(children, [1, 0], "description_dna")
631+
),
632+
"selected": 0,
633+
},
634+
{
635+
"type": "insert location repeat_number | insert repeat_mixed - 0 ",
636+
# test_variant_to_model 123_191[CAG[19];CAA[4];10_15[6]
637+
"conditions": lambda children: (
638+
len(children) == 2
639+
and children[0].data == children[1].data == "insert"
640+
and len(get_child(children, [0]).children) in [2, 3]
641+
and data_equals(children, [0, 1], "repeat_number")
642+
and len(get_child(children, [1]).children) == 1
643+
and data_equals(children, [1, 0], "repeat_mixed")
644+
),
645+
"selected": 0,
646+
},
647+
{
648+
"type": "insert location repeat_number | insert repeat_mixed - 0 ",
649+
# test_variant_to_model 123_191[CAG[19];CAA[4];10_15[6]
650+
"conditions": lambda children: (
651+
len(children) == 2
652+
and children[0].data == children[1].data == "insert"
653+
and len(get_child(children, [0]).children) == 2
654+
and data_equals(children, [0, 0], "location")
655+
and data_equals(children, [0, 1], "repeat_number")
656+
and len(get_child(children, [1]).children) == 1
657+
and data_equals(children, [1, 0], "repeat_mixed")
658+
),
659+
"selected": 0,
660+
},
661+
{
662+
"type": "insert description_dna inv | insert description_dna - 1 ",
663+
"conditions": lambda children: (
664+
len(children) == 2
665+
and children[0].data == children[1].data == "insert"
666+
and len(get_child(children, [0]).children) == 2
667+
and data_equals(children, [0, 0], "description_dna")
668+
and isinstance(get_child(children, [0, 1]), Token)
669+
and len(get_child(children, [1]).children) == 1
670+
and data_equals(children, [1, 0], "description_dna")
671+
),
672+
"selected": 1,
673+
},
619674
]
620675

621676

0 commit comments

Comments
 (0)