def chr2num(chr_name):
    """
    Returns a numerical mapping for a primary chromosome name
    Assumes names are prefixed with "chr"
    """
    chr_id = chr_name[3:]
    if chr_id == 'X':
        return 23
    elif chr_id == 'Y':
        return 24
    elif chr_id == 'M':
        return 25
    return int(chr_id)