def _transform_chrom(chrom):
    """Helper function to obtain specific sort order."""
    try:
        c = int(chrom)
    except:
        if chrom in ['X', 'Y']:
            return chrom
        elif chrom == 'MT':
            return '_MT'
        else:
            return '__' + chrom
    else:
        return '%02d' % c
