# Path: hgvs/exceptions.py
# class HGVSInvalidVariantError(HGVSError):
#     """Exception raised when variant is inconsistent or invalid"""
#     pass
# 
# class HGVSUnsupportedOperationError(HGVSError):
#     pass
# 
# Path: hgvs/enums.py



import logging
import hgvs
import hgvs.parser
import hgvs.edit
import hgvs.variantmapper
from hgvs.exceptions import HGVSInvalidVariantError, HGVSUnsupportedOperationError
from hgvs.enums import ValidationLevel, Datum

            ref_seq = self.hdp.get_seq(ac, var_ref_start - 1, var_ref_end)
            if ref_seq != var_ref_seq:
                return (ValidationLevel.ERROR, str(var) + ": " + SEQ_ERROR_MSG.format(
                    ref_seq=ref_seq, var_ref_seq=var_ref_seq))

        return (ValidationLevel.VALID, None)

    def _c_within_cds_bound(self, var):
        if var.type != 'c':
            return (ValidationLevel.VALID, None)
        tx_info = self.hdp.get_tx_identity_info(var.ac)
        if tx_info is None:
            return (ValidationLevel.WARNING,
                    "No transcript data for accession: {ac}".format(ac=var.ac))
        cds_length = tx_info["cds_end_i"] - tx_info["cds_start_i"]
        if var.posedit.pos.start.datum == Datum.CDS_START and var.posedit.pos.start.base > cds_length:
            return (ValidationLevel.ERROR, CDS_BOUND_ERROR_MSG.format(cds_length=cds_length))
        if var.posedit.pos.end.datum == Datum.CDS_START and var.posedit.pos.end.base > cds_length:
            return (ValidationLevel.ERROR, CDS_BOUND_ERROR_MSG.format(cds_length=cds_length))
        return (ValidationLevel.VALID, None)

    def _n_within_transcript_bounds(self, var):
        if var.type != 'n':
            return (ValidationLevel.VALID, None)
        tx_info = self.hdp.get_tx_identity_info(var.ac)
        tx_len = sum(tx_info["lengths"])
        if tx_info is None:
            return (ValidationLevel.WARNING,
                    "No transcript data for accession: {ac}".format(ac=var.ac))

# Path: hgvs/exceptions.py
# class HGVSInvalidVariantError(HGVSError):
#     """Exception raised when variant is inconsistent or invalid"""
#     pass
# 
# class HGVSUnsupportedOperationError(HGVSError):
#     pass
# 
# Path: hgvs/enums.py



# Path: hgvs/validator.py
import logging
import hgvs
import hgvs.parser
import hgvs.edit
import hgvs.variantmapper
from hgvs.exceptions import HGVSInvalidVariantError, HGVSUnsupportedOperationError
from hgvs.enums import ValidationLevel, Datum


            ref_seq = self.hdp.get_seq(ac, var_ref_start - 1, var_ref_end)
            if ref_seq != var_ref_seq:
                return (ValidationLevel.ERROR, str(var) + ": " + SEQ_ERROR_MSG.format(
                    ref_seq=ref_seq, var_ref_seq=var_ref_seq))

        return (ValidationLevel.VALID, None)

    def _c_within_cds_bound(self, var):
        if var.type != 'c':
            return (ValidationLevel.VALID, None)
        tx_info = self.hdp.get_tx_identity_info(var.ac)
        if tx_info is None:
            return (ValidationLevel.WARNING,
                    "No transcript data for accession: {ac}".format(ac=var.ac))
        cds_length = tx_info["cds_end_i"] - tx_info["cds_start_i"]
        if var.posedit.pos.start.datum == Datum.CDS_START and var.posedit.pos.start.base > cds_length:
            return (ValidationLevel.ERROR, CDS_BOUND_ERROR_MSG.format(cds_length=cds_length))
        if var.posedit.pos.end.datum == Datum.CDS_START and var.posedit.pos.end.base > cds_length:
            return (ValidationLevel.ERROR, CDS_BOUND_ERROR_MSG.format(cds_length=cds_length))
        return (ValidationLevel.VALID, None)

    def _n_within_transcript_bounds(self, var):
        if var.type != 'n':
            return (ValidationLevel.VALID, None)
        tx_info = self.hdp.get_tx_identity_info(var.ac)
        tx_len = sum(tx_info["lengths"])
        if tx_info is None:
            return (ValidationLevel.WARNING,
                    "No transcript data for accession: {ac}".format(ac=var.ac))

        if var.posedit.pos.start.datum == Datum.SEQ_START and var.posedit.pos.start.base <= 0: