def get_genome_dir(infra_id, genver=None, annver=None, key=None):
    """Return the genome directory name from infra_id and optional arguments."""
    dirname = f'{infra_id}'
    if genver is not None:
        dirname += f'.gnm{genver}'
    if annver is not None:
        dirname += f'.ann{annver}'
    if key is not None:
        dirname += f'.{key}'
    return dirname
