Use this method:
|
def _is_valid_ref_seq(self, sequence_id: str, start_pos: int, end_pos: int, |
|
ref: str) -> Tuple[bool, str]: |
|
"""Return wether or not the expected reference sequence matches the actual reference sequence |
|
|
|
:param str sequence_id: Sequence ID to use |
|
:param int start_pos: Start pos (inter-residue) on the sequence_id |
|
:param int end_pos: End pos (inter-residue) on the sequence_id |
|
:param str ref: The expected reference sequence on the sequence_id given the |
|
start_pos and end_pos |
|
:return: Tuple containing whether or not actual reference sequence matches |
|
the expected reference sequence and error message if mismatch |
|
""" |
|
actual_ref = self.data_proxy.get_sequence(sequence_id, start_pos, end_pos) |
|
is_valid = actual_ref == ref |
|
err_msg = "" |
|
if not is_valid: |
|
err_msg = f"Expected reference sequence {ref} on {sequence_id} at positions "\ |
|
f"({start_pos}, {end_pos}) but found {actual_ref}" |
|
_logger.warning(err_msg) |
|
return is_valid, err_msg |
and update regex
for these from_translators (where applicable):
|
from_translators = { |
|
"beacon": _from_beacon, |
|
"gnomad": _from_gnomad, |
|
"hgvs": _from_hgvs, |
|
"spdi": _from_spdi, |
|
"vrs": _from_vrs, |
Similar to what was done in #147
Use this method:
vrs-python/src/ga4gh/vrs/extras/translator.py
Lines 473 to 492 in d2fdd9d
and update regex
for these from_translators (where applicable):
vrs-python/src/ga4gh/vrs/extras/translator.py
Lines 532 to 537 in d2fdd9d
Similar to what was done in #147