def chrom_sort_key(x):
    """Return an integer for sorting from a chromosome."""
    if x.startswith('chr'):
        x = x[3:]
    if x.upper() == 'X':
        return 100
    elif x.upper() == 'Y':
        return 101
    elif x.upper().startswith('M'):
        return 150
    elif x.isdigit():
        return int(x)
    return x