def _singularity_image_name_on_disk(name: str) -> str:
    """Convert a singularity URI to an on disk sif name
    :param str name: Singularity image name
    :rtype: str
    :return: singularity image name on disk
    """
    docker = False
    if name.startswith('shub://'):
        name = name[7:]
    elif name.startswith('library://'):
        name = name[10:]
    elif name.startswith('oras://'):
        name = name[7:]
    elif name.startswith('docker://'):
        docker = True
        name = name[9:]
        # singularity only uses the final portion
        name = name.split('/')[-1]
    name = name.replace('/', '-')
    if docker:
        name = name.replace(':', '-')
        name = '{}.sif'.format(name)
    else:
        tmp = name.split(':')
        if len(tmp) > 1:
            name = '{}_{}.sif'.format(tmp[0], tmp[1])
        else:
            name = '{}_latest.sif'.format(name)
    return name