# Path: hgvs/exceptions.py
# class HGVSError(Exception):
#     pass
# 
# class HGVSUnsupportedOperationError(HGVSError):
#     pass


import attr
import hgvs
import six
    import doctest
from bioutils.sequences import aa_to_aa1, aa1_to_aa3
from hgvs.exceptions import HGVSError, HGVSUnsupportedOperationError
        >>> NARefAlt("ACGT").ref_s
        u'ACGT'
        >>> NARefAlt("7").ref_s
        >>> NARefAlt(7).ref_s

        """
        return self.ref if (isinstance(self.ref, six.string_types) and self.ref
                            and self.ref[0] in "ACGTUN") else None

    @property
    def ref_n(self):
        """
        returns an integer, either from the `ref` instance variable if it's a number, or the length of
        ref if it's a string, or None otherwise

        >>> NARefAlt("ACGT").ref_n
        4
        >>> NARefAlt("7").ref_n
        7
        >>> NARefAlt(7).ref_n
        7

        """
        try:
            return int(self.ref)
        except ValueError:
            return len(self.ref) if self.ref else None

    def format(self, conf=None):
        if self.ref is None and self.alt is None:

# Path: hgvs/exceptions.py
# class HGVSError(Exception):
#     pass
# 
# class HGVSUnsupportedOperationError(HGVSError):
#     pass


# Path: hgvs/edit.py
import attr
import hgvs
import six
    import doctest
from bioutils.sequences import aa_to_aa1, aa1_to_aa3
from hgvs.exceptions import HGVSError, HGVSUnsupportedOperationError

        >>> NARefAlt("ACGT").ref_s
        u'ACGT'
        >>> NARefAlt("7").ref_s
        >>> NARefAlt(7).ref_s

        """
        return self.ref if (isinstance(self.ref, six.string_types) and self.ref
                            and self.ref[0] in "ACGTUN") else None

    @property
    def ref_n(self):
        """
        returns an integer, either from the `ref` instance variable if it's a number, or the length of
        ref if it's a string, or None otherwise

        >>> NARefAlt("ACGT").ref_n
        4
        >>> NARefAlt("7").ref_n
        7
        >>> NARefAlt(7).ref_n
        7

        """
        try:
            return int(self.ref)
        except ValueError:
            return len(self.ref) if self.ref else None

    def format(self, conf=None):
        if self.ref is None and self.alt is None:

            raise HGVSError("RefAlt: ref and alt sequences are both undefined")