From 16682e80945dba04ce90b5fa814a3ef8527f073f Mon Sep 17 00:00:00 2001 From: Mark Chen Date: Wed, 7 Feb 2024 09:57:05 -0500 Subject: [PATCH] fix: add `ref_n` to AARefAlt class I make the changes to fix the issue described at https://github.com/biocommons/hgvs/issues/727 --- src/hgvs/edit.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/hgvs/edit.py b/src/hgvs/edit.py index a6b95f7a..aa49a4df 100644 --- a/src/hgvs/edit.py +++ b/src/hgvs/edit.py @@ -266,6 +266,16 @@ def type(self): edit_type = "ins" return edit_type + @property + def ref_n(self): + """ + returns an integer. + """ + try: + return len(self.ref) + except ValueError: + return None + def _del_ins_lengths(self, ilen): """returns (del_len, ins_len). Unspecified ref or alt returns None for del_len or ins_len respectively.