def is_valid(metabolite, INVALID_FORMULA_STR=["(", "Generic", "R", "X"]):
    """
    The validity of the input metabolites is checked. It's invalid if it
    does not have any formula annotated or if the formula includes previously
    defined invalid symbols

    Parameters
    ----------
    metabolite : cobra.Metabolite
        A metabolite in the cobra format including additional information
        (formula, charge, elements)

    INVALID_FORMULA_STR : list
        A list of previously defined invalid symbol strings

    Returns
    -------
    boolean
        Valid or invalid metabolite
    """
    if not metabolite.formula:
        return False
    for string in INVALID_FORMULA_STR:
        if string in metabolite.formula:
            return False
    return True