def genes_in_rule(rule):
    """Given a reaction rule, return a list of genes.

    Args:
        rule (str): the reaction rule.

    Returns:
        list(str): the genes.

    """
    genes = set(rule.replace('and', '').replace('or', '').replace('(', '').replace(')', '').split())
    if len(genes) == 0:
        raise UserWarning('ERROR: no genes found in reaction rule.')
    return genes