import re


def parse_hgvc_c(hgvs_c):
    """
    Parses HGVS like c.4146T>A and returns a dictionary with the keys
    pos, type, ref, alt
    """

    if not hgvs_c.startswith("c.") or "?" in hgvs_c:
        return {}

    parts = re.split(r"([[_\.ACGT]+|[0-9]+|del|ins])", hgvs_c[2:])

    bases = "ATCG"
    pos = ctype = ref = alt = None
    if parts[4] == ">":
        # Substitution.
        pos = parts[1]
        ctype = "sub"
        ref = parts[3]
        alt = parts[5]

    return {
        "pos": pos,
        "type": ctype,
        "ref": ref or '',
        "alt": alt or ''
    }