def compact_allele_name(raw_allele):
    """
    Turn HLA-A*02:01 into A0201 or H-2-D-b into H-2Db or
    HLA-DPA1*01:05-DPB1*100:01 into DPA10105-DPB110001
    """
    parsed_alleles = parse_classi_or_classii_allele_name(raw_allele)
    normalized_list = []
    if len(parsed_alleles) == 2:
        alpha, beta = parsed_alleles
        # by convention the alpha allelle is omitted since it's assumed
        # to be DRA1*01:01
        if alpha == _DRA1_0101:
            parsed_alleles = [beta]

    for parsed_allele in parsed_alleles:
        if len(parsed_allele.allele_family) > 0:
            normalized_list.append("%s%s%s" % (
                parsed_allele.gene,
                parsed_allele.allele_family,
                parsed_allele.allele_code))
        else:
            # mice don't have allele families
            normalized_list.append("%s%s" % (
                parsed_allele.gene,
                parsed_allele.allele_code))
    return "-".join(normalized_list)