def BiGG_to_KEGG_reaction(model, r_id, kegg_compounds=None):
    """ Convert reaction from BiGG to KEGG notation to be used by eQuilibrator.

    Args:
        model (CBModel): model
        r_id (str): reaction id
        kegg_compounds (list): KEGG compounds accepted by eQuilibrator

    Returns:
        str: KEGG reaction

    Notes:
        If there are multiple KEGG compounds associated with a BiGG id it will use the first match. (As a rule of thumb,
         the first always seems to be the correct one).
        No result is returned if unable to translate any compound.
    """
    reaction = model.reactions[r_id]
    coeffs = []

    for m_id, coeff in reaction.stoichiometry.items():
        metabolite = model.metabolites[m_id]
        if 'KEGG Compound' in metabolite.metadata:
            match = False
            for kegg_id in metabolite.metadata['KEGG Compound'].split(';'):
                if kegg_compounds and kegg_id in kegg_compounds or kegg_compounds is None:
                    coeffs.append((kegg_id, coeff))
                    match = True
                    break
            if not match:
                return None
        else:
            return None

    substrates = [kegg_id if coeff == -1 else '{} {}'.format(-coeff, kegg_id)
                  for kegg_id, coeff in coeffs if coeff < 0]
    products = [kegg_id if coeff == 1 else '{} {}'.format(coeff, kegg_id)
                for kegg_id, coeff in coeffs if coeff > 0]
    rxn_str = ' + '.join(substrates) + ' <=> ' + ' + '.join(products)

    return rxn_str